diff --git a/CHANGELOG.md b/CHANGELOG.md index fabe94f2..4424b7f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## v1.4.12 (2016-09-18) + +* Fix: PMS update check not working for MacOSX. +* Fix: Square covers for music stats on homepage. +* Fix: Card width on the homepage for iPhone 6/7 Plus. (Thanks @XusBadia) +* Fix: Check for running PID when starting PlexPy. (Thanks @spolyack) +* Fix: FreeBSD service script not stopping PlexPy properly. +* Fix: Some web UI cleanup. +* Change: GitHub repostitory moved. + + ## v1.4.11 (2016-09-02) * Fix: PlexWatch and Plexivity import errors. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b0c6a04b..6b5e9643 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,14 +9,14 @@ In case you read this because you are posting an issue, please take a minute and - Turning your device off and on again. - Analyzing your logs, you just might find the solution yourself! - Using the **search** function to see if this issue has already been reported/solved. -- Checking the [Wiki](https://github.com/drzoidberg33/plexpy/wiki) for -[ [Installation] ](https://github.com/drzoidberg33/plexpy/wiki/Installation) and -[ [FAQs] ](https://github.com/drzoidberg33/plexpy/wiki/Frequently-Asked-Questions-(FAQ)). -- For basic questions try asking on [Gitter](https://gitter.im/drzoidberg33/plexpy) or the [Plex Forums](https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program) first before opening an issue. +- Checking the [Wiki](https://github.com/JonnyWong16/plexpy/wiki) for +[ [Installation] ](https://github.com/JonnyWong16/plexpy/wiki/Installation) and +[ [FAQs] ](https://github.com/JonnyWong16/plexpy/wiki/Frequently-Asked-Questions-(FAQ)). +- For basic questions try asking on [Gitter](https://gitter.im/plexpy/general) or the [Plex Forums](https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program) first before opening an issue. ##### If nothing has worked: -1. Open a new issue on the GitHub [issue tracker](http://github.com/drzoidberg33/plexpy/issues). +1. Open a new issue on the GitHub [issue tracker](http://github.com/JonnyWong16/plexpy/issues). 2. Provide a clear title to easily help identify your problem. 3. Use proper [markdown syntax](https://help.github.com/articles/github-flavored-markdown) to structure your post (i.e. code/log in code blocks). 4. Make sure you provide the following information: diff --git a/PlexPy.py b/PlexPy.py index 82a91808..903ce790 100755 --- a/PlexPy.py +++ b/PlexPy.py @@ -122,8 +122,21 @@ def main(): # If the pidfile already exists, plexpy may still be running, so # exit if os.path.exists(plexpy.PIDFILE): - raise SystemExit("PID file '%s' already exists. Exiting." % - plexpy.PIDFILE) + try: + with open(plexpy.PIDFILE, 'r') as fp: + pid = int(fp.read()) + os.kill(pid, 0) + except IOError as e: + raise SystemExit("Unable to read PID file: %s", e) + except OSError: + logger.warn("PID file '%s' already exists, but PID %d is " \ + "not running. Ignoring PID file." % + (plexpy.PIDFILE, pid)) + else: + # The pidfile exists and points to a live PID. plexpy may + # still be running, so exit. + raise SystemExit("PID file '%s' already exists. Exiting." % + plexpy.PIDFILE) # The pidfile is only useful in daemon mode, make sure we can write the # file properly diff --git a/README.md b/README.md index 6bebbb64..bdc5c773 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # PlexPy -[![Join the chat at https://gitter.im/drzoidberg33/plexpy](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/drzoidberg33/plexpy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Join the chat at https://gitter.im/plexpy/general](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/plexpy/general?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) A python based web application for monitoring, analytics and notifications for [Plex Media Server](https://plex.tv). This project is based on code from [Headphones](https://github.com/rembo10/headphones) and [PlexWatchWeb](https://github.com/ecleese/plexWatchWeb). * [Plex forum thread](https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program) -* [Gitter chat](https://gitter.im/drzoidberg33/plexpy) +* [Gitter chat](https://gitter.im/plexpy/general) * [/r/Plex Discord server](https://discord.gg/011TFFWSuNFI02EKr) | [PlexPy Discord server](https://discord.gg/36ggawe) ## Features @@ -35,8 +35,8 @@ This project is based on code from [Headphones](https://github.com/rembo10/headp ## Installation and Support -* [Installation Guides](https://github.com/drzoidberg33/plexpy/wiki/Installation) shows you how to install PlexPy. -* [FAQs](https://github.com/drzoidberg33/plexpy/wiki/Frequently-Asked-Questions-(FAQ)) in the wiki can help you with common problems. +* [Installation Guides](https://github.com/JonnyWong16/plexpy/wiki/Installation) shows you how to install PlexPy. +* [FAQs](https://github.com/JonnyWong16/plexpy/wiki/Frequently-Asked-Questions-(FAQ)) in the wiki can help you with common problems. **Support** the project by implementing new features, solving support tickets and provide bug fixes. @@ -48,14 +48,14 @@ This project is based on code from [Headphones](https://github.com/rembo10/headp - Turning your device off and on again. - Analyzing your logs, you just might find the solution yourself! - Using the **search** function to see if this issue has already been reported/solved. -- Checking the [Wiki](https://github.com/drzoidberg33/plexpy/wiki) for -[ [Installation] ](https://github.com/drzoidberg33/plexpy/wiki/Installation) and -[ [FAQs] ](https://github.com/drzoidberg33/plexpy/wiki/Frequently-Asked-Questions-(FAQ)). -- For basic questions try asking on [Gitter](https://gitter.im/drzoidberg33/plexpy) or the [Plex Forums](https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program) first before opening an issue. +- Checking the [Wiki](https://github.com/JonnyWong16/plexpy/wiki) for +[ [Installation] ](https://github.com/JonnyWong16/plexpy/wiki/Installation) and +[ [FAQs] ](https://github.com/JonnyWong16/plexpy/wiki/Frequently-Asked-Questions-(FAQ)). +- For basic questions try asking on [Gitter](https://gitter.im/plexpy/general) or the [Plex Forums](https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program) first before opening an issue. ##### If nothing has worked: -1. Open a new issue on the GitHub [issue tracker](http://github.com/drzoidberg33/plexpy/issues). +1. Open a new issue on the GitHub [issue tracker](http://github.com/JonnyWong16/plexpy/issues). 2. Provide a clear title to easily help identify your problem. 3. Use proper [markdown syntax](https://help.github.com/articles/github-flavored-markdown) to structure your post (i.e. code/log in code blocks). 4. Make sure you provide the following information: diff --git a/data/interfaces/default/base.html b/data/interfaces/default/base.html index a0b0001f..baaab0ee 100644 --- a/data/interfaces/default/base.html +++ b/data/interfaces/default/base.html @@ -220,6 +220,8 @@
  • Settings
  • View Logs
  • +
  • FAQ
  • +
  • Support
  • Paypal
  • Bitcoin
  • diff --git a/data/interfaces/default/configuration_table.html b/data/interfaces/default/configuration_table.html index 4dd14b6e..013ad141 100644 --- a/data/interfaces/default/configuration_table.html +++ b/data/interfaces/default/configuration_table.html @@ -22,11 +22,11 @@ DOCUMENTATION :: END % if plexpy.CURRENT_VERSION: Git Branch: - ${plexpy.CONFIG.GIT_BRANCH} + ${plexpy.CONFIG.GIT_BRANCH} Git Commit Hash: - ${plexpy.CURRENT_VERSION} + ${plexpy.CURRENT_VERSION} % endif @@ -72,32 +72,67 @@ DOCUMENTATION :: END ${sys.version} - Plex Forums: - https://forums.plex.tv/discussion/169591/plexpy-another-plex-monitoring-program + Resources: + + GitHub Source | + GitHub Issues | + FeatHub Feature Requests | + PlexPy Wiki | + PlexPy FAQ + - Source: - https://github.com/drzoidberg33/plexpy - - - Wiki: - https://github.com/drzoidberg33/plexpy/wiki - - - Issues: - https://github.com/drzoidberg33/plexpy/issues - - - Feature Requests: - http://feathub.com/drzoidberg33/plexpy - - - Gitter Chat: - https://gitter.im/drzoidberg33/plexpy + Support: + + Plex Forums | + PlexPy Gitter Chat | + /r/Plex Discord Server | + PlexPy Discord Server + + + + + \ No newline at end of file diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 76441f73..9a18c04a 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -1929,6 +1929,12 @@ a .library-user-instance-box:hover { position: absolute; overflow: hidden; } +.home-platforms-instance-cover { + margin-left: 0px; + position: absolute; + top: 20px; + overflow: hidden; +} .home-platforms-instance-poster .home-platforms-poster-face { background-position: center; background-size: cover; @@ -1938,6 +1944,15 @@ a .library-user-instance-box:hover { -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); } +.home-platforms-instance-cover .home-platforms-cover-face { + background-position: center; + background-size: cover; + height: 80px; + width: 80px; + -webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); +} .home-platforms-instance-poster .home-platforms-library-thumb { background-position: center; background-size: cover; @@ -2087,6 +2102,12 @@ a .library-user-instance-box:hover { left: 20px; overflow: hidden; } +.home-platforms-instance-list-cover { + position: absolute; + top: 10px; + left: 20px; + overflow: hidden; +} .home-platforms-instance-list-poster .home-platforms-list-poster-face { background-position: center; background-size: cover; @@ -2096,6 +2117,15 @@ a .library-user-instance-box:hover { -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); } +.home-platforms-instance-list-cover .home-platforms-list-cover-face { + background-position: center; + background-size: cover; + height: 40px; + width: 40px; + -webkit-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + -moz-box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); + box-shadow: 0 0 4px rgba(0,0,0,.3),inset 0 0 0 1px rgba(255,255,255,.1); +} .home-platforms-instance-list-box { background-position: center; background-size: cover; @@ -2154,7 +2184,9 @@ a .home-platforms-instance-oval:hover, a .home-platforms-instance-list-box:hover, a .home-platforms-instance-list-oval:hover, a .home-platforms-poster-face:hover, -a .home-platforms-list-poster-face:hover +a .home-platforms-cover-face:hover, +a .home-platforms-list-poster-face:hover, +a .home-platforms-list-cover-face:hover { -webkit-box-shadow: inset 0 0 0 2px #e9a049; -moz-box-shadow: inset 0 0 0 2px #e9a049; @@ -2630,7 +2662,7 @@ a .home-platforms-list-poster-face:hover @media only screen and (min-device-width: 300px) - and (max-device-width: 400px) { + and (max-device-width: 450px) { .home-platforms-instance { width: calc(100% - 20px); } diff --git a/data/interfaces/default/home_stats.html b/data/interfaces/default/home_stats.html index 9ed09655..2ee6b72a 100644 --- a/data/interfaces/default/home_stats.html +++ b/data/interfaces/default/home_stats.html @@ -509,21 +509,21 @@ DOCUMENTATION :: END % if top_stat['rows'][0]['rating_key']: % if top_stat['rows'][0]['grandparent_thumb']: -
    -
    +
    +
    % if _session['user_group'] == 'admin': % endif
    % else: -
    -
    +
    +
    % endif
    % else: -
    -
    +
    +
    % endif % if len(top_stat['rows']) > 1: @@ -558,21 +558,21 @@ DOCUMENTATION :: END % if top_stat['rows'][loop.index]['rating_key']: % if top_stat['rows'][loop.index]['grandparent_thumb']: -
    -
    +
    +
    % if _session['user_group'] == 'admin': % endif
    % else: -
    -
    +
    +
    % endif
    % else: -
    -
    +
    +
    % endif
    @@ -611,21 +611,21 @@ DOCUMENTATION :: END % if top_stat['rows'][0]['rating_key']: % if top_stat['rows'][0]['grandparent_thumb'] != '': -
    -
    +
    +
    % if _session['user_group'] == 'admin': % endif
    % else: -
    -
    +
    +
    % endif
    % else: -
    -
    +
    +
    % endif % if len(top_stat['rows']) > 1: @@ -656,21 +656,21 @@ DOCUMENTATION :: END % if top_stat['rows'][loop.index]['rating_key']: % if top_stat['rows'][loop.index]['grandparent_thumb']: -
    -
    +
    +
    % if _session['user_group'] == 'admin': % endif
    % else: -
    -
    +
    +
    % endif
    % else: -
    -
    +
    +
    % endif
    diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 6630ff9d..465cbbaa 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1264,7 +1264,7 @@ - @@ -1285,7 +1285,7 @@
    + Year
    - @@ -1316,7 +1316,7 @@
    + Month
    - @@ -1337,7 +1337,7 @@
    + Day of the Year
    - @@ -1363,7 +1363,7 @@
    + Day of the Month
    - @@ -1389,7 +1389,7 @@
    + Day of the Week
    - @@ -1420,7 +1420,7 @@
    + Hour
    - @@ -1441,7 +1441,7 @@
    + Minute
    - @@ -1462,7 +1462,7 @@
    + Second
    - @@ -1483,7 +1483,7 @@
    + AM / PM
    - @@ -1504,7 +1504,7 @@
    + Timezone
    - @@ -1574,7 +1574,7 @@
    + Timestamp
    - @@ -1619,7 +1619,7 @@
    + Global
    - @@ -1778,7 +1778,7 @@
    + Stream Details
    - @@ -1915,12 +1915,12 @@ +

    (PMS agent must be Plex Movie)

    +

    (PMS agent must be Plex Movie)

    @@ -1972,7 +1972,7 @@
    + Metadata Details
    {imdb_id} The IMDB ID for the movie. (e.g. tt2488496) -

    (PMS agent must be Freebase)

    {imdb_url} The IMDB URL for the movie. -

    (PMS agent must be Freebase)

    {thetvdb_id}
    - @@ -2039,27 +2039,27 @@ - @@ -2141,6 +2121,11 @@ } else if ("${kwargs.get('reinstall_geoip')}" == 'true') { $('#reinstall_geoip_db').removeClass('no-highlight').css('color','#e9a049'); } + if ("${kwargs.get('support')}" == 'true') { + $('.support-modal-link').removeClass('no-highlight').css('color','#e9a049'); + $('#best-support-link').prepend(' ') + $('#best-support-link span').tooltip({ container: 'body' }); + } } }); } diff --git a/init-scripts/init.freebsd b/init-scripts/init.freebsd index 2cfb472f..69afbd08 100755 --- a/init-scripts/init.freebsd +++ b/init-scripts/init.freebsd @@ -49,23 +49,33 @@ fi verify_plexpy_pid() { # Make sure the pid corresponds to the PlexPy process. - pid=`cat ${plexpy_pid} 2>/dev/null` - ps -p ${pid} | grep -q "python ${plexpy_dir}/PlexPy.py" - return $? + if [ -f ${plexpy_pid} ]; then + pid=`cat ${plexpy_pid} 2>/dev/null` + ps -p ${pid} | grep -q "python2 ${plexpy_dir}/PlexPy.py" + return $? + else + return 0 + fi } -# Try to stop PlexPy cleanly by calling shutdown over http. +# Try to stop PlexPy cleanly by sending SIGTERM plexpy_stop() { echo "Stopping $name" verify_plexpy_pid if [ -n "${pid}" ]; then + kill ${pid} wait_for_pids ${pid} - echo "Stopped" + echo "Stopped." fi } plexpy_status() { - verify_plexpy_pid && echo "$name is running as ${pid}" || echo "$name is not running" + verify_plexpy_pid + if [ -n "${pid}" ]; then + echo "$name is running as ${pid}." + else + echo "$name is not running." + fi } run_rc_command "$1" diff --git a/init-scripts/init.freenas b/init-scripts/init.freenas index c19b824b..f708c85e 100755 --- a/init-scripts/init.freenas +++ b/init-scripts/init.freenas @@ -58,7 +58,7 @@ verify_plexpy_pid() { fi } -# Try to stop PlexPy cleanly by calling shutdown over http. +# Try to stop PlexPy cleanly by sending SIGTERM plexpy_stop() { echo "Stopping $name." verify_plexpy_pid diff --git a/plexpy/common.py b/plexpy/common.py index 5c69c8c7..6d734c0c 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -31,14 +31,6 @@ PLATFORM_VERSION = platform.release() BRANCH = version.PLEXPY_VERSION VERSION_NUMBER = version.PLEXPY_RELEASE_VERSION -# Notification Types -NOTIFY_STARTED = 1 -NOTIFY_STOPPED = 2 - -notify_strings = {} -notify_strings[NOTIFY_STARTED] = "Playback started" -notify_strings[NOTIFY_STOPPED] = "Playback stopped" - DEFAULT_USER_THUMB = "interfaces/default/images/gravatar-default-80x80.png" DEFAULT_POSTER_THUMB = "interfaces/default/images/poster.png" DEFAULT_COVER_THUMB = "interfaces/default/images/cover.png" @@ -47,7 +39,11 @@ DEFAULT_ART = "interfaces/default/images/art.png" PLATFORM_NAME_OVERRIDES = {'Konvergo': 'Plex Media Player', 'Mystery 3': 'Playstation 3', 'Mystery 4': 'Playstation 4', - 'Mystery 5': 'Xbox 360'} + 'Mystery 5': 'Xbox 360' + } + +PMS_PLATFORM_NAME_OVERRIDES = {'MacOSX': 'Mac' + } MEDIA_FLAGS_AUDIO = {'ac.?3': 'dolby_digital', 'truehd': 'dolby_truehd', diff --git a/plexpy/config.py b/plexpy/config.py index f228056c..4e5f57bb 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -170,7 +170,7 @@ _CONFIG_DEFINITIONS = { 'GIT_BRANCH': (str, 'General', 'master'), 'GIT_PATH': (str, 'General', ''), 'GIT_TOKEN': (str, 'General', ''), - 'GIT_USER': (str, 'General', 'drzoidberg33'), + 'GIT_USER': (str, 'General', 'JonnyWong16'), 'GRAPH_TYPE': (str, 'General', 'plays'), 'GRAPH_DAYS': (int, 'General', 30), 'GRAPH_TAB': (str, 'General', 'tabs-1'), @@ -801,4 +801,9 @@ class Config(object): if self.CONFIG_VERSION == '5': self.MONITOR_PMS_UPDATES = 0 - self.CONFIG_VERSION = '6' \ No newline at end of file + self.CONFIG_VERSION = '6' + + if self.CONFIG_VERSION == '6': + if self.GIT_USER.lower() == 'drzoidberg33': + self.GIT_USER = 'JonnyWong16' + self.CONFIG_VERSION = '7' \ No newline at end of file diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 0bff8a62..e1e6944c 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -626,9 +626,9 @@ class PrettyMetadata(object): self.poster_url = self.metadata.get('poster_url','') if not self.poster_url: if self.metadata['media_type'] in ['artist', 'track']: - self.poster_url = 'https://raw.githubusercontent.com/drzoidberg33/plexpy/master/data/interfaces/default/images/cover.png' + self.poster_url = 'https://raw.githubusercontent.com/%s/plexpy/master/data/interfaces/default/images/cover.png' % plexpy.CONFIG.GIT_USER else: - self.poster_url = 'https://raw.githubusercontent.com/drzoidberg33/plexpy/master/data/interfaces/default/images/poster.png' + self.poster_url = 'https://raw.githubusercontent.com/%s/plexpy/master/data/interfaces/default/images/poster.png' % plexpy.CONFIG.GIT_USER return self.poster_url def get_poster_link(self): diff --git a/plexpy/plextv.py b/plexpy/plextv.py index 5cdf6e78..25c60d71 100644 --- a/plexpy/plextv.py +++ b/plexpy/plextv.py @@ -21,6 +21,7 @@ import json from xml.dom import minidom import plexpy +import common import database import helpers import http_handler @@ -628,12 +629,13 @@ class PlexTV(object): return {} # Get the updates for the platform - platform_downloads = available_downloads.get('computer').get(plexpy.CONFIG.PMS_PLATFORM) or \ - available_downloads.get('nas').get(plexpy.CONFIG.PMS_PLATFORM) + pms_platform = common.PMS_PLATFORM_NAME_OVERRIDES.get(plexpy.CONFIG.PMS_PLATFORM, plexpy.CONFIG.PMS_PLATFORM) + platform_downloads = available_downloads.get('computer').get(pms_platform) or \ + available_downloads.get('nas').get(pms_platform) if not platform_downloads: logger.error(u"PlexPy PlexTV :: Unable to retrieve Plex updates: Could not match server platform: %s." - % plexpy.CONFIG.PMS_PLATFORM) + % pms_platform) return {} v_old = helpers.cast_to_int("".join(v.zfill(4) for v in plexpy.CONFIG.PMS_VERSION.split('-')[0].split('.')[:4])) diff --git a/plexpy/version.py b/plexpy/version.py index 4ba5caf9..9c1b9956 100644 --- a/plexpy/version.py +++ b/plexpy/version.py @@ -1,2 +1,2 @@ PLEXPY_VERSION = "master" -PLEXPY_RELEASE_VERSION = "1.4.11" +PLEXPY_RELEASE_VERSION = "1.4.12" diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 78cd9e7d..31fc35f5 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -81,7 +81,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def index(self): + def index(self, **kwargs): if plexpy.CONFIG.FIRST_RUN_COMPLETE: raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home") else: @@ -168,7 +168,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def home(self): + def home(self, **kwargs): config = { "home_sections": plexpy.CONFIG.HOME_SECTIONS, "home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH, @@ -329,7 +329,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def delete_temp_sessions(self): + def delete_temp_sessions(self, **kwargs): result = database.delete_sessions() @@ -343,7 +343,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def libraries(self): + def libraries(self, **kwargs): config = { "update_section_ids": plexpy.CONFIG.UPDATE_SECTION_IDS } @@ -469,7 +469,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def library(self, section_id=None): + def library(self, section_id=None, **kwargs): if not allow_session_library(section_id): raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT) @@ -708,7 +708,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def get_media_info_file_sizes(self, section_id=None, rating_key=None): + def get_media_info_file_sizes(self, section_id=None, rating_key=None, **kwargs): get_file_sizes_hold = plexpy.CONFIG.GET_FILE_SIZES_HOLD section_ids = set(get_file_sizes_hold['section_ids']) rating_keys = set(get_file_sizes_hold['rating_keys']) @@ -999,7 +999,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def delete_duplicate_libraries(self): + def delete_duplicate_libraries(self, **kwargs): library_data = libraries.Libraries() result = library_data.delete_duplicate_libraries() @@ -1013,7 +1013,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def users(self): + def users(self, **kwargs): return serve_template(templatename="users.html", title="Users") @cherrypy.expose @@ -1100,7 +1100,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def user(self, user_id=None): + def user(self, user_id=None, **kwargs): if not allow_session_user(user_id): raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT) @@ -1566,7 +1566,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def history(self): + def history(self, **kwargs): return serve_template(templatename="history.html", title="History") @cherrypy.expose @@ -1740,7 +1740,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def graphs(self): + def graphs(self, **kwargs): config = { "graph_type": plexpy.CONFIG.GRAPH_TYPE, @@ -1753,7 +1753,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) - def set_graph_config(self, graph_type=None, graph_days=None, graph_tab=None): + def set_graph_config(self, graph_type=None, graph_days=None, graph_tab=None, **kwargs): if graph_type: plexpy.CONFIG.__setattr__('GRAPH_TYPE', graph_type) plexpy.CONFIG.write() @@ -2203,7 +2203,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def sync(self): + def sync(self, **kwargs): return serve_template(templatename="sync.html", title="Synced Items") @cherrypy.expose @@ -2229,7 +2229,7 @@ class WebInterface(object): ##### Logs ##### @cherrypy.expose @requireAuth(member_of("admin")) - def logs(self): + def logs(self, **kwargs): return serve_template(templatename="logs.html", title="Log") @cherrypy.expose @@ -2443,7 +2443,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def delete_logs(self): + def delete_logs(self, **kwargs): log_file = logger.FILENAME try: open(os.path.join(plexpy.CONFIG.LOG_DIR, log_file), 'w').close() @@ -2459,7 +2459,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) - def toggleVerbose(self): + def toggleVerbose(self, **kwargs): plexpy.VERBOSE = not plexpy.VERBOSE logger.initLogger(console=not plexpy.QUIET, log_dir=plexpy.CONFIG.LOG_DIR, verbose=plexpy.VERBOSE) @@ -2469,7 +2469,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def log_js_errors(self, page, message, file, line): + def log_js_errors(self, page, message, file, line, **kwargs): """ Logs javascript errors from the web interface. """ logger.error(u"WebUI :: /%s : %s. (%s:%s)" % (page.rpartition('/')[-1], message, @@ -2479,7 +2479,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) - def logFile(self): + def logFile(self, **kwargs): try: with open(os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME), 'r') as f: return '
    %s
    ' % f.read() @@ -2764,7 +2764,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def backup_config(self): + def backup_config(self, **kwargs): """ Creates a manual backup of the plexpy.db file """ result = config.make_backup() @@ -2787,11 +2787,12 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def get_server_update_params(self): + def get_server_update_params(self, **kwargs): plex_tv = plextv.PlexTV() plexpass = plex_tv.get_plexpass_status() return {'plexpass': plexpass, - 'pms_platform': plexpy.CONFIG.PMS_PLATFORM, + 'pms_platform': common.PMS_PLATFORM_NAME_OVERRIDES.get( + plexpy.CONFIG.PMS_PLATFORM, plexpy.CONFIG.PMS_PLATFORM), 'pms_update_channel': plexpy.CONFIG.PMS_UPDATE_CHANNEL, 'pms_update_distro': plexpy.CONFIG.PMS_UPDATE_DISTRO, 'pms_update_distro_build': plexpy.CONFIG.PMS_UPDATE_DISTRO_BUILD} @@ -2799,7 +2800,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def backup_db(self): + def backup_db(self, **kwargs): """ Creates a manual backup of the plexpy.db file """ result = database.make_backup() @@ -2813,7 +2814,7 @@ class WebInterface(object): @cherrypy.tools.json_out() @requireAuth(member_of("admin")) @addtoapi() - def install_geoip_db(self): + def install_geoip_db(self, **kwargs): """ Downloads and installs the GeoLite2 database """ result = helpers.install_geoip_db() @@ -2827,7 +2828,7 @@ class WebInterface(object): @cherrypy.tools.json_out() @requireAuth(member_of("admin")) @addtoapi() - def uninstall_geoip_db(self): + def uninstall_geoip_db(self, **kwargs): """ Uninstalls the GeoLite2 database """ result = helpers.uninstall_geoip_db() @@ -2957,14 +2958,14 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) - def facebookStep1(self): + def facebookStep1(self, **kwargs): cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store" facebook = notifiers.FacebookNotifier() return facebook._get_authorization() @cherrypy.expose @requireAuth(member_of("admin")) - def facebookStep2(self, code): + def facebookStep2(self, code, **kwargs): cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store" facebook = notifiers.FacebookNotifier() result = facebook._get_credentials(code) @@ -2976,7 +2977,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) - def osxnotifyregister(self, app): + def osxnotifyregister(self, app, **kwargs): cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store" from osxnotify import registerapp as osxnotify @@ -3174,20 +3175,20 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) - def generateAPI(self): + def generateAPI(self, **kwargs): apikey = hashlib.sha224(str(random.getrandbits(256))).hexdigest()[0:32] logger.info(u"New API key generated.") return apikey @cherrypy.expose @requireAuth(member_of("admin")) - def checkGithub(self): + def checkGithub(self, **kwargs): versioncheck.checkGithub() raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home") @cherrypy.expose @requireAuth(member_of("admin")) - def do_state_change(self, signal, title, timer): + def do_state_change(self, signal, title, timer, **kwargs): message = title quote = self.random_arnold_quotes() plexpy.SIGNAL = signal @@ -3197,17 +3198,17 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) - def shutdown(self): + def shutdown(self, **kwargs): return self.do_state_change('shutdown', 'Shutting Down', 15) @cherrypy.expose @requireAuth(member_of("admin")) - def restart(self): + def restart(self, **kwargs): return self.do_state_change('restart', 'Restarting', 30) @cherrypy.expose @requireAuth(member_of("admin")) - def update(self): + def update(self, **kwargs): return self.do_state_change('update', 'Updating', 120) @@ -3330,7 +3331,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth(member_of("admin")) @addtoapi() - def download_log(self): + def download_log(self, **kwargs): """ Download the PlexPy log file. """ log_file = logger.FILENAME try: @@ -3368,7 +3369,7 @@ class WebInterface(object): @cherrypy.tools.json_out() @requireAuth(member_of("admin")) @addtoapi() - def delete_image_cache(self): + def delete_image_cache(self, **kwargs): """ Delete and recreate the image cache directory. """ return self.delete_cache(folder='images') @@ -3376,7 +3377,7 @@ class WebInterface(object): @cherrypy.tools.json_out() @requireAuth(member_of("admin")) @addtoapi() - def delete_cache(self, folder=''): + def delete_cache(self, folder='', **kwargs): """ Delete and recreate the cache directory. """ cache_dir = os.path.join(plexpy.CONFIG.CACHE_DIR, folder) result = 'success' @@ -3403,7 +3404,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def delete_poster_url(self, poster_url=''): + def delete_poster_url(self, poster_url='', **kwargs): if poster_url: data_factory = datafactory.DataFactory() @@ -3421,7 +3422,7 @@ class WebInterface(object): @cherrypy.expose @requireAuth() - def search(self, query=''): + def search(self, query='', **kwargs): return serve_template(templatename="search.html", title="Search", query=query) @cherrypy.expose @@ -4283,7 +4284,7 @@ class WebInterface(object): @cherrypy.expose @cherrypy.tools.json_out() @requireAuth(member_of("admin")) - def check_pms_updater(self): + def check_pms_updater(self, **kwargs): pms_connect = pmsconnect.PmsConnect() result = pms_connect.get_update_staus() return result
    + Plex Update Available