diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 0366fcde..21b5ef6d 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -1504,6 +1504,18 @@ def dbcheck(): except sqlite3.OperationalError: logger.warn("Unable to capitalize Windows platform values in session_history table.") + # Upgrade session_history table from earlier versions + try: + result = c_db.execute("SELECT platform FROM session_history " + "WHERE platform = 'macos'").fetchall() + if len(result) > 0: + logger.debug("Altering database. Capitalizing macOS platform values in session_history table.") + c_db.execute( + "UPDATE session_history SET platform = 'macOS' WHERE platform = 'macos' " + ) + except sqlite3.OperationalError: + logger.warn("Unable to capitalize macOS platform values in session_history table.") + # Upgrade session_history_metadata table from earlier versions try: c_db.execute("SELECT full_title FROM session_history_metadata") diff --git a/plexpy/common.py b/plexpy/common.py index fb35beb3..8d68e2ad 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -102,7 +102,8 @@ PLATFORM_NAME_OVERRIDES = { 'Mystery 5': 'Xbox 360', 'WebMAF': 'Playstation 4', 'windows': 'Windows', - 'osx': 'macOS' + 'osx': 'macOS', + 'macos': 'macOS', } PMS_PLATFORM_NAME_OVERRIDES = {