mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-25 09:16: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
|
@ -10,7 +10,7 @@ from . import settings
|
|||
|
||||
##################################################################################################
|
||||
|
||||
LOG = logging.getLogger("EMBY."+__name__)
|
||||
LOG = logging.getLogger("JELLYFIN."+__name__)
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
@ -28,7 +28,7 @@ class API(object):
|
|||
|
||||
def get_playcount(self, played, playcount):
|
||||
|
||||
''' Convert Emby played/playcount into
|
||||
''' Convert Jellyfin played/playcount into
|
||||
the Kodi equivalent. The playcount is tied to the watch status.
|
||||
'''
|
||||
return (playcount or 1) if played else None
|
||||
|
@ -231,7 +231,7 @@ class API(object):
|
|||
|
||||
def get_user_artwork(self, user_id):
|
||||
|
||||
''' Get emby user profile picture.
|
||||
''' Get jellyfin user profile picture.
|
||||
'''
|
||||
return "%s/emby/Users/%s/Images/Primary?Format=original" % (self.server, user_id)
|
||||
|
||||
|
@ -302,7 +302,7 @@ class API(object):
|
|||
|
||||
def get_backdrops(self, item_id, tags, query=None):
|
||||
|
||||
''' Get backdrops based of "BackdropImageTags" in the emby object.
|
||||
''' Get backdrops based of "BackdropImageTags" in the jellyfin object.
|
||||
'''
|
||||
backdrops = []
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#################################################################################################
|
||||
|
||||
class LibraryException(Exception):
|
||||
# Emby library sync exception
|
||||
# Jellyfin library sync exception
|
||||
def __init__(self, status):
|
||||
self.status = status
|
||||
|
||||
|
|
|
@ -14,14 +14,14 @@ from . import window, settings
|
|||
|
||||
def config():
|
||||
|
||||
logger = logging.getLogger('EMBY')
|
||||
logger = logging.getLogger('JELLYFIN')
|
||||
logger.addHandler(LogHandler())
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
def reset():
|
||||
|
||||
for handler in logging.getLogger('EMBY').handlers:
|
||||
logging.getLogger('EMBY').removeHandler(handler)
|
||||
for handler in logging.getLogger('JELLYFIN').handlers:
|
||||
logging.getLogger('JELLYFIN').removeHandler(handler)
|
||||
|
||||
|
||||
class LogHandler(logging.StreamHandler):
|
||||
|
@ -56,10 +56,10 @@ class LogHandler(logging.StreamHandler):
|
|||
|
||||
if self.mask_info:
|
||||
for server in self.sensitive['Server']:
|
||||
string = string.replace(server.encode('utf-8') or "{server}", "{emby-server}")
|
||||
string = string.replace(server.encode('utf-8') or "{server}", "{jellyfin-server}")
|
||||
|
||||
for token in self.sensitive['Token']:
|
||||
string = string.replace(token.encode('utf-8') or "{token}", "{emby-token}")
|
||||
string = string.replace(token.encode('utf-8') or "{token}", "{jellyfin-token}")
|
||||
|
||||
try:
|
||||
xbmc.log(string, level=xbmc.LOGNOTICE)
|
||||
|
@ -76,7 +76,7 @@ class LogHandler(logging.StreamHandler):
|
|||
logging.DEBUG: 2
|
||||
}
|
||||
try:
|
||||
log_level = int(window('emby_logLevel'))
|
||||
log_level = int(window('jellyfin_logLevel'))
|
||||
except ValueError:
|
||||
log_level = 0
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from emby import Emby
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger("EMBY."+__name__)
|
||||
LOG = logging.getLogger("JELLYFIN."+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -32,7 +32,7 @@ def set_properties(item, method, server_id=None):
|
|||
'''
|
||||
info = item.get('PlaybackInfo') or {}
|
||||
|
||||
current = window('emby_play.json') or []
|
||||
current = window('jellyfin_play.json') or []
|
||||
current.append({
|
||||
'Type': item['Type'],
|
||||
'Id': item['Id'],
|
||||
|
@ -51,7 +51,7 @@ def set_properties(item, method, server_id=None):
|
|||
'CurrentEpisode': info.get('CurrentEpisode')
|
||||
})
|
||||
|
||||
window('emby_play.json', current)
|
||||
window('jellyfin_play.json', current)
|
||||
|
||||
class PlayUtils(object):
|
||||
|
||||
|
@ -178,7 +178,7 @@ class PlayUtils(object):
|
|||
def get(self, source, audio=None, subtitle=None):
|
||||
|
||||
''' The server returns sources based on the MaxStreamingBitrate value and other filters.
|
||||
prop: embyfilename for ?? I thought it was to pass the real path to subtitle add-ons but it's not working?
|
||||
prop: jellyfinfilename for ?? I thought it was to pass the real path to subtitle add-ons but it's not working?
|
||||
'''
|
||||
self.info['MediaSourceId'] = source['Id']
|
||||
|
||||
|
@ -214,7 +214,7 @@ class PlayUtils(object):
|
|||
self.item['PlaybackInfo'].update(self.info)
|
||||
|
||||
API = api.API(self.item, self.info['ServerAddress'])
|
||||
window('embyfilename', value=API.get_file_path(source.get('Path')).encode('utf-8'))
|
||||
window('jellyfinfilename', value=API.get_file_path(source.get('Path')).encode('utf-8'))
|
||||
|
||||
def live_stream(self, source):
|
||||
|
||||
|
@ -454,7 +454,7 @@ class PlayUtils(object):
|
|||
def set_external_subs(self, source, listitem):
|
||||
|
||||
''' Try to download external subs locally so we can label them.
|
||||
Since Emby returns all possible tracks together, sort them.
|
||||
Since Jellyfin returns all possible tracks together, sort them.
|
||||
IsTextSubtitleStream if true, is available to download from server.
|
||||
'''
|
||||
if not settings('enableExternalSubs.bool') or not source['MediaStreams']:
|
||||
|
@ -528,7 +528,7 @@ class PlayUtils(object):
|
|||
''' For transcoding only
|
||||
Present the list of audio/subs to select from, before playback starts.
|
||||
|
||||
Since Emby returns all possible tracks together, sort them.
|
||||
Since Jellyfin returns all possible tracks together, sort them.
|
||||
IsTextSubtitleStream if true, is available to download from server.
|
||||
'''
|
||||
prefs = ""
|
||||
|
|
|
@ -11,7 +11,7 @@ import xbmcaddon
|
|||
|
||||
##################################################################################################
|
||||
|
||||
LOG = logging.getLogger('EMBY.'+__name__)
|
||||
LOG = logging.getLogger('JELLYFIN.'+__name__)
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from dateutil import tz, parser
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger("EMBY."+__name__)
|
||||
LOG = logging.getLogger("JELLYFIN."+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -149,10 +149,10 @@ def dialog(dialog_type, *args, **kwargs):
|
|||
d = xbmcgui.Dialog()
|
||||
|
||||
if "icon" in kwargs:
|
||||
kwargs['icon'] = kwargs['icon'].replace("{emby}",
|
||||
kwargs['icon'] = kwargs['icon'].replace("{jellyfin}",
|
||||
"special://home/addons/plugin.video.jellyfin/icon.png")
|
||||
if "heading" in kwargs:
|
||||
kwargs['heading'] = kwargs['heading'].replace("{emby}", _('addon_name'))
|
||||
kwargs['heading'] = kwargs['heading'].replace("{jellyfin}", _('addon_name'))
|
||||
|
||||
types = {
|
||||
'yesno': d.yesno,
|
||||
|
@ -172,11 +172,11 @@ def should_stop():
|
|||
if xbmc.Monitor().waitForAbort(0.00001):
|
||||
return True
|
||||
|
||||
if window('emby_should_stop.bool'):
|
||||
if window('jellyfin_should_stop.bool'):
|
||||
LOG.info("exiiiiitttinggg")
|
||||
return True
|
||||
|
||||
if not window('emby_online.bool'):
|
||||
if not window('jellyfin_online.bool'):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
@ -235,7 +235,7 @@ def validate(path):
|
|||
|
||||
''' Verify if path is accessible.
|
||||
'''
|
||||
if window('emby_pathverified.bool'):
|
||||
if window('jellyfin_pathverified.bool'):
|
||||
return True
|
||||
|
||||
path = path if os.path.supports_unicode_filenames else path.encode('utf-8')
|
||||
|
@ -243,11 +243,11 @@ def validate(path):
|
|||
if not xbmcvfs.exists(path):
|
||||
LOG.info("Could not find %s", path)
|
||||
|
||||
if dialog("yesno", heading="{emby}", line1="%s %s. %s" % (_(33047), path, _(33048))):
|
||||
if dialog("yesno", heading="{jellyfin}", line1="%s %s. %s" % (_(33047), path, _(33048))):
|
||||
|
||||
return False
|
||||
|
||||
window('emby_pathverified.bool', True)
|
||||
window('jellyfin_pathverified.bool', True)
|
||||
|
||||
return True
|
||||
|
||||
|
@ -292,7 +292,7 @@ def delete_folder(path=None):
|
|||
'''
|
||||
LOG.debug("--[ delete folder ]")
|
||||
delete_path = path is not None
|
||||
path = path or xbmc.translatePath('special://temp/emby').decode('utf-8')
|
||||
path = path or xbmc.translatePath('special://temp/jellyfin').decode('utf-8')
|
||||
dirs, files = xbmcvfs.listdir(path)
|
||||
|
||||
delete_recursive(path, dirs)
|
||||
|
|
|
@ -11,7 +11,7 @@ from utils import should_stop
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger("EMBY."+__name__)
|
||||
LOG = logging.getLogger("JELLYFIN."+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -101,7 +101,7 @@ def stop(default=None):
|
|||
|
||||
def emby_item():
|
||||
|
||||
''' Wrapper to retrieve the emby_db item.
|
||||
''' Wrapper to retrieve the jellyfin_db item.
|
||||
'''
|
||||
def decorator(func):
|
||||
def wrapper(self, item, *args, **kwargs):
|
||||
|
|
|
@ -13,14 +13,14 @@ from . import _, indent, write_xml, dialog, settings
|
|||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger("EMBY."+__name__)
|
||||
LOG = logging.getLogger("JELLYFIN."+__name__)
|
||||
|
||||
#################################################################################################
|
||||
|
||||
def sources():
|
||||
|
||||
''' Create master lock compatible sources.
|
||||
Also add the kodi.emby.media source.
|
||||
Also add the kodi.jellyfin.media source.
|
||||
'''
|
||||
path = xbmc.translatePath("special://profile/").decode('utf-8')
|
||||
file = os.path.join(path, 'sources.xml')
|
||||
|
@ -52,7 +52,7 @@ def sources():
|
|||
if (protocol == 'smb://' and count_smb > 0) or (protocol == 'http://' and count_http > 0):
|
||||
|
||||
source = etree.SubElement(video, 'source')
|
||||
etree.SubElement(source, 'name').text = "Emby"
|
||||
etree.SubElement(source, 'name').text = "Jellyfin"
|
||||
etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = protocol
|
||||
etree.SubElement(source, 'allowsharing').text = "true"
|
||||
|
||||
|
@ -63,12 +63,13 @@ def sources():
|
|||
files = etree.SubElement(xml, 'files')
|
||||
|
||||
for source in xml.findall('.//path'):
|
||||
if source.text == 'http://kodi.emby.media':
|
||||
# TODO get a repo url
|
||||
if source.text == 'http://kodi.jellyfin.media':
|
||||
break
|
||||
else:
|
||||
source = etree.SubElement(files, 'source')
|
||||
etree.SubElement(source, 'name').text = "kodi.emby.media"
|
||||
etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = "http://kodi.emby.media"
|
||||
etree.SubElement(source, 'name').text = "kodi.jellyfin.media"
|
||||
etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = "http://kodi.jellyfin.media"
|
||||
etree.SubElement(source, 'allowsharing').text = "true"
|
||||
except Exception as error:
|
||||
LOG.exception(error)
|
||||
|
@ -124,7 +125,7 @@ def advanced_settings():
|
|||
indent(xml)
|
||||
write_xml(etree.tostring(xml, 'UTF-8'), path)
|
||||
|
||||
dialog("ok", heading="{emby}", line1=_(33097))
|
||||
dialog("ok", heading="{jellyfin}", line1=_(33097))
|
||||
xbmc.executebuiltin('RestartApp')
|
||||
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue