Code cleanup
This commit is contained in:
parent
3f42e24b7d
commit
b1f04c85a6
7 changed files with 18 additions and 30 deletions
|
@ -24,10 +24,8 @@ class Sync(object):
|
|||
self.db_scan = False
|
||||
|
||||
def load_settings(self):
|
||||
# Direct Paths (True) or Addon Paths (False)? Along with
|
||||
# window('useDirectPaths')
|
||||
self.direct_paths = True if utils.settings('useDirectPaths') == '1' \
|
||||
else False
|
||||
# Direct Paths (True) or Addon Paths (False)?
|
||||
self.direct_paths = utils.settings('useDirectPaths') == '1'
|
||||
# Is synching of Plex music enabled?
|
||||
self.enable_music = utils.settings('enableMusic') == 'true'
|
||||
# Path remapping mechanism (e.g. smb paths)
|
||||
|
@ -35,6 +33,7 @@ class Sync(object):
|
|||
self.replace_smb_path = utils.settings('replaceSMB') == 'true'
|
||||
# Do we generally remap?
|
||||
self.remap_path = utils.settings('remapSMB') == 'true'
|
||||
self.force_transcode_pix = utils.settings('force_transcode_pix') == 'true'
|
||||
# Mappings for REMAP_PATH:
|
||||
self.remapSMBmovieOrg = utils.settings('remapSMBmovieOrg')
|
||||
self.remapSMBmovieNew = utils.settings('remapSMBmovieNew')
|
||||
|
|
|
@ -510,14 +510,9 @@ def on_deck_episodes(viewid, tagname, limit):
|
|||
xbmcplugin.endOfDirectory(int(argv[1]), False)
|
||||
return
|
||||
# We're using another python instance - need to load some vars
|
||||
if utils.settings('useDirectPaths') == '1':
|
||||
app.SYNC.direct_paths = True
|
||||
app.SYNC.replace_smb_path = utils.settings('replaceSMB') == 'true'
|
||||
app.SYNC.remap_path = utils.settings('remapSMB') == 'true'
|
||||
if app.SYNC.remap_path:
|
||||
initialsetup.set_replace_paths()
|
||||
# Let's NOT check paths for widgets!
|
||||
app.SYNC.path_verified = True
|
||||
app.init()
|
||||
# Let's NOT check paths for widgets!
|
||||
app.SYNC.path_verified = True
|
||||
counter = 0
|
||||
for item in xml:
|
||||
api = API(item)
|
||||
|
|
|
@ -544,7 +544,6 @@ class InitialSetup(object):
|
|||
utils.lang(39081), utils.lang(39082)) == 1:
|
||||
LOG.debug("User opted to use direct paths.")
|
||||
utils.settings('useDirectPaths', value="1")
|
||||
state.DIRECT_PATHS = True
|
||||
# Are you on a system where you would like to replace paths
|
||||
# \\NAS\mymovie.mkv with smb://NAS/mymovie.mkv? (e.g. Windows)
|
||||
if utils.yesno_dialog(utils.lang(29999), utils.lang(39033)):
|
||||
|
@ -596,12 +595,13 @@ class InitialSetup(object):
|
|||
# Open Settings page now? You will need to restart!
|
||||
goto_settings = utils.yesno_dialog(utils.lang(29999),
|
||||
utils.lang(39017))
|
||||
# Reload relevant settings
|
||||
app.CONN.load()
|
||||
app.ACCOUNT.load()
|
||||
if goto_settings:
|
||||
app.APP.suspend = True
|
||||
executebuiltin(
|
||||
'Addon.OpenSettings(plugin.video.plexkodiconnect)')
|
||||
elif reboot is True:
|
||||
utils.reboot_kodi()
|
||||
# Reload relevant settings
|
||||
app.CONN.load()
|
||||
app.ACCOUNT.load()
|
||||
app.SYNC.load()
|
||||
|
|
|
@ -215,8 +215,7 @@ class API(object):
|
|||
Will always use addon paths, never direct paths
|
||||
"""
|
||||
extension = self.item[0][0].attrib['key'][self.item[0][0].attrib['key'].rfind('.'):].lower()
|
||||
if (utils.window('plex_force_transcode_pix') == 'true' or
|
||||
extension not in v.KODI_SUPPORTED_IMAGES):
|
||||
if app.SYNC.force_transcode_pix or extension not in v.KODI_SUPPORTED_IMAGES:
|
||||
# Let Plex transcode
|
||||
# max width/height supported by plex image transcoder is 1920x1080
|
||||
path = app.CONN.server + PF.transcode_image_path(
|
||||
|
|
|
@ -192,7 +192,7 @@ class plexgdm:
|
|||
log.info("Server list is empty. Unable to check")
|
||||
return False
|
||||
for server in self.server_list:
|
||||
if server['uuid'] == utils.window('plex_machineIdentifier'):
|
||||
if server['uuid'] == app.CONN.machine_identifier:
|
||||
media_server = server['server']
|
||||
media_port = server['port']
|
||||
scheme = server['protocol']
|
||||
|
@ -243,9 +243,9 @@ class plexgdm:
|
|||
'owned': '1',
|
||||
'role': 'master',
|
||||
'server': currServerIP,
|
||||
'serverName': utils.window('plex_servername'),
|
||||
'serverName': app.CONN.server_name,
|
||||
'updated': int(time.time()),
|
||||
'uuid': utils.window('plex_machineIdentifier'),
|
||||
'uuid': app.CONN.machine_identifier,
|
||||
'version': 'irrelevant'
|
||||
}]
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ class SubscriptionMgr(object):
|
|||
'protocol': self.protocol,
|
||||
'address': self.server,
|
||||
'port': self.port,
|
||||
'machineIdentifier': utils.window('plex_machineIdentifier'),
|
||||
'machineIdentifier': app.CONN.machine_identifier,
|
||||
'state': status,
|
||||
'type': ptype,
|
||||
'itemType': ptype,
|
||||
|
|
|
@ -26,14 +26,9 @@ LOG = logging.getLogger("PLEX.service")
|
|||
###############################################################################
|
||||
|
||||
WINDOW_PROPERTIES = (
|
||||
"plex_command_processed", "plex_shouldStop", "plex_dbScan",
|
||||
"plex_customplayqueue", "plex_playbackProps",
|
||||
"pms_token", "plex_token", "pms_server", "plex_machineIdentifier",
|
||||
"plex_servername", "plex_authenticated", "PlexUserImage", "useDirectPaths",
|
||||
"plex_restricteduser",
|
||||
"plex_allows_mediaDeletion", "plex_command", "plex_result",
|
||||
"plex_force_transcode_pix"
|
||||
)
|
||||
"plex_dbScan", "pms_token", "plex_token", "pms_server",
|
||||
"plex_authenticated", "plex_restricteduser", "plex_allows_mediaDeletion",
|
||||
"plex_command", "plex_result")
|
||||
|
||||
|
||||
class Service():
|
||||
|
|
Loading…
Reference in a new issue