removed plextv / pms, added TODO's for reimplementing Jellyfin
This commit is contained in:
@@ -33,7 +33,6 @@ from jellypy.database import MonitorDatabase
|
||||
from jellypy.helpers import timestamp
|
||||
from jellypy.password import check_hash
|
||||
from jellypy.users import Users, refresh_users
|
||||
from jellypy.plextv import PlexTV
|
||||
|
||||
# Monkey patch SameSite support into cookies.
|
||||
# https://stackoverflow.com/a/50813092
|
||||
@@ -51,21 +50,22 @@ def plex_user_login(username=None, password=None, token=None, headers=None):
|
||||
user_token = None
|
||||
user_id = None
|
||||
|
||||
# Try to login to Plex.tv to check if the user has a vaild account
|
||||
if username and password:
|
||||
plex_tv = PlexTV(username=username, password=password, headers=headers)
|
||||
plex_user = plex_tv.get_token()
|
||||
if plex_user:
|
||||
user_token = plex_user['auth_token']
|
||||
user_id = plex_user['user_id']
|
||||
elif token:
|
||||
plex_tv = PlexTV(token=token, headers=headers)
|
||||
plex_user = plex_tv.get_plex_account_details()
|
||||
if plex_user:
|
||||
user_token = token
|
||||
user_id = plex_user['user_id']
|
||||
else:
|
||||
return None
|
||||
# TODO: Jellyfin
|
||||
# # Try to login to Plex.tv to check if the user has a vaild account
|
||||
# if username and password:
|
||||
# plex_tv = PlexTV(username=username, password=password, headers=headers)
|
||||
# plex_user = plex_tv.get_token()
|
||||
# if plex_user:
|
||||
# user_token = plex_user['auth_token']
|
||||
# user_id = plex_user['user_id']
|
||||
# elif token:
|
||||
# plex_tv = PlexTV(token=token, headers=headers)
|
||||
# plex_user = plex_tv.get_plex_account_details()
|
||||
# if plex_user:
|
||||
# user_token = token
|
||||
# user_id = plex_user['user_id']
|
||||
# else:
|
||||
# return None
|
||||
|
||||
if user_token and user_id:
|
||||
# Try to retrieve the user from the database.
|
||||
@@ -86,10 +86,12 @@ def plex_user_login(username=None, password=None, token=None, headers=None):
|
||||
if not jellypy.CONFIG.ALLOW_GUEST_ACCESS:
|
||||
return None
|
||||
|
||||
# The user is in the database, and guest access is enabled, so try to retrieve a server token.
|
||||
# If a server token is returned, then the user is a valid friend of the server.
|
||||
plex_tv = PlexTV(token=user_token, headers=headers)
|
||||
server_token = plex_tv.get_server_token()
|
||||
# TODO: Jellyfin
|
||||
# # The user is in the database, and guest access is enabled, so try to retrieve a server token.
|
||||
# # If a server token is returned, then the user is a valid friend of the server.
|
||||
# plex_tv = PlexTV(token=user_token, headers=headers)
|
||||
# server_token = plex_tv.get_server_token()
|
||||
server_token = None
|
||||
if server_token:
|
||||
|
||||
# Register the new user / update the access tokens.
|
||||
|
Reference in New Issue
Block a user