mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-27 11:26:13 +00:00
Change most string occurrences of Emby to Jellyfin (case sensitive)
This commit is contained in:
parent
168bab2b01
commit
59c1dd42e3
79 changed files with 833 additions and 832 deletions
|
@ -14,13 +14,13 @@ class NullHandler(logging.Handler):
|
|||
print(self.format(record))
|
||||
|
||||
loghandler = NullHandler
|
||||
LOG = logging.getLogger('Emby')
|
||||
LOG = logging.getLogger('Jellyfin')
|
||||
|
||||
#################################################################################################
|
||||
|
||||
def config(level=logging.INFO):
|
||||
|
||||
logger = logging.getLogger('Emby')
|
||||
logger = logging.getLogger('Jellyfin')
|
||||
logger.addHandler(Emby.loghandler())
|
||||
logger.setLevel(level)
|
||||
|
||||
|
@ -40,15 +40,15 @@ def ensure_client():
|
|||
|
||||
class Emby(object):
|
||||
|
||||
''' This is your Embyclient, you can create more than one. The server_id is only a temporary thing
|
||||
to communicate with the EmbyClient().
|
||||
''' This is your Jellyfinclient, you can create more than one. The server_id is only a temporary thing
|
||||
to communicate with the JellyfinClient().
|
||||
|
||||
from emby import Emby
|
||||
from jellyfin import Jellyfin
|
||||
|
||||
Emby('123456')['config/app']
|
||||
Jellyfin('123456')['config/app']
|
||||
|
||||
# Permanent client reference
|
||||
client = Emby('123456').get_client()
|
||||
client = Jellyfin('123456').get_client()
|
||||
client['config/app']
|
||||
'''
|
||||
|
||||
|
@ -68,9 +68,9 @@ class Emby(object):
|
|||
@classmethod
|
||||
def set_loghandler(cls, func=loghandler, level=logging.INFO):
|
||||
|
||||
for handler in logging.getLogger('Emby').handlers:
|
||||
for handler in logging.getLogger('Jellyfin').handlers:
|
||||
if isinstance(handler, cls.loghandler):
|
||||
logging.getLogger('Emby').removeHandler(handler)
|
||||
logging.getLogger('Jellyfin').removeHandler(handler)
|
||||
|
||||
cls.loghandler = func
|
||||
config(level)
|
||||
|
@ -83,7 +83,7 @@ class Emby(object):
|
|||
self.client[self.server_id].stop()
|
||||
self.client.pop(self.server_id, None)
|
||||
|
||||
LOG.info("---[ STOPPED EMBYCLIENT: %s ]---", self.server_id)
|
||||
LOG.info("---[ STOPPED JELLYFINCLIENT: %s ]---", self.server_id)
|
||||
|
||||
@classmethod
|
||||
def close_all(cls):
|
||||
|
@ -92,7 +92,7 @@ class Emby(object):
|
|||
cls.client[client].stop()
|
||||
|
||||
cls.client = {}
|
||||
LOG.info("---[ STOPPED ALL EMBYCLIENTS ]---")
|
||||
LOG.info("---[ STOPPED ALL JELLYFINCLIENT ]---")
|
||||
|
||||
@classmethod
|
||||
def get_active_clients(cls):
|
||||
|
@ -119,8 +119,8 @@ class Emby(object):
|
|||
self.client[self.server_id] = EmbyClient()
|
||||
|
||||
if self.server_id == 'default':
|
||||
LOG.info("---[ START EMBYCLIENT ]---")
|
||||
LOG.info("---[ START JELLYFINCLIENT ]---")
|
||||
else:
|
||||
LOG.info("---[ START EMBYCLIENT: %s ]---", self.server_id)
|
||||
LOG.info("---[ START JELLYFINCLIENT: %s ]---", self.server_id)
|
||||
|
||||
config()
|
|
@ -12,7 +12,7 @@ from core.connection_manager import ConnectionManager, CONNECTION_STATE
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger('Emby.'+__name__)
|
||||
LOG = logging.getLogger('JELLYFIN.'+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -30,7 +30,7 @@ class EmbyClient(object):
|
|||
logged_in = False
|
||||
|
||||
def __init__(self):
|
||||
LOG.debug("EmbyClient initializing...")
|
||||
LOG.debug("JellyfinClient initializing...")
|
||||
|
||||
self.config = Config()
|
||||
self.http = HTTP(self)
|
||||
|
|
|
@ -50,7 +50,7 @@ class API(object):
|
|||
|
||||
#################################################################################################
|
||||
|
||||
# Bigger section of the Emby api
|
||||
# Bigger section of the Jellyfin api
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import logging
|
|||
|
||||
DEFAULT_HTTP_MAX_RETRIES = 3
|
||||
DEFAULT_HTTP_TIMEOUT = 30
|
||||
LOG = logging.getLogger('Emby.'+__name__)
|
||||
LOG = logging.getLogger('JELLYFIN.'+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ from http import HTTP
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger('Emby.'+__name__)
|
||||
LOG = logging.getLogger('JELLYFIN.'+__name__)
|
||||
CONNECTION_STATE = {
|
||||
'Unavailable': 0,
|
||||
'ServerSelection': 1,
|
||||
|
@ -516,7 +516,7 @@ class ConnectionManager(object):
|
|||
def _server_discovery(self):
|
||||
|
||||
MULTI_GROUP = ("<broadcast>", 7359)
|
||||
MESSAGE = "who is EmbyServer?"
|
||||
MESSAGE = "who is JellyfinServer?"
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
sock.settimeout(1.0) # This controls the socket.timeout exception
|
||||
|
|
|
@ -10,7 +10,7 @@ from datetime import datetime
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger('Emby.'+__name__)
|
||||
LOG = logging.getLogger('JELLYFIN.'+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#################################################################################################
|
||||
|
||||
class HTTPException(Exception):
|
||||
# Emby HTTP exception
|
||||
# Jellyfin HTTP exception
|
||||
def __init__(self, status, message):
|
||||
self.status = status
|
||||
self.message = message
|
||||
|
|
|
@ -11,7 +11,7 @@ from exceptions import HTTPException
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger('Emby.'+__name__)
|
||||
LOG = logging.getLogger('Jellyfin.'+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -69,7 +69,7 @@ class HTTP(object):
|
|||
|
||||
def request(self, data, session=None):
|
||||
|
||||
''' Give a chance to retry the connection. Emby sometimes can be slow to answer back
|
||||
''' Give a chance to retry the connection. Jellyfin sometimes can be slow to answer back
|
||||
data dictionary can contain:
|
||||
type: GET, POST, etc.
|
||||
url: (optional)
|
||||
|
|
|
@ -13,7 +13,7 @@ from ..resources import websocket
|
|||
|
||||
##################################################################################################
|
||||
|
||||
LOG = logging.getLogger('Emby.'+__name__)
|
||||
LOG = logging.getLogger('JELLYFIN.'+__name__)
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ from uuid import uuid4
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger('Emby.'+__name__)
|
||||
LOG = logging.getLogger('JELLYFIN.'+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue