From cbee080b54043b03646087f24ed4d5252b536ebe Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 5 Feb 2021 19:32:27 +0100 Subject: [PATCH] Got it to run, renamed some template stuff Now onto the Jellyfin API, yay! --- .gitignore | 4 ++++ data/interfaces/default/base.html | 8 ++++---- data/interfaces/default/configuration_table.html | 4 ++-- data/interfaces/default/edit_library.html | 2 +- data/interfaces/default/edit_user.html | 2 +- data/interfaces/default/export_modal.html | 6 +++--- data/interfaces/default/index.html | 2 +- data/interfaces/default/info.html | 6 +++--- data/interfaces/default/info_children_list.html | 2 +- data/interfaces/default/info_collection_list.html | 4 ++-- .../interfaces/default/info_search_results_list.html | 2 +- data/interfaces/default/library.html | 4 ++-- data/interfaces/default/library_recently_added.html | 2 +- data/interfaces/default/library_stats.html | 2 +- data/interfaces/default/library_user_stats.html | 2 +- data/interfaces/default/login.html | 4 ++-- data/interfaces/default/logs.html | 2 +- data/interfaces/default/newsletter_config.html | 4 ++-- data/interfaces/default/newsletters_table.html | 2 +- data/interfaces/default/notifier_config.html | 4 ++-- data/interfaces/default/queue_modal.html | 4 ++-- data/interfaces/default/recently_added.html | 2 +- data/interfaces/default/scheduler_table.html | 6 +++--- data/interfaces/default/settings.html | 10 +++++----- data/interfaces/default/stream_data.html | 2 +- data/interfaces/default/support.html | 2 +- data/interfaces/default/user.html | 2 +- data/interfaces/default/user_recently_watched.html | 2 +- data/interfaces/default/welcome.html | 4 ++-- data/interfaces/newsletters/recently_added.html | 10 +++++----- .../newsletters/recently_added.internal.html | 12 ++++++------ jellypy/exporter.py | 10 +++++----- jellypy/{plex.py => jellyfin.py} | 10 +++++----- jellypy/libraries.py | 12 ++++++------ 34 files changed, 80 insertions(+), 76 deletions(-) rename jellypy/{plex.py => jellyfin.py} (80%) diff --git a/.gitignore b/.gitignore index 3c45bb08..671b7507 100644 --- a/.gitignore +++ b/.gitignore @@ -273,3 +273,7 @@ $RECYCLE.BIN/ *.lnk # End of https://www.toptal.com/developers/gitignore/api/pycharm+all,python,linux,windows +/config.ini +/release.lock +/tautulli.db +/version.lock diff --git a/data/interfaces/default/base.html b/data/interfaces/default/base.html index 319852e9..d79bba20 100644 --- a/data/interfaces/default/base.html +++ b/data/interfaces/default/base.html @@ -1,8 +1,8 @@ <% - import plexpy - from plexpy import version - from plexpy.helpers import anon_url - from plexpy.notifiers import BROWSER_NOTIFIERS + import jellypy + from jellypy import version + from jellypy.helpers import anon_url + from jellypy.notifiers import BROWSER_NOTIFIERS %> diff --git a/data/interfaces/default/configuration_table.html b/data/interfaces/default/configuration_table.html index 90ff08a6..a3351f69 100644 --- a/data/interfaces/default/configuration_table.html +++ b/data/interfaces/default/configuration_table.html @@ -13,8 +13,8 @@ DOCUMENTATION :: END import os import sys import plexpy - from plexpy import common, logger - from plexpy.helpers import anon_url + from jellypy import common, logger + from jellypy.helpers import anon_url %> diff --git a/data/interfaces/default/edit_library.html b/data/interfaces/default/edit_library.html index 8e6d38b1..f2c4a6f3 100644 --- a/data/interfaces/default/edit_library.html +++ b/data/interfaces/default/edit_library.html @@ -27,7 +27,7 @@ DOCUMENTATION :: END <%! - from plexpy import helpers + from jellypy import helpers %> % if data != None: diff --git a/data/interfaces/default/edit_user.html b/data/interfaces/default/edit_user.html index ebb18867..e21f010f 100644 --- a/data/interfaces/default/edit_user.html +++ b/data/interfaces/default/edit_user.html @@ -27,7 +27,7 @@ DOCUMENTATION :: END <%! - from plexpy import helpers + from jellypy import helpers %> % if data != None: diff --git a/data/interfaces/default/export_modal.html b/data/interfaces/default/export_modal.html index 5154d53a..798e79c2 100644 --- a/data/interfaces/default/export_modal.html +++ b/data/interfaces/default/export_modal.html @@ -14,9 +14,9 @@ data :: Usable parameters DOCUMENTATION :: END <% - import plexpy - from plexpy import exporter - from plexpy.helpers import anon_url + import jellypy + from jellypy import exporter + from jellypy.helpers import anon_url export = exporter.Export() thumb_media_types = ', '.join([export.PLURAL_MEDIA_TYPES[k] for k, v in export.MEDIA_TYPES.items() if v[0]]) art_media_types = ', '.join([export.PLURAL_MEDIA_TYPES[k] for k, v in export.MEDIA_TYPES.items() if v[1]]) diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index e0f6fc73..5e6dcacb 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -5,7 +5,7 @@ <%def name="body()"> -<% from plexpy import PLEX_SERVER_UP %> +<% from jellypy import PLEX_SERVER_UP %>
% for section in config['home_sections']: % if section == 'current_activity': diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 83cfd183..69b9bf8f 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -39,9 +39,9 @@ DOCUMENTATION :: END from collections import defaultdict import re - from plexpy import notifiers - from plexpy.common import MEDIA_TYPE_HEADERS, MEDIA_FLAGS_AUDIO, MEDIA_FLAGS_VIDEO - from plexpy.helpers import page, get_percent, cast_to_int + from jellypy import notifiers + from jellypy.common import MEDIA_TYPE_HEADERS, MEDIA_FLAGS_AUDIO, MEDIA_FLAGS_VIDEO + from jellypy.helpers import page, get_percent, cast_to_int # Get audio codec file def af(codec): diff --git a/data/interfaces/default/info_children_list.html b/data/interfaces/default/info_children_list.html index 5be46e83..de48ec8b 100644 --- a/data/interfaces/default/info_children_list.html +++ b/data/interfaces/default/info_children_list.html @@ -28,7 +28,7 @@ DOCUMENTATION :: END % if data != None: <% - from plexpy.helpers import cast_to_int, page + from jellypy.helpers import cast_to_int, page %> % if data['children_count'] > 0:
diff --git a/data/interfaces/default/info_collection_list.html b/data/interfaces/default/info_collection_list.html index e4b675b5..29ef8ad4 100644 --- a/data/interfaces/default/info_collection_list.html +++ b/data/interfaces/default/info_collection_list.html @@ -28,8 +28,8 @@ DOCUMENTATION :: END % if data != None: <% - from plexpy.common import MEDIA_TYPE_HEADERS - from plexpy.helpers import page + from jellypy.common import MEDIA_TYPE_HEADERS + from jellypy.helpers import page types = ('movie', 'show', 'artist', 'album') %> % for media_type in types: diff --git a/data/interfaces/default/info_search_results_list.html b/data/interfaces/default/info_search_results_list.html index f76ba17d..aae75535 100644 --- a/data/interfaces/default/info_search_results_list.html +++ b/data/interfaces/default/info_search_results_list.html @@ -54,7 +54,7 @@ DOCUMENTATION :: END % if data != None: <% - from plexpy.helpers import page + from jellypy.helpers import page %> % if data['results_count'] > 0: % if 'collection' in data['results_list'] and data['results_list']['collection']: diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html index 24b2bd99..182fff02 100644 --- a/data/interfaces/default/library.html +++ b/data/interfaces/default/library.html @@ -36,8 +36,8 @@ DOCUMENTATION :: END <%def name="body()"> % if data: <% - from plexpy.common import LIVE_TV_SECTION_ID - from plexpy.helpers import page + from jellypy.common import LIVE_TV_SECTION_ID + from jellypy.helpers import page %>
diff --git a/data/interfaces/default/library_recently_added.html b/data/interfaces/default/library_recently_added.html index f3a355f6..bfc15335 100644 --- a/data/interfaces/default/library_recently_added.html +++ b/data/interfaces/default/library_recently_added.html @@ -32,7 +32,7 @@ DOCUMENTATION :: END % if data: <% - from plexpy.helpers import page + from jellypy.helpers import page %>
diff --git a/data/interfaces/default/library_stats.html b/data/interfaces/default/library_stats.html index c5cfca92..76accf7a 100644 --- a/data/interfaces/default/library_stats.html +++ b/data/interfaces/default/library_stats.html @@ -25,7 +25,7 @@ DOCUMENTATION :: END % if data: <% - from plexpy.helpers import page + from jellypy.helpers import page types = ('movie', 'show', 'artist', 'photo') headers = {'movie': ('Movie Libraries', ('Movies', '', '')), diff --git a/data/interfaces/default/library_user_stats.html b/data/interfaces/default/library_user_stats.html index ebd2c41f..cbf52c66 100644 --- a/data/interfaces/default/library_user_stats.html +++ b/data/interfaces/default/library_user_stats.html @@ -19,7 +19,7 @@ DOCUMENTATION :: END % if data: -<% from plexpy.helpers import page %> +<% from jellypy.helpers import page %> % for a in data:
    diff --git a/data/interfaces/default/login.html b/data/interfaces/default/login.html index f49ad8b4..8aff9c3e 100644 --- a/data/interfaces/default/login.html +++ b/data/interfaces/default/login.html @@ -1,6 +1,6 @@ <% - import plexpy - plex_login = plexpy.CONFIG.HTTP_PLEX_ADMIN or plexpy.CONFIG.ALLOW_GUEST_ACCESS + import jellypy + plex_login = jellypy.CONFIG.HTTP_PLEX_ADMIN or jellypy.CONFIG.ALLOW_GUEST_ACCESS %> diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index f83c72f6..6de6b321 100644 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -1,6 +1,6 @@ <%inherit file="base.html"/> <%! - from plexpy import helpers + from jellypy import helpers %> <%def name="headIncludes()"> diff --git a/data/interfaces/default/newsletter_config.html b/data/interfaces/default/newsletter_config.html index 6989e43a..ff67dae0 100644 --- a/data/interfaces/default/newsletter_config.html +++ b/data/interfaces/default/newsletter_config.html @@ -1,8 +1,8 @@ % if newsletter: <%! import json - from plexpy import notifiers - from plexpy.helpers import anon_url, checked + from jellypy import notifiers + from jellypy.helpers import anon_url, checked all_notifiers = sorted(notifiers.get_notifiers(), key=lambda k: (k['agent_label'].lower(), k['friendly_name'], k['id'])) email_notifiers = [n for n in all_notifiers if n['agent_name'] == 'email'] diff --git a/data/interfaces/default/newsletters_table.html b/data/interfaces/default/newsletters_table.html index 5ceaf0a0..ee909b0c 100644 --- a/data/interfaces/default/newsletters_table.html +++ b/data/interfaces/default/newsletters_table.html @@ -9,7 +9,7 @@ Version: 0.1 DOCUMENTATION :: END -<% from plexpy import newsletter_handler %> +<% from jellypy import newsletter_handler %>
      % for newsletter in sorted(newsletters_list, key=lambda k: (k['agent_label'], k['friendly_name'], k['id'])):
diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index bb1339fe..1f85708f 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -3,12 +3,12 @@ import os import sys - import plexpy - from plexpy import common, notifiers, newsletters - from plexpy.helpers import anon_url, checked + import jellypy + from jellypy import common, notifiers, newsletters + from jellypy.helpers import anon_url, checked - docker_setting = 'disabled' if plexpy.DOCKER else '' - docker_msg = '(Controlled by Docker Container)' if plexpy.DOCKER else '' + docker_setting = 'disabled' if jellypy.DOCKER else '' + docker_msg = '(Controlled by Docker Container)' if jellypy.DOCKER else '' available_notification_agents = sorted(notifiers.available_notification_agents(), key=lambda k: k['label'].lower()) available_newsletter_agents = sorted(newsletters.available_newsletter_agents(), key=lambda k: k['label'].lower()) diff --git a/data/interfaces/default/stream_data.html b/data/interfaces/default/stream_data.html index 3165723c..91e01472 100644 --- a/data/interfaces/default/stream_data.html +++ b/data/interfaces/default/stream_data.html @@ -39,7 +39,7 @@ DOCUMENTATION :: END % if data: <% - from plexpy.common import VIDEO_RESOLUTION_OVERRIDES, AUDIO_CODEC_OVERRIDES + from jellypy.common import VIDEO_RESOLUTION_OVERRIDES, AUDIO_CODEC_OVERRIDES %>