diff --git a/data/interfaces/default/support.html b/data/interfaces/default/support.html
index ab874fad..53cf9c57 100644
--- a/data/interfaces/default/support.html
+++ b/data/interfaces/default/support.html
@@ -1,6 +1,6 @@
<%inherit file="base.html"/>
<%!
- from plexpy.helpers import anon_url
+ from jellypy.helpers import anon_url
%>
<%def name="headIncludes()">
%def>
diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html
index 778cd637..aabc91d4 100644
--- a/data/interfaces/default/user.html
+++ b/data/interfaces/default/user.html
@@ -26,7 +26,7 @@ DOCUMENTATION :: END
<%inherit file="base.html"/>
<%!
- from plexpy import helpers
+ from jellypy import helpers
%>
<%def name="headIncludes()">
diff --git a/data/interfaces/default/user_recently_watched.html b/data/interfaces/default/user_recently_watched.html
index 6ccce8e0..5184ed11 100644
--- a/data/interfaces/default/user_recently_watched.html
+++ b/data/interfaces/default/user_recently_watched.html
@@ -28,7 +28,7 @@ DOCUMENTATION :: END
% if data:
<%
- from plexpy.helpers import page
+ from jellypy.helpers import page
%>
diff --git a/data/interfaces/default/welcome.html b/data/interfaces/default/welcome.html
index cad77347..05ebbeff 100644
--- a/data/interfaces/default/welcome.html
+++ b/data/interfaces/default/welcome.html
@@ -1,6 +1,6 @@
<%
- import plexpy
- from plexpy import common, helpers
+ import jellypy
+ from jellypy import common, helpers
%>
diff --git a/data/interfaces/newsletters/recently_added.html b/data/interfaces/newsletters/recently_added.html
index 5f2ad6a1..773dc586 100644
--- a/data/interfaces/newsletters/recently_added.html
+++ b/data/interfaces/newsletters/recently_added.html
@@ -1,11 +1,11 @@
% if data:
<%
- import plexpy
- from plexpy.helpers import grouper, get_img_service
+ import jellypy
+ from jellypy.helpers import grouper, get_img_service
recently_added = data['recently_added']
- if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.HTTP_BASE_URL:
- base_url = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/'
+ if jellypy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.HTTP_BASE_URL:
+ base_url = jellypy.CONFIG.HTTP_BASE_URL + jellypy.HTTP_ROOT + 'newsletter/'
elif preview:
base_url = 'newsletter/'
else:
@@ -13,7 +13,7 @@
service = get_img_service(include_self=True)
if service == 'self-hosted' and plexpy.CONFIG.HTTP_BASE_URL:
- base_url_image = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'image/'
+ base_url_image = jellypy.CONFIG.HTTP_BASE_URL + jellypy.HTTP_ROOT + 'image/'
elif preview and service and service != 'self-hosted':
base_url_image = 'image/'
else:
diff --git a/data/interfaces/newsletters/recently_added.internal.html b/data/interfaces/newsletters/recently_added.internal.html
index bd0fcba7..6d4319fb 100644
--- a/data/interfaces/newsletters/recently_added.internal.html
+++ b/data/interfaces/newsletters/recently_added.internal.html
@@ -1,19 +1,19 @@
% if data:
<%
- import plexpy
- from plexpy.helpers import grouper, get_img_service
+ import jellypy
+ from jellypy.helpers import grouper, get_img_service
recently_added = data['recently_added']
- if plexpy.CONFIG.NEWSLETTER_SELF_HOSTED and plexpy.CONFIG.HTTP_BASE_URL:
- base_url = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'newsletter/'
+ if jellypy.CONFIG.NEWSLETTER_SELF_HOSTED and jellypy.CONFIG.HTTP_BASE_URL:
+ base_url = jellypy.CONFIG.HTTP_BASE_URL + jellypy.HTTP_ROOT + 'newsletter/'
elif preview:
base_url = 'newsletter/'
else:
base_url = ''
service = get_img_service(include_self=True)
- if service == 'self-hosted' and plexpy.CONFIG.HTTP_BASE_URL:
- base_url_image = plexpy.CONFIG.HTTP_BASE_URL + plexpy.HTTP_ROOT + 'image/'
+ if service == 'self-hosted' and jellypy.CONFIG.HTTP_BASE_URL:
+ base_url_image = jellypy.CONFIG.HTTP_BASE_URL + jellypy.HTTP_ROOT + 'image/'
elif preview and service and service != 'self-hosted':
base_url_image = 'image/'
else:
diff --git a/jellypy/exporter.py b/jellypy/exporter.py
index 2097eeaa..aa55efe2 100644
--- a/jellypy/exporter.py
+++ b/jellypy/exporter.py
@@ -31,7 +31,7 @@ from jellypy import datatables
from jellypy import helpers
from jellypy import logger
from jellypy import users
-from jellypy.plex import Plex
+from jellypy.jellyfin import Jellyfin
class Export(object):
@@ -1524,7 +1524,7 @@ class Export(object):
else:
plex_token = jellypy.CONFIG.PMS_TOKEN
- plex = Plex(jellypy.CONFIG.PMS_URL, plex_token)
+ jf = Jellyfin(jellypy.CONFIG.PMS_URL, plex_token)
if self.rating_key:
logger.debug(
@@ -1534,7 +1534,7 @@ class Export(object):
self.rating_key, self.metadata_level, self.media_info_level,
self.thumb_level, self.art_level, self.file_format)
- self.obj = plex.get_item(self.rating_key)
+ self.obj = jf.get_item(self.rating_key)
self.media_type = self._media_type(self.obj)
if self.media_type != 'playlist':
@@ -1553,7 +1553,7 @@ class Export(object):
self.user_id, self.metadata_level, self.media_info_level,
self.thumb_level, self.art_level, self.export_type, self.file_format)
- self.obj = plex.plex
+ self.obj = jf.plex
self.media_type = self.export_type
self.obj_title = user_info['username']
@@ -1566,7 +1566,7 @@ class Export(object):
self.section_id, self.metadata_level, self.media_info_level,
self.thumb_level, self.art_level, self.export_type, self.file_format)
- self.obj = plex.get_library(str(self.section_id))
+ self.obj = jf.get_library(str(self.section_id))
if self.export_type == 'all':
self.media_type = self.obj.type
else:
diff --git a/jellypy/plex.py b/jellypy/jellyfin.py
similarity index 80%
rename from jellypy/plex.py
rename to jellypy/jellyfin.py
index 2b520e67..0f024523 100644
--- a/jellypy/plex.py
+++ b/jellypy/jellyfin.py
@@ -15,18 +15,18 @@
# You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see .
-from plexapi.server import PlexServer
+from jellyfin_apiclient_python import JellyfinClient
-class Plex(object):
+class Jellyfin(object):
def __init__(self, url, token):
- self.plex = PlexServer(url, token)
+ self.jf = JellyfinClient()
def get_library(self, section_id):
- return self.plex.library.sectionByID(str(section_id))
+ return self.jf.library.sectionByID(str(section_id))
def get_library_items(self, section_id):
return self.get_library(str(section_id)).all()
def get_item(self, rating_key):
- return self.plex.fetchItem(rating_key)
+ return self.jf.fetchItem(rating_key)
diff --git a/jellypy/libraries.py b/jellypy/libraries.py
index 6fcf8174..4d0a76d6 100644
--- a/jellypy/libraries.py
+++ b/jellypy/libraries.py
@@ -29,7 +29,7 @@ from jellypy import plextv
from jellypy import pmsconnect
from jellypy import session
from jellypy import users
-from jellypy.plex import Plex
+from jellypy.jellyfin import Jellyfin
def refresh_libraries():
@@ -132,8 +132,8 @@ def has_library_type(section_type):
def get_collections(section_id=None):
- plex = Plex(jellypy.CONFIG.PMS_URL, session.get_session_user_token())
- library = plex.get_library(section_id)
+ jf = Jellyfin(jellypy.CONFIG.PMS_URL, session.get_session_user_token())
+ library = jf.get_library(section_id)
if library.type not in ('movie', 'show', 'artist'):
return []
@@ -230,12 +230,12 @@ def get_playlists(section_id=None, user_id=None):
if not plex_token:
return []
- plex = Plex(jellypy.CONFIG.PMS_URL, plex_token)
+ jf = Jellyfin(jellypy.CONFIG.PMS_URL, plex_token)
if user_id:
- playlists = plex.plex.playlists()
+ playlists = jf.plex.playlists()
else:
- library = plex.get_library(section_id)
+ library = jf.get_library(section_id)
playlists = library.playlist()
playlists_list = []