remodel config to match jellyfin purpose
This commit is contained in:
@@ -239,9 +239,9 @@ def initialize(config_file):
|
||||
mobile_app.blacklist_logger()
|
||||
|
||||
# Check if Tautulli has a uuid
|
||||
if CONFIG.PMS_UUID == '' or not CONFIG.PMS_UUID:
|
||||
if CONFIG.JELLYFIN_UUID == '' or not CONFIG.JELLYFIN_UUID:
|
||||
logger.debug("Generating UUID...")
|
||||
CONFIG.PMS_UUID = generate_uuid()
|
||||
CONFIG.JELLYFIN_UUID = generate_uuid()
|
||||
CONFIG.write()
|
||||
|
||||
# Check if Tautulli has an API key
|
||||
@@ -410,7 +410,7 @@ def initialize_scheduler():
|
||||
|
||||
# Update check
|
||||
github_minutes = CONFIG.CHECK_GITHUB_INTERVAL if CONFIG.CHECK_GITHUB_INTERVAL and CONFIG.CHECK_GITHUB else 0
|
||||
pms_update_check_hours = CONFIG.PMS_UPDATE_CHECK_INTERVAL if 1 <= CONFIG.PMS_UPDATE_CHECK_INTERVAL else 24
|
||||
JELLYFIN_update_check_hours = CONFIG.JELLYFIN_UPDATE_CHECK_INTERVAL if 1 <= CONFIG.JELLYFIN_UPDATE_CHECK_INTERVAL else 24
|
||||
|
||||
schedule_job(versioncheck.check_update, 'Check GitHub for updates',
|
||||
hours=0, minutes=github_minutes, seconds=0, args=(True, True))
|
||||
@@ -424,13 +424,13 @@ def initialize_scheduler():
|
||||
schedule_job(config.make_backup, 'Backup Tautulli config',
|
||||
hours=backup_hours, minutes=0, seconds=0, args=(True, True))
|
||||
|
||||
if WS_CONNECTED and CONFIG.PMS_IP and CONFIG.PMS_TOKEN:
|
||||
if WS_CONNECTED and CONFIG.JELLYFIN_IP and CONFIG.JELLYFIN_TOKEN:
|
||||
# TODO: Jellyfin
|
||||
# schedule_job(plextv.get_server_resources, 'Refresh Plex server URLs',
|
||||
# hours=12 * (not bool(CONFIG.PMS_URL_MANUAL)), minutes=0, seconds=0)
|
||||
# hours=12 * (not bool(CONFIG.JELLYFIN_URL_MANUAL)), minutes=0, seconds=0)
|
||||
|
||||
schedule_job(activity_pinger.check_server_updates, 'Check for Plex updates',
|
||||
hours=pms_update_check_hours * bool(CONFIG.MONITOR_PMS_UPDATES), minutes=0, seconds=0)
|
||||
hours=JELLYFIN_update_check_hours * bool(CONFIG.MONITOR_JELLYFIN_UPDATES), minutes=0, seconds=0)
|
||||
|
||||
# Refresh the users list and libraries list
|
||||
user_hours = CONFIG.REFRESH_USERS_INTERVAL if 1 <= CONFIG.REFRESH_USERS_INTERVAL <= 24 else 12
|
||||
@@ -531,8 +531,8 @@ def start():
|
||||
|
||||
|
||||
def startup_refresh():
|
||||
# Get the real PMS urls for SSL and remote access
|
||||
if CONFIG.PMS_TOKEN and CONFIG.PMS_IP and CONFIG.PMS_PORT:
|
||||
# Get the real JELLYFIN urls for SSL and remote access
|
||||
if CONFIG.JELLYFIN_TOKEN and CONFIG.JELLYFIN_IP and CONFIG.JELLYFIN_PORT:
|
||||
pass
|
||||
# TODO: Jellyfin
|
||||
# plextv.get_server_resources()
|
||||
@@ -542,11 +542,11 @@ def startup_refresh():
|
||||
activity_pinger.connect_server(log=True, startup=True)
|
||||
|
||||
# Refresh the users list on startup
|
||||
if CONFIG.PMS_TOKEN and CONFIG.REFRESH_USERS_ON_STARTUP:
|
||||
if CONFIG.JELLYFIN_TOKEN and CONFIG.REFRESH_USERS_ON_STARTUP:
|
||||
users.refresh_users()
|
||||
|
||||
# Refresh the libraries list on startup
|
||||
if CONFIG.PMS_IP and CONFIG.PMS_TOKEN and CONFIG.REFRESH_LIBRARIES_ON_STARTUP:
|
||||
if CONFIG.JELLYFIN_IP and CONFIG.JELLYFIN_TOKEN and CONFIG.REFRESH_LIBRARIES_ON_STARTUP:
|
||||
libraries.refresh_libraries()
|
||||
|
||||
|
||||
@@ -684,19 +684,19 @@ def dbcheck():
|
||||
'on_resume INTEGER DEFAULT 0, on_change INTEGER DEFAULT 0, on_buffer INTEGER DEFAULT 0, '
|
||||
'on_error INTEGER DEFAULT 0, on_watched INTEGER DEFAULT 0, on_created INTEGER DEFAULT 0, '
|
||||
'on_extdown INTEGER DEFAULT 0, on_intdown INTEGER DEFAULT 0, '
|
||||
'on_extup INTEGER DEFAULT 0, on_intup INTEGER DEFAULT 0, on_pmsupdate INTEGER DEFAULT 0, '
|
||||
'on_extup INTEGER DEFAULT 0, on_intup INTEGER DEFAULT 0, on_JELLYFINupdate INTEGER DEFAULT 0, '
|
||||
'on_concurrent INTEGER DEFAULT 0, on_newdevice INTEGER DEFAULT 0, on_plexpyupdate INTEGER DEFAULT 0, '
|
||||
'on_plexpydbcorrupt INTEGER DEFAULT 0, '
|
||||
'on_play_subject TEXT, on_stop_subject TEXT, on_pause_subject TEXT, '
|
||||
'on_resume_subject TEXT, on_change_subject TEXT, on_buffer_subject TEXT, on_error_subject TEXT, '
|
||||
'on_watched_subject TEXT, on_created_subject TEXT, on_extdown_subject TEXT, on_intdown_subject TEXT, '
|
||||
'on_extup_subject TEXT, on_intup_subject TEXT, on_pmsupdate_subject TEXT, '
|
||||
'on_extup_subject TEXT, on_intup_subject TEXT, on_JELLYFINupdate_subject TEXT, '
|
||||
'on_concurrent_subject TEXT, on_newdevice_subject TEXT, on_plexpyupdate_subject TEXT, '
|
||||
'on_plexpydbcorrupt_subject TEXT, '
|
||||
'on_play_body TEXT, on_stop_body TEXT, on_pause_body TEXT, '
|
||||
'on_resume_body TEXT, on_change_body TEXT, on_buffer_body TEXT, on_error_body TEXT, '
|
||||
'on_watched_body TEXT, on_created_body TEXT, on_extdown_body TEXT, on_intdown_body TEXT, '
|
||||
'on_extup_body TEXT, on_intup_body TEXT, on_pmsupdate_body TEXT, '
|
||||
'on_extup_body TEXT, on_intup_body TEXT, on_JELLYFINupdate_body TEXT, '
|
||||
'on_concurrent_body TEXT, on_newdevice_body TEXT, on_plexpyupdate_body TEXT, '
|
||||
'on_plexpydbcorrupt_body TEXT, '
|
||||
'custom_conditions TEXT, custom_conditions_logic TEXT)'
|
||||
@@ -731,7 +731,7 @@ def dbcheck():
|
||||
# recently_added table :: This table keeps record of recently added items
|
||||
c_db.execute(
|
||||
'CREATE TABLE IF NOT EXISTS recently_added (id INTEGER PRIMARY KEY AUTOINCREMENT, '
|
||||
'added_at INTEGER, pms_identifier TEXT, section_id INTEGER, '
|
||||
'added_at INTEGER, JELLYFIN_identifier TEXT, section_id INTEGER, '
|
||||
'rating_key INTEGER, parent_rating_key INTEGER, grandparent_rating_key INTEGER, media_type TEXT, '
|
||||
'media_info TEXT)'
|
||||
)
|
||||
|
@@ -31,8 +31,8 @@ PLATFORM_VERSION = platform.version()
|
||||
PLATFORM_LINUX_DISTRO = ' '.join(x for x in distro.linux_distribution() if x)
|
||||
PLATFORM_DEVICE_NAME = platform.node()
|
||||
PYTHON_VERSION = platform.python_version()
|
||||
BRANCH = version.PLEXPY_BRANCH
|
||||
RELEASE = version.PLEXPY_RELEASE_VERSION
|
||||
BRANCH = version.JELLYPY_BRANCH
|
||||
RELEASE = version.JELLYPY_VERSION
|
||||
|
||||
USER_AGENT = '{}/{} ({} {})'.format(PRODUCT, RELEASE, PLATFORM, PLATFORM_RELEASE)
|
||||
|
||||
|
@@ -41,30 +41,28 @@ FILENAME = "config.ini"
|
||||
_CONFIG_DEFINITIONS = {
|
||||
'ALLOW_GUEST_ACCESS': (int, 'General', 0),
|
||||
'DATE_FORMAT': (str, 'General', 'YYYY-MM-DD'),
|
||||
'PMS_IDENTIFIER': (str, 'PMS', ''),
|
||||
'PMS_IP': (str, 'PMS', '127.0.0.1'),
|
||||
'PMS_IS_CLOUD': (int, 'PMS', 0),
|
||||
'PMS_IS_REMOTE': (int, 'PMS', 0),
|
||||
'PMS_LOGS_FOLDER': (str, 'PMS', ''),
|
||||
'PMS_LOGS_LINE_CAP': (int, 'PMS', 1000),
|
||||
'PMS_NAME': (str, 'PMS', ''),
|
||||
'PMS_PORT': (int, 'PMS', 32400),
|
||||
'PMS_TOKEN': (str, 'PMS', ''),
|
||||
'PMS_SSL': (int, 'PMS', 0),
|
||||
'PMS_URL': (str, 'PMS', ''),
|
||||
'PMS_URL_OVERRIDE': (str, 'PMS', ''),
|
||||
'PMS_URL_MANUAL': (int, 'PMS', 0),
|
||||
'PMS_USE_BIF': (int, 'PMS', 0),
|
||||
'PMS_UUID': (str, 'PMS', ''),
|
||||
'PMS_TIMEOUT': (int, 'Advanced', 15),
|
||||
'PMS_PLEXPASS': (int, 'PMS', 0),
|
||||
'PMS_PLATFORM': (str, 'PMS', ''),
|
||||
'PMS_VERSION': (str, 'PMS', ''),
|
||||
'PMS_UPDATE_CHANNEL': (str, 'PMS', 'plex'),
|
||||
'PMS_UPDATE_DISTRO': (str, 'PMS', ''),
|
||||
'PMS_UPDATE_DISTRO_BUILD': (str, 'PMS', ''),
|
||||
'PMS_UPDATE_CHECK_INTERVAL': (int, 'Advanced', 24),
|
||||
'PMS_WEB_URL': (str, 'PMS', 'https://app.plex.tv/desktop'),
|
||||
'JELLYFIN_IDENTIFIER': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_IP': (str, 'JELLYFIN', '127.0.0.1'),
|
||||
'JELLYFIN_IS_REMOTE': (int, 'JELLYFIN', 0),
|
||||
'JELLYFIN_LOGS_FOLDER': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_LOGS_LINE_CAP': (int, 'JELLYFIN', 1000),
|
||||
'JELLYFIN_NAME': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_PORT': (int, 'JELLYFIN', 8096),
|
||||
'JELLYFIN_TOKEN': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_SSL': (int, 'JELLYFIN', 0),
|
||||
'JELLYFIN_URL': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_URL_OVERRIDE': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_URL_MANUAL': (int, 'JELLYFIN', 0),
|
||||
'JELLYFIN_USE_BIF': (int, 'JELLYFIN', 0),
|
||||
'JELLYFIN_UUID': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_TIMEOUT': (int, 'Advanced', 15),
|
||||
'JELLYFIN_PLEXPASS': (int, 'JELLYFIN', 0),
|
||||
'JELLYFIN_PLATFORM': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_VERSION': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_UPDATE_DISTRO': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_UPDATE_DISTRO_BUILD': (str, 'JELLYFIN', ''),
|
||||
'JELLYFIN_UPDATE_CHECK_INTERVAL': (int, 'Advanced', 24),
|
||||
'JELLYFIN_CLIENT_UUID': (str, 'JELLYFIN', ''),
|
||||
'TIME_FORMAT': (str, 'General', 'HH:mm'),
|
||||
'ANON_REDIRECT': (str, 'General', 'https://www.nullrefer.com/?'),
|
||||
'API_ENABLED': (int, 'General', 1),
|
||||
@@ -78,7 +76,7 @@ _CONFIG_DEFINITIONS = {
|
||||
'CACHE_DIR': (str, 'General', ''),
|
||||
'CACHE_IMAGES': (int, 'General', 1),
|
||||
'CACHE_SIZEMB': (int, 'Advanced', 32),
|
||||
'CHECK_GITHUB': (int, 'General', 1),
|
||||
'CHECK_GITHUB': (int, 'General', 0),
|
||||
'CHECK_GITHUB_INTERVAL': (int, 'General', 360),
|
||||
'CHECK_GITHUB_ON_STARTUP': (int, 'General', 1),
|
||||
'CHECK_GITHUB_CACHE_SECONDS': (int, 'Advanced', 3600),
|
||||
@@ -142,7 +140,7 @@ _CONFIG_DEFINITIONS = {
|
||||
'MOVIE_WATCHED_PERCENT': (int, 'Monitoring', 85),
|
||||
'MUSIC_WATCHED_PERCENT': (int, 'Monitoring', 85),
|
||||
'MUSICBRAINZ_LOOKUP': (int, 'General', 0),
|
||||
'MONITOR_PMS_UPDATES': (int, 'Monitoring', 0),
|
||||
'MONITOR_JELLYFIN_UPDATES': (int, 'Monitoring', 0),
|
||||
'MONITORING_INTERVAL': (int, 'Monitoring', 60),
|
||||
'NEWSLETTER_AUTH': (int, 'Newsletter', 0),
|
||||
'NEWSLETTER_PASSWORD': (str, 'Newsletter', ''),
|
||||
@@ -164,7 +162,7 @@ _CONFIG_DEFINITIONS = {
|
||||
'NOTIFY_CONCURRENT_BY_IP': (int, 'Monitoring', 0),
|
||||
'NOTIFY_CONCURRENT_THRESHOLD': (int, 'Monitoring', 2),
|
||||
'NOTIFY_NEW_DEVICE_INITIAL_ONLY': (int, 'Monitoring', 1),
|
||||
'PLEXPY_AUTO_UPDATE': (int, 'General', 0),
|
||||
'JELLYPY_AUTO_UPDATE': (int, 'General', 0),
|
||||
'REFRESH_LIBRARIES_INTERVAL': (int, 'Monitoring', 12),
|
||||
'REFRESH_LIBRARIES_ON_STARTUP': (int, 'Monitoring', 1),
|
||||
'REFRESH_USERS_INTERVAL': (int, 'Monitoring', 12),
|
||||
@@ -194,15 +192,12 @@ _BLACKLIST_KEYS = ['_APITOKEN', '_TOKEN', '_KEY', '_SECRET', '_PASSWORD', '_APIK
|
||||
_WHITELIST_KEYS = ['HTTPS_KEY']
|
||||
|
||||
_DO_NOT_IMPORT_KEYS = [
|
||||
'FIRST_RUN_COMPLETE', 'GET_FILE_SIZES_HOLD', 'GIT_PATH', 'PMS_LOGS_FOLDER',
|
||||
'FIRST_RUN_COMPLETE', 'GET_FILE_SIZES_HOLD', 'GIT_PATH', 'JELLYFIN_LOGS_FOLDER',
|
||||
'BACKUP_DIR', 'CACHE_DIR', 'EXPORT_DIR', 'LOG_DIR', 'NEWSLETTER_DIR', 'NEWSLETTER_CUSTOM_DIR',
|
||||
'HTTP_HOST', 'HTTP_PORT', 'HTTP_ROOT',
|
||||
'HTTP_USERNAME', 'HTTP_PASSWORD', 'HTTP_HASH_PASSWORD', 'HTTP_HASHED_PASSWORD',
|
||||
'ENABLE_HTTPS', 'HTTPS_CREATE_CERT', 'HTTPS_CERT', 'HTTPS_CERT_CHAIN', 'HTTPS_KEY'
|
||||
]
|
||||
_DO_NOT_IMPORT_KEYS_DOCKER = [
|
||||
'PLEXPY_AUTO_UPDATE', 'GIT_REMOTE', 'GIT_BRANCH'
|
||||
]
|
||||
|
||||
IS_IMPORTING = False
|
||||
IMPORT_THREAD = None
|
||||
@@ -250,9 +245,6 @@ def import_tautulli_config(config=None, backup=False):
|
||||
# Remove keys that should not be imported
|
||||
for key in _DO_NOT_IMPORT_KEYS:
|
||||
delattr(imported_config, key)
|
||||
if jellypy.DOCKER or jellypy.SNAP:
|
||||
for key in _DO_NOT_IMPORT_KEYS_DOCKER:
|
||||
delattr(imported_config, key)
|
||||
|
||||
# Merge the imported config file into the current config file
|
||||
jellypy.CONFIG._config.merge(imported_config._config)
|
||||
@@ -442,100 +434,3 @@ class Config(object):
|
||||
"""
|
||||
if self.CONFIG_VERSION == 0:
|
||||
self.CONFIG_VERSION = 1
|
||||
|
||||
if self.CONFIG_VERSION == 1:
|
||||
# Change home_stats_cards to list
|
||||
if self.HOME_STATS_CARDS:
|
||||
home_stats_cards = ''.join(self.HOME_STATS_CARDS).split(', ')
|
||||
if 'watch_statistics' in home_stats_cards:
|
||||
home_stats_cards.remove('watch_statistics')
|
||||
self.HOME_STATS_CARDS = home_stats_cards
|
||||
# Change home_library_cards to list
|
||||
if self.HOME_LIBRARY_CARDS:
|
||||
home_library_cards = ''.join(self.HOME_LIBRARY_CARDS).split(', ')
|
||||
if 'library_statistics' in home_library_cards:
|
||||
home_library_cards.remove('library_statistics')
|
||||
self.HOME_LIBRARY_CARDS = home_library_cards
|
||||
|
||||
self.CONFIG_VERSION = 2
|
||||
|
||||
if self.CONFIG_VERSION == 2:
|
||||
self.CONFIG_VERSION = 3
|
||||
|
||||
if self.CONFIG_VERSION == 3:
|
||||
if self.HTTP_ROOT == '/':
|
||||
self.HTTP_ROOT = ''
|
||||
|
||||
self.CONFIG_VERSION = 4
|
||||
|
||||
if self.CONFIG_VERSION == 4:
|
||||
if not len(self.HOME_STATS_CARDS) and 'watch_stats' in self.HOME_SECTIONS:
|
||||
home_sections = self.HOME_SECTIONS
|
||||
home_sections.remove('watch_stats')
|
||||
self.HOME_SECTIONS = home_sections
|
||||
if not len(self.HOME_LIBRARY_CARDS) and 'library_stats' in self.HOME_SECTIONS:
|
||||
home_sections = self.HOME_SECTIONS
|
||||
home_sections.remove('library_stats')
|
||||
self.HOME_SECTIONS = home_sections
|
||||
|
||||
self.CONFIG_VERSION = 5
|
||||
|
||||
if self.CONFIG_VERSION == 5:
|
||||
self.MONITOR_PMS_UPDATES = 0
|
||||
|
||||
self.CONFIG_VERSION = 6
|
||||
|
||||
if self.CONFIG_VERSION == 6:
|
||||
if self.GIT_USER.lower() == 'drzoidberg33':
|
||||
self.GIT_USER = 'JonnyWong16'
|
||||
|
||||
self.CONFIG_VERSION = 7
|
||||
|
||||
if self.CONFIG_VERSION == 7:
|
||||
self.CONFIG_VERSION = 8
|
||||
|
||||
if self.CONFIG_VERSION == 8:
|
||||
self.CONFIG_VERSION = 9
|
||||
|
||||
if self.CONFIG_VERSION == 9:
|
||||
if self.PMS_UPDATE_CHANNEL == 'plexpass':
|
||||
self.PMS_UPDATE_CHANNEL = 'beta'
|
||||
|
||||
self.CONFIG_VERSION = 10
|
||||
|
||||
if self.CONFIG_VERSION == 10:
|
||||
self.GIT_USER = 'Tautulli'
|
||||
self.GIT_REPO = 'Tautulli'
|
||||
|
||||
self.CONFIG_VERSION = 11
|
||||
|
||||
if self.CONFIG_VERSION == 11:
|
||||
self.ANON_REDIRECT = self.ANON_REDIRECT.replace('http://www.nullrefer.com/?',
|
||||
'https://www.nullrefer.com/?')
|
||||
self.CONFIG_VERSION = 12
|
||||
|
||||
if self.CONFIG_VERSION == 12:
|
||||
self.BUFFER_THRESHOLD = max(self.BUFFER_THRESHOLD, 10)
|
||||
|
||||
self.CONFIG_VERSION = 13
|
||||
|
||||
if self.CONFIG_VERSION == 13:
|
||||
self.CONFIG_VERSION = 14
|
||||
|
||||
if self.CONFIG_VERSION == 14:
|
||||
if jellypy.DOCKER:
|
||||
self.PLEXPY_AUTO_UPDATE = 0
|
||||
|
||||
self.CONFIG_VERSION = 15
|
||||
|
||||
if self.CONFIG_VERSION == 15:
|
||||
if self.HTTP_ROOT and self.HTTP_ROOT != '/':
|
||||
self.JWT_UPDATE_SECRET = True
|
||||
|
||||
self.CONFIG_VERSION = 16
|
||||
|
||||
if self.CONFIG_VERSION == 16:
|
||||
if jellypy.SNAP:
|
||||
self.PLEXPY_AUTO_UPDATE = 0
|
||||
|
||||
self.CONFIG_VERSION = 17
|
||||
|
@@ -14,13 +14,32 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
|
||||
import pprint
|
||||
import uuid
|
||||
|
||||
from jellyfin_apiclient_python import JellyfinClient
|
||||
|
||||
import jellypy
|
||||
from jellypy.common import PRODUCT, RELEASE
|
||||
|
||||
|
||||
class Jellyfin(object):
|
||||
def __init__(self, url, token=None):
|
||||
if not jellypy.CONFIG.JELLYFIN_CLIENT_UUID:
|
||||
jellypy.CONFIG.JELLYFIN_CLIENT_UUID = uuid.uuid4()
|
||||
jellypy.CONFIG.write()
|
||||
|
||||
self.jf = JellyfinClient()
|
||||
self.jf.config.data["app.default"] = True
|
||||
self.jf.config.app(
|
||||
PRODUCT, RELEASE, PRODUCT, jellypy.CONFIG.JELLYFIN_CLIENT_UUID
|
||||
)
|
||||
self.jf.config.data["http.user_agent"] = PRODUCT
|
||||
self.jf.config.data["auth.ssl"] = not jellypy.CONFIG.JELLYFIN_SSL
|
||||
self.url = url
|
||||
|
||||
if token:
|
||||
self.login(token=token)
|
||||
|
||||
def get_library(self, section_id):
|
||||
return self.jf.library.sectionByID(str(section_id))
|
||||
@@ -31,5 +50,22 @@ class Jellyfin(object):
|
||||
def get_item(self, rating_key):
|
||||
return self.jf.fetchItem(rating_key)
|
||||
|
||||
def login(self, user, password):
|
||||
pass
|
||||
def login(self, user=None, password=None, token=None) -> bool:
|
||||
if user and password:
|
||||
self.jf.auth.connect_to_address(self.url)
|
||||
result = self.jf.auth.login(self.url, user, password)
|
||||
|
||||
if "AccessToken" in result:
|
||||
credentials = self.jf.auth.credentials.get_credentials()
|
||||
pprint.pprint(credentials)
|
||||
server = credentials["Servers"][0]
|
||||
server["uuid"] = server["Id"]
|
||||
server["username"] = user
|
||||
|
||||
# jellypy.CONFIG.JELLYFIN_TOKEN =
|
||||
#
|
||||
# self._connect_client(server)
|
||||
# self.credentials.append(server)
|
||||
# self.save_credentials()
|
||||
return True
|
||||
return False
|
||||
|
@@ -15,5 +15,5 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
PLEXPY_BRANCH = "master"
|
||||
PLEXPY_RELEASE_VERSION = "v2.6.5"
|
||||
JELLYPY_BRANCH = "master"
|
||||
JELLYPY_VERSION = "1.0.0-alpha"
|
||||
|
@@ -75,7 +75,7 @@ def serve_template(templatename, **kwargs):
|
||||
error_handler=mako_error_handler)
|
||||
|
||||
http_root = jellypy.HTTP_ROOT
|
||||
server_name = jellypy.CONFIG.PMS_NAME
|
||||
server_name = jellypy.CONFIG.JELLYFIN_NAME
|
||||
cache_param = '?' + (jellypy.CURRENT_VERSION or common.RELEASE)
|
||||
|
||||
_session = get_session_info()
|
||||
@@ -153,15 +153,14 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
def welcome(self, **kwargs):
|
||||
config = {
|
||||
"pms_identifier": jellypy.CONFIG.PMS_IDENTIFIER,
|
||||
"pms_ip": jellypy.CONFIG.PMS_IP,
|
||||
"pms_port": jellypy.CONFIG.PMS_PORT,
|
||||
"pms_is_remote": jellypy.CONFIG.PMS_IS_REMOTE,
|
||||
"pms_ssl": jellypy.CONFIG.PMS_SSL,
|
||||
"pms_is_cloud": jellypy.CONFIG.PMS_IS_CLOUD,
|
||||
"pms_token": jellypy.CONFIG.PMS_TOKEN,
|
||||
"pms_uuid": jellypy.CONFIG.PMS_UUID,
|
||||
"pms_name": jellypy.CONFIG.PMS_NAME,
|
||||
"jellyfin_identifier": jellypy.CONFIG.JELLYFIN_IDENTIFIER,
|
||||
"jellyfin_ip": jellypy.CONFIG.JELLYFIN_IP,
|
||||
"jellyfin_port": jellypy.CONFIG.JELLYFIN_PORT,
|
||||
"jellyfin_is_remote": jellypy.CONFIG.JELLYFIN_IS_REMOTE,
|
||||
"jellyfin_ssl": jellypy.CONFIG.JELLYFIN_SSL,
|
||||
"jellyfin_token": jellypy.CONFIG.JELLYFIN_TOKEN,
|
||||
"jellyfin_uuid": jellypy.CONFIG.JELLYFIN_UUID,
|
||||
"jellyfin_name": jellypy.CONFIG.JELLYFIN_NAME,
|
||||
"logging_ignore_interval": jellypy.CONFIG.LOGGING_IGNORE_INTERVAL
|
||||
}
|
||||
|
||||
@@ -203,7 +202,7 @@ class WebInterface(object):
|
||||
"""
|
||||
if token:
|
||||
# Need to set token so result doesn't return http 401
|
||||
jellypy.CONFIG.__setattr__('PMS_TOKEN', token)
|
||||
jellypy.CONFIG.__setattr__('JELLYFIN_TOKEN', token)
|
||||
jellypy.CONFIG.write()
|
||||
|
||||
include_cloud = not (include_cloud == 'false')
|
||||
@@ -226,8 +225,8 @@ class WebInterface(object):
|
||||
config = {
|
||||
"home_sections": jellypy.CONFIG.HOME_SECTIONS,
|
||||
"home_refresh_interval": jellypy.CONFIG.HOME_REFRESH_INTERVAL,
|
||||
"pms_name": jellypy.CONFIG.PMS_NAME,
|
||||
"pms_is_cloud": jellypy.CONFIG.PMS_IS_CLOUD,
|
||||
"jellyfin_name": jellypy.CONFIG.JELLYFIN_NAME,
|
||||
"jellyfin_is_cloud": jellypy.CONFIG.JELLYFIN_IS_CLOUD,
|
||||
"update_show_changelog": jellypy.CONFIG.UPDATE_SHOW_CHANGELOG,
|
||||
"first_run_complete": jellypy.CONFIG.FIRST_RUN_COMPLETE
|
||||
}
|
||||
@@ -273,7 +272,7 @@ class WebInterface(object):
|
||||
def get_current_activity(self, **kwargs):
|
||||
pass
|
||||
# TODO: Jellyfin
|
||||
# pms_connect = pmsconnect.PmsConnect(token=jellypy.CONFIG.PMS_TOKEN)
|
||||
# pms_connect = pmsconnect.PmsConnect(token=jellypy.CONFIG.JELLYFIN_TOKEN)
|
||||
# result = pms_connect.get_current_activity()
|
||||
#
|
||||
# if result:
|
||||
@@ -287,7 +286,7 @@ class WebInterface(object):
|
||||
def get_current_activity_instance(self, session_key=None, **kwargs):
|
||||
pass
|
||||
# TODO: Jellyfin
|
||||
# pms_connect = pmsconnect.PmsConnect(token=jellypy.CONFIG.PMS_TOKEN)
|
||||
# pms_connect = pmsconnect.PmsConnect(token=jellypy.CONFIG.JELLYFIN_TOKEN)
|
||||
# result = pms_connect.get_current_activity()
|
||||
#
|
||||
# if result:
|
||||
@@ -330,18 +329,18 @@ class WebInterface(object):
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
def return_plex_xml_url(self, endpoint='', plextv=False, **kwargs):
|
||||
kwargs['X-Plex-Token'] = jellypy.CONFIG.PMS_TOKEN
|
||||
kwargs['X-Plex-Token'] = jellypy.CONFIG.JELLYFIN_TOKEN
|
||||
|
||||
if helpers.bool_true(plextv):
|
||||
base_url = 'https://plex.tv'
|
||||
else:
|
||||
if jellypy.CONFIG.PMS_URL_OVERRIDE:
|
||||
base_url = jellypy.CONFIG.PMS_URL_OVERRIDE
|
||||
if jellypy.CONFIG.JELLYFIN_URL_OVERRIDE:
|
||||
base_url = jellypy.CONFIG.JELLYFIN_URL_OVERRIDE
|
||||
else:
|
||||
base_url = jellypy.CONFIG.PMS_URL
|
||||
base_url = jellypy.CONFIG.JELLYFIN_URL
|
||||
|
||||
if '{machine_id}' in endpoint:
|
||||
endpoint = endpoint.format(machine_id=jellypy.CONFIG.PMS_IDENTIFIER)
|
||||
endpoint = endpoint.format(machine_id=jellypy.CONFIG.JELLYFIN_IDENTIFIER)
|
||||
|
||||
return base_url + endpoint + '?' + urlencode(kwargs)
|
||||
|
||||
@@ -512,7 +511,7 @@ class WebInterface(object):
|
||||
@sanitize_out()
|
||||
@addtoapi("get_library_names")
|
||||
def get_library_sections(self, **kwargs):
|
||||
""" Get a list of library sections and ids on the PMS.
|
||||
""" Get a list of library sections and ids on the JELLYFIN.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -588,7 +587,7 @@ class WebInterface(object):
|
||||
status_message = 'An error occured.'
|
||||
|
||||
return serve_template(templatename="edit_library.html", title="Edit Library",
|
||||
data=result, server_id=jellypy.CONFIG.PMS_IDENTIFIER, status_message=status_message)
|
||||
data=result, server_id=jellypy.CONFIG.JELLYFIN_IDENTIFIER, status_message=status_message)
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
@@ -2594,7 +2593,7 @@ class WebInterface(object):
|
||||
user_id = get_session_user_id()
|
||||
|
||||
# TODO: Jellyfin
|
||||
# plex_tv = plextv.PlexTV(token=jellypy.CONFIG.PMS_TOKEN)
|
||||
# plex_tv = plextv.PlexTV(token=jellypy.CONFIG.JELLYFIN_TOKEN)
|
||||
# result = plex_tv.get_synced_items(machine_id=machine_id, user_id_filter=user_id)
|
||||
result = None
|
||||
|
||||
@@ -2711,7 +2710,7 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_plex_log(self, **kwargs):
|
||||
""" Get the PMS logs.
|
||||
""" Get the JELLYFIN logs.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -2732,7 +2731,7 @@ class WebInterface(object):
|
||||
]
|
||||
```
|
||||
"""
|
||||
window = int(kwargs.get('window', jellypy.CONFIG.PMS_LOGS_LINE_CAP))
|
||||
window = int(kwargs.get('window', jellypy.CONFIG.JELLYFIN_LOGS_LINE_CAP))
|
||||
log_lines = []
|
||||
log_type = kwargs.get('log_type', 'server')
|
||||
|
||||
@@ -3060,25 +3059,25 @@ class WebInterface(object):
|
||||
"check_github": checked(jellypy.CONFIG.CHECK_GITHUB),
|
||||
"interface_list": interface_list,
|
||||
"cache_sizemb": jellypy.CONFIG.CACHE_SIZEMB,
|
||||
"pms_identifier": jellypy.CONFIG.PMS_IDENTIFIER,
|
||||
"pms_ip": jellypy.CONFIG.PMS_IP,
|
||||
"pms_logs_folder": jellypy.CONFIG.PMS_LOGS_FOLDER,
|
||||
"pms_port": jellypy.CONFIG.PMS_PORT,
|
||||
"pms_token": jellypy.CONFIG.PMS_TOKEN,
|
||||
"pms_ssl": jellypy.CONFIG.PMS_SSL,
|
||||
"pms_is_remote": jellypy.CONFIG.PMS_IS_REMOTE,
|
||||
"pms_is_cloud": jellypy.CONFIG.PMS_IS_CLOUD,
|
||||
"pms_url": jellypy.CONFIG.PMS_URL,
|
||||
"pms_url_manual": checked(jellypy.CONFIG.PMS_URL_MANUAL),
|
||||
"pms_uuid": jellypy.CONFIG.PMS_UUID,
|
||||
"pms_web_url": jellypy.CONFIG.PMS_WEB_URL,
|
||||
"pms_name": jellypy.CONFIG.PMS_NAME,
|
||||
"pms_update_check_interval": jellypy.CONFIG.PMS_UPDATE_CHECK_INTERVAL,
|
||||
"jellyfin_identifier": jellypy.CONFIG.JELLYFIN_IDENTIFIER,
|
||||
"jellyfin_ip": jellypy.CONFIG.JELLYFIN_IP,
|
||||
"jellyfin_logs_folder": jellypy.CONFIG.JELLYFIN_LOGS_FOLDER,
|
||||
"jellyfin_port": jellypy.CONFIG.JELLYFIN_PORT,
|
||||
"jellyfin_token": jellypy.CONFIG.JELLYFIN_TOKEN,
|
||||
"jellyfin_ssl": jellypy.CONFIG.JELLYFIN_SSL,
|
||||
"jellyfin_is_remote": jellypy.CONFIG.JELLYFIN_IS_REMOTE,
|
||||
"jellyfin_is_cloud": jellypy.CONFIG.JELLYFIN_IS_CLOUD,
|
||||
"jellyfin_url": jellypy.CONFIG.JELLYFIN_URL,
|
||||
"jellyfin_url_manual": checked(jellypy.CONFIG.JELLYFIN_URL_MANUAL),
|
||||
"jellyfin_uuid": jellypy.CONFIG.JELLYFIN_UUID,
|
||||
"jellyfin_web_url": jellypy.CONFIG.JELLYFIN_WEB_URL,
|
||||
"jellyfin_name": jellypy.CONFIG.JELLYFIN_NAME,
|
||||
"jellyfin_update_check_interval": jellypy.CONFIG.JELLYFIN_UPDATE_CHECK_INTERVAL,
|
||||
"date_format": jellypy.CONFIG.DATE_FORMAT,
|
||||
"time_format": jellypy.CONFIG.TIME_FORMAT,
|
||||
"week_start_monday": checked(jellypy.CONFIG.WEEK_START_MONDAY),
|
||||
"get_file_sizes": checked(jellypy.CONFIG.GET_FILE_SIZES),
|
||||
"monitor_pms_updates": checked(jellypy.CONFIG.MONITOR_PMS_UPDATES),
|
||||
"monitor_jellyfin_updates": checked(jellypy.CONFIG.MONITOR_JELLYFIN_UPDATES),
|
||||
"refresh_libraries_interval": jellypy.CONFIG.REFRESH_LIBRARIES_INTERVAL,
|
||||
"refresh_libraries_on_startup": checked(jellypy.CONFIG.REFRESH_LIBRARIES_ON_STARTUP),
|
||||
"refresh_users_interval": jellypy.CONFIG.REFRESH_USERS_INTERVAL,
|
||||
@@ -3108,7 +3107,7 @@ class WebInterface(object):
|
||||
"cloudinary_api_key": jellypy.CONFIG.CLOUDINARY_API_KEY,
|
||||
"cloudinary_api_secret": jellypy.CONFIG.CLOUDINARY_API_SECRET,
|
||||
"cache_images": checked(jellypy.CONFIG.CACHE_IMAGES),
|
||||
"pms_version": jellypy.CONFIG.PMS_VERSION,
|
||||
"jellyfin_version": jellypy.CONFIG.JELLYFIN_VERSION,
|
||||
"plexpy_auto_update": checked(jellypy.CONFIG.PLEXPY_AUTO_UPDATE),
|
||||
"git_branch": jellypy.CONFIG.GIT_BRANCH,
|
||||
"git_path": jellypy.CONFIG.GIT_PATH,
|
||||
@@ -3154,12 +3153,12 @@ class WebInterface(object):
|
||||
"launch_browser", "launch_startup", "enable_https", "https_create_cert",
|
||||
"api_enabled", "freeze_db", "check_github",
|
||||
"group_history_tables",
|
||||
"pms_url_manual", "week_start_monday",
|
||||
"jellyfin_url_manual", "week_start_monday",
|
||||
"refresh_libraries_on_startup", "refresh_users_on_startup",
|
||||
"notify_consecutive", "notify_recently_added_upgrade",
|
||||
"notify_group_recently_added_grandparent", "notify_group_recently_added_parent",
|
||||
"notify_new_device_initial_only",
|
||||
"monitor_pms_updates", "get_file_sizes", "log_blacklist", "http_hash_password",
|
||||
"monitor_jellyfin_updates", "get_file_sizes", "log_blacklist", "http_hash_password",
|
||||
"allow_guest_access", "cache_images", "http_proxy", "http_basic_auth", "notify_concurrent_by_ip",
|
||||
"history_table_activity", "plexpy_auto_update",
|
||||
"themoviedb_lookup", "tvmaze_lookup", "musicbrainz_lookup", "http_plex_admin",
|
||||
@@ -3210,15 +3209,15 @@ class WebInterface(object):
|
||||
if kwargs.get('check_github') != jellypy.CONFIG.CHECK_GITHUB or \
|
||||
kwargs.get('refresh_libraries_interval') != str(jellypy.CONFIG.REFRESH_LIBRARIES_INTERVAL) or \
|
||||
kwargs.get('refresh_users_interval') != str(jellypy.CONFIG.REFRESH_USERS_INTERVAL) or \
|
||||
kwargs.get('pms_update_check_interval') != str(jellypy.CONFIG.PMS_UPDATE_CHECK_INTERVAL) or \
|
||||
kwargs.get('monitor_pms_updates') != jellypy.CONFIG.MONITOR_PMS_UPDATES or \
|
||||
kwargs.get('pms_url_manual') != jellypy.CONFIG.PMS_URL_MANUAL:
|
||||
kwargs.get('jellyfin_update_check_interval') != str(jellypy.CONFIG.JELLYFIN_UPDATE_CHECK_INTERVAL) or \
|
||||
kwargs.get('monitor_jellyfin_updates') != jellypy.CONFIG.MONITOR_JELLYFIN_UPDATES or \
|
||||
kwargs.get('jellyfin_url_manual') != jellypy.CONFIG.JELLYFIN_URL_MANUAL:
|
||||
reschedule = True
|
||||
|
||||
# If we change the SSL setting for PMS or PMS remote setting, make sure we grab the new url.
|
||||
if kwargs.get('pms_ssl') != str(jellypy.CONFIG.PMS_SSL) or \
|
||||
kwargs.get('pms_is_remote') != str(jellypy.CONFIG.PMS_IS_REMOTE) or \
|
||||
kwargs.get('pms_url_manual') != jellypy.CONFIG.PMS_URL_MANUAL:
|
||||
# If we change the SSL setting for JELLYFIN or JELLYFIN remote setting, make sure we grab the new url.
|
||||
if kwargs.get('jellyfin_ssl') != str(jellypy.CONFIG.JELLYFIN_SSL) or \
|
||||
kwargs.get('jellyfin_is_remote') != str(jellypy.CONFIG.JELLYFIN_IS_REMOTE) or \
|
||||
kwargs.get('jellyfin_url_manual') != jellypy.CONFIG.JELLYFIN_URL_MANUAL:
|
||||
server_changed = True
|
||||
|
||||
# If we change the HTTPS setting, make sure we generate a new certificate.
|
||||
@@ -3357,11 +3356,11 @@ class WebInterface(object):
|
||||
# update_channel = pmsconnect.PmsConnect().get_server_update_channel()
|
||||
#
|
||||
# return {'plexpass': plexpass,
|
||||
# 'pms_platform': common.PMS_PLATFORM_NAME_OVERRIDES.get(
|
||||
# jellypy.CONFIG.PMS_PLATFORM, jellypy.CONFIG.PMS_PLATFORM),
|
||||
# 'pms_update_channel': jellypy.CONFIG.PMS_UPDATE_CHANNEL,
|
||||
# 'pms_update_distro': jellypy.CONFIG.PMS_UPDATE_DISTRO,
|
||||
# 'pms_update_distro_build': jellypy.CONFIG.PMS_UPDATE_DISTRO_BUILD,
|
||||
# 'pms_platform': common.JELLYFIN_PLATFORM_NAME_OVERRIDES.get(
|
||||
# jellypy.CONFIG.JELLYFIN_PLATFORM, jellypy.CONFIG.JELLYFIN_PLATFORM),
|
||||
# 'pms_update_channel': jellypy.CONFIG.JELLYFIN_UPDATE_CHANNEL,
|
||||
# 'pms_update_distro': jellypy.CONFIG.JELLYFIN_UPDATE_DISTRO,
|
||||
# 'pms_update_distro_build': jellypy.CONFIG.JELLYFIN_UPDATE_DISTRO_BUILD,
|
||||
# 'plex_update_channel': 'plexpass' if update_channel == 'beta' else 'public'}
|
||||
|
||||
@cherrypy.expose
|
||||
@@ -3983,7 +3982,7 @@ class WebInterface(object):
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_pms_token(self, username=None, password=None, **kwargs):
|
||||
def get_jellyfin_token(self, username=None, password=None, **kwargs):
|
||||
""" Get the user's Plex token used for Tautulli.
|
||||
|
||||
```
|
||||
@@ -4015,7 +4014,7 @@ class WebInterface(object):
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
def get_plexpy_pms_token(self, username=None, password=None, force=False, **kwargs):
|
||||
def get_plexpy_jellyfin_token(self, username=None, password=None, force=False, **kwargs):
|
||||
""" Fetch a new Plex.tv token for Tautulli """
|
||||
if not username and not password:
|
||||
return None
|
||||
@@ -4038,7 +4037,7 @@ class WebInterface(object):
|
||||
@addtoapi()
|
||||
def get_server_id(self, hostname=None, port=None, identifier=None, ssl=0, remote=0, manual=0,
|
||||
get_url=False, test_websocket=False, **kwargs):
|
||||
""" Get the PMS server identifier.
|
||||
""" Get the JELLYFIN server identifier.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -4055,7 +4054,7 @@ class WebInterface(object):
|
||||
```
|
||||
"""
|
||||
# Attempt to get the pms_identifier from plex.tv if the server is published
|
||||
# Works for all PMS SSL settings
|
||||
# Works for all JELLYFIN SSL settings
|
||||
if not identifier and hostname and port:
|
||||
pass
|
||||
# TODO: Jellyfin
|
||||
@@ -4069,7 +4068,7 @@ class WebInterface(object):
|
||||
# break
|
||||
#
|
||||
# # Fallback to checking /identity endpoint if the server is unpublished
|
||||
# # Cannot set SSL settings on the PMS if unpublished so 'http' is okay
|
||||
# # Cannot set SSL settings on the JELLYFIN if unpublished so 'http' is okay
|
||||
# if not identifier:
|
||||
# scheme = 'https' if helpers.cast_to_int(ssl) else 'http'
|
||||
# url = '{scheme}://{hostname}:{port}'.format(scheme=scheme, hostname=hostname, port=port)
|
||||
@@ -4088,19 +4087,19 @@ class WebInterface(object):
|
||||
|
||||
if identifier:
|
||||
if helpers.bool_true(get_url):
|
||||
server = self.get_server_resources(pms_ip=hostname,
|
||||
pms_port=port,
|
||||
pms_ssl=ssl,
|
||||
pms_is_remote=remote,
|
||||
pms_url_manual=manual,
|
||||
pms_identifier=identifier)
|
||||
result['url'] = server['pms_url']
|
||||
server = self.get_server_resources(jellyfin_ip=hostname,
|
||||
jellyfin_port=port,
|
||||
jellyfin_ssl=ssl,
|
||||
jellyfin_is_remote=remote,
|
||||
jellyfin_url_manual=manual,
|
||||
jellyfin_identifier=identifier)
|
||||
result['url'] = server['jellyfin_url']
|
||||
result['ws'] = None
|
||||
|
||||
if helpers.bool_true(test_websocket):
|
||||
# Quick test websocket connection
|
||||
ws_url = result['url'].replace('http', 'ws', 1) + '/:/websockets/notifications'
|
||||
header = ['X-Plex-Token: %s' % jellypy.CONFIG.PMS_TOKEN]
|
||||
header = ['X-Plex-Token: %s' % jellypy.CONFIG.JELLYFIN_TOKEN]
|
||||
|
||||
logger.debug("Testing websocket connection...")
|
||||
try:
|
||||
@@ -4114,7 +4113,7 @@ class WebInterface(object):
|
||||
|
||||
return result
|
||||
else:
|
||||
logger.warn('Unable to retrieve the PMS identifier.')
|
||||
logger.warn('Unable to retrieve the JELLYFIN identifier.')
|
||||
return result
|
||||
|
||||
@cherrypy.expose
|
||||
@@ -4122,7 +4121,7 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_server_info(self, **kwargs):
|
||||
""" Get the PMS server information.
|
||||
""" Get the JELLYFIN server information.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -4156,7 +4155,7 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_server_pref(self, pref=None, **kwargs):
|
||||
""" Get a specified PMS server preference.
|
||||
""" Get a specified JELLYFIN server preference.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -4357,8 +4356,8 @@ class WebInterface(object):
|
||||
metadata = None
|
||||
|
||||
config = {
|
||||
"pms_identifier": jellypy.CONFIG.PMS_IDENTIFIER,
|
||||
"pms_web_url": jellypy.CONFIG.PMS_WEB_URL
|
||||
"jellyfin_identifier": jellypy.CONFIG.JELLYFIN_IDENTIFIER,
|
||||
"jellyfin_web_url": jellypy.CONFIG.JELLYFIN_WEB_URL
|
||||
}
|
||||
|
||||
if user_id:
|
||||
@@ -4468,7 +4467,7 @@ class WebInterface(object):
|
||||
# return {'result': 'error', 'message': 'Notification failed.'}
|
||||
|
||||
@cherrypy.expose
|
||||
def pms_image_proxy(self, **kwargs):
|
||||
def jellyfin_image_proxy(self, **kwargs):
|
||||
""" See real_pms_image_proxy docs string"""
|
||||
|
||||
refresh = False
|
||||
@@ -4477,13 +4476,13 @@ class WebInterface(object):
|
||||
|
||||
kwargs['refresh'] = refresh
|
||||
|
||||
return self.real_pms_image_proxy(**kwargs)
|
||||
return self.real_jellyfin_image_proxy(**kwargs)
|
||||
|
||||
@addtoapi('pms_image_proxy')
|
||||
def real_pms_image_proxy(self, img=None, rating_key=None, width=750, height=1000,
|
||||
@addtoapi('jellyfin_image_proxy')
|
||||
def real_jellyfin_image_proxy(self, img=None, rating_key=None, width=750, height=1000,
|
||||
opacity=100, background='000000', blur=0, img_format='png',
|
||||
fallback=None, refresh=False, clip=False, **kwargs):
|
||||
""" Gets an image from the PMS and saves it to the image cache directory.
|
||||
""" Gets an image from the JELLYFIN and saves it to the image cache directory.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -4581,7 +4580,7 @@ class WebInterface(object):
|
||||
|
||||
return result[0]
|
||||
else:
|
||||
raise Exception('PMS image request failed')
|
||||
raise Exception('JELLYFIN image request failed')
|
||||
|
||||
except Exception as e:
|
||||
logger.warn("Failed to get image %s, falling back to %s." % (img, fallback))
|
||||
@@ -4613,7 +4612,7 @@ class WebInterface(object):
|
||||
|
||||
if img_info:
|
||||
kwargs.update(img_info)
|
||||
return self.real_pms_image_proxy(refresh=True, **kwargs)
|
||||
return self.real_jellyfin_image_proxy(refresh=True, **kwargs)
|
||||
|
||||
return
|
||||
|
||||
@@ -4678,13 +4677,13 @@ class WebInterface(object):
|
||||
log_type = kwargs.get('log_type', 'server')
|
||||
|
||||
log_file = ""
|
||||
if jellypy.CONFIG.PMS_LOGS_FOLDER:
|
||||
if jellypy.CONFIG.JELLYFIN_LOGS_FOLDER:
|
||||
if log_type == "server":
|
||||
log_file = 'Plex Media Server.log'
|
||||
log_file_path = os.path.join(jellypy.CONFIG.PMS_LOGS_FOLDER, log_file)
|
||||
log_file_path = os.path.join(jellypy.CONFIG.JELLYFIN_LOGS_FOLDER, log_file)
|
||||
elif log_type == "scanner":
|
||||
log_file = 'Plex Media Scanner.log'
|
||||
log_file_path = os.path.join(jellypy.CONFIG.PMS_LOGS_FOLDER, log_file)
|
||||
log_file_path = os.path.join(jellypy.CONFIG.JELLYFIN_LOGS_FOLDER, log_file)
|
||||
else:
|
||||
return "Plex log folder not set in the settings."
|
||||
|
||||
@@ -4807,7 +4806,7 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi('search')
|
||||
def search_results(self, query='', limit='', **kwargs):
|
||||
""" Get search results from the PMS.
|
||||
""" Get search results from the JELLYFIN.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -4928,7 +4927,7 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_new_rating_keys(self, rating_key='', media_type='', **kwargs):
|
||||
""" Get a list of new rating keys for the PMS of all of the item's parent/children.
|
||||
""" Get a list of new rating keys for the JELLYFIN of all of the item's parent/children.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -4986,7 +4985,7 @@ class WebInterface(object):
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
def get_pms_sessions_json(self, **kwargs):
|
||||
def get_jellyfin_sessions_json(self, **kwargs):
|
||||
""" Get all the current sessions. """
|
||||
# TODO: Jellyfin
|
||||
# pms_connect = pmsconnect.PmsConnect()
|
||||
@@ -5311,7 +5310,7 @@ class WebInterface(object):
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
def get_sync_lists(self, machine_id='', **kwargs):
|
||||
""" Get all items that are currently synced from the PMS. """
|
||||
""" Get all items that are currently synced from the JELLYFIN. """
|
||||
# TODO: Jellyfin
|
||||
# plex_tv = plextv.PlexTV()
|
||||
# result = plex_tv.get_plextv_sync_lists(machine_id=machine_id, output_format='json')
|
||||
@@ -5340,7 +5339,7 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_servers_info(self, **kwargs):
|
||||
""" Get info about the PMS.
|
||||
""" Get info about the JELLYFIN.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -5407,7 +5406,7 @@ class WebInterface(object):
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_server_friendly_name(self, **kwargs):
|
||||
""" Get the name of the PMS.
|
||||
""" Get the name of the JELLYFIN.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -5434,7 +5433,7 @@ class WebInterface(object):
|
||||
@requireAuth()
|
||||
@addtoapi()
|
||||
def get_activity(self, session_key=None, session_id=None, **kwargs):
|
||||
""" Get the current activity on the PMS.
|
||||
""" Get the current activity on the JELLYFIN.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
@@ -5694,7 +5693,7 @@ class WebInterface(object):
|
||||
"""
|
||||
# TODO: Jellyfin
|
||||
# try:
|
||||
# pms_connect = pmsconnect.PmsConnect(token=jellypy.CONFIG.PMS_TOKEN)
|
||||
# pms_connect = pmsconnect.PmsConnect(token=jellypy.CONFIG.JELLYFIN_TOKEN)
|
||||
# result = pms_connect.get_current_activity()
|
||||
#
|
||||
# if result:
|
||||
@@ -5831,11 +5830,11 @@ class WebInterface(object):
|
||||
@sanitize_out()
|
||||
@addtoapi()
|
||||
def get_synced_items(self, machine_id='', user_id='', **kwargs):
|
||||
""" Get a list of synced items on the PMS.
|
||||
""" Get a list of synced items on the JELLYFIN.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
machine_id (str): The PMS identifier
|
||||
machine_id (str): The JELLYFIN identifier
|
||||
|
||||
Optional parameters:
|
||||
user_id (str): The id of the Plex user
|
||||
@@ -6062,7 +6061,7 @@ class WebInterface(object):
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_pms_update(self, **kwargs):
|
||||
def get_jellyfin_update(self, **kwargs):
|
||||
""" Check for updates to the Plex Media Server.
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user