Delete obsolete screensaver function
This commit is contained in:
parent
f2bc95813a
commit
34cd0fadb4
3 changed files with 12 additions and 24 deletions
|
@ -272,7 +272,8 @@ def playlist_remove(playlistid, position):
|
||||||
|
|
||||||
def get_setting(setting):
|
def get_setting(setting):
|
||||||
"""
|
"""
|
||||||
Returns the Kodi setting, a [str], or None if not possible
|
Returns the Kodi setting (GetSettingValue), a [str], or None if not
|
||||||
|
possible
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
ret = jsonrpc('Settings.GetSettingValue').execute(
|
ret = jsonrpc('Settings.GetSettingValue').execute(
|
||||||
|
|
|
@ -9,15 +9,16 @@ import xbmc
|
||||||
from xbmcvfs import exists
|
from xbmcvfs import exists
|
||||||
|
|
||||||
from utils import window, settings, getUnixTimestamp, sourcesXML,\
|
from utils import window, settings, getUnixTimestamp, sourcesXML,\
|
||||||
thread_methods, create_actor_db_index, dialog, LogTime, getScreensaver,\
|
thread_methods, create_actor_db_index, dialog, LogTime, playlistXSP,\
|
||||||
setScreensaver, playlistXSP, language as lang, DateToKodi, reset,\
|
language as lang, DateToKodi, reset, tryDecode, deletePlaylists, \
|
||||||
tryDecode, deletePlaylists, deleteNodes, tryEncode, compare_version
|
deleteNodes, tryEncode, compare_version
|
||||||
import downloadutils
|
import downloadutils
|
||||||
import itemtypes
|
import itemtypes
|
||||||
import plexdb_functions as plexdb
|
import plexdb_functions as plexdb
|
||||||
import kodidb_functions as kodidb
|
import kodidb_functions as kodidb
|
||||||
import userclient
|
import userclient
|
||||||
import videonodes
|
import videonodes
|
||||||
|
import json_rpc as js
|
||||||
import variables as v
|
import variables as v
|
||||||
|
|
||||||
from PlexFunctions import GetPlexMetadata, GetAllPlexLeaves, scrobble, \
|
from PlexFunctions import GetPlexMetadata, GetAllPlexLeaves, scrobble, \
|
||||||
|
@ -264,9 +265,8 @@ class LibrarySync(Thread):
|
||||||
|
|
||||||
def _fullSync(self):
|
def _fullSync(self):
|
||||||
xbmc.executebuiltin('InhibitIdleShutdown(true)')
|
xbmc.executebuiltin('InhibitIdleShutdown(true)')
|
||||||
screensaver = getScreensaver()
|
screensaver = js.get_setting('screensaver.mode')
|
||||||
setScreensaver(value="")
|
js.set_setting('screensaver.mode', '')
|
||||||
|
|
||||||
if self.new_items_only is True:
|
if self.new_items_only is True:
|
||||||
# Only do the following once for new items
|
# Only do the following once for new items
|
||||||
# Add sources
|
# Add sources
|
||||||
|
@ -275,7 +275,7 @@ class LibrarySync(Thread):
|
||||||
# Set views. Abort if unsuccessful
|
# Set views. Abort if unsuccessful
|
||||||
if not self.maintainViews():
|
if not self.maintainViews():
|
||||||
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
||||||
setScreensaver(value=screensaver)
|
js.set_setting('screensaver.mode', screensaver)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
process = {
|
process = {
|
||||||
|
@ -291,7 +291,7 @@ class LibrarySync(Thread):
|
||||||
self.thread_suspended() or
|
self.thread_suspended() or
|
||||||
not process[itemtype]()):
|
not process[itemtype]()):
|
||||||
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
||||||
setScreensaver(value=screensaver)
|
js.set_setting('screensaver.mode', screensaver)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Let kodi update the views in any case, since we're doing a full sync
|
# Let kodi update the views in any case, since we're doing a full sync
|
||||||
|
@ -301,7 +301,7 @@ class LibrarySync(Thread):
|
||||||
|
|
||||||
window('plex_initialScan', clear=True)
|
window('plex_initialScan', clear=True)
|
||||||
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
||||||
setScreensaver(value=screensaver)
|
js.set_setting('screensaver.mode', screensaver)
|
||||||
if window('plex_scancrashed') == 'true':
|
if window('plex_scancrashed') == 'true':
|
||||||
# Show warning if itemtypes.py crashed at some point
|
# Show warning if itemtypes.py crashed at some point
|
||||||
dialog('ok', heading='{plex}', line1=lang(39408))
|
dialog('ok', heading='{plex}', line1=lang(39408))
|
||||||
|
@ -320,7 +320,7 @@ class LibrarySync(Thread):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Empty movies, tv shows?
|
# Empty movies, tv shows?
|
||||||
log.error('Path hack failed with error message: %s' % str(e))
|
log.error('Path hack failed with error message: %s' % str(e))
|
||||||
setScreensaver(value=screensaver)
|
js.set_setting('screensaver.mode', screensaver)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def processView(self, folderItem, kodi_db, plex_db, totalnodes):
|
def processView(self, folderItem, kodi_db, plex_db, totalnodes):
|
||||||
|
|
|
@ -330,19 +330,6 @@ def create_actor_db_index():
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
def getScreensaver():
|
|
||||||
# Get the current screensaver value
|
|
||||||
params = {'setting': "screensaver.mode"}
|
|
||||||
return jsonrpc('Settings.getSettingValue').execute(params)['result']['value']
|
|
||||||
|
|
||||||
|
|
||||||
def setScreensaver(value):
|
|
||||||
# Toggle the screensaver
|
|
||||||
params = {'setting': "screensaver.mode", 'value': value}
|
|
||||||
log.debug('Toggling screensaver to "%s": %s'
|
|
||||||
% (value, jsonrpc('Settings.setSettingValue').execute(params)))
|
|
||||||
|
|
||||||
|
|
||||||
def reset():
|
def reset():
|
||||||
# Are you sure you want to reset your local Kodi database?
|
# Are you sure you want to reset your local Kodi database?
|
||||||
if not dialog('yesno',
|
if not dialog('yesno',
|
||||||
|
|
Loading…
Reference in a new issue