mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
only set the first run setting if it is not set
This commit is contained in:
parent
52d4093a44
commit
a6a30cc54c
2 changed files with 24 additions and 12 deletions
|
@ -74,15 +74,17 @@ class LibrarySync():
|
||||||
|
|
||||||
def MoviesSync(self, fullsync=True):
|
def MoviesSync(self, fullsync=True):
|
||||||
|
|
||||||
addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
|
|
||||||
WINDOW = xbmcgui.Window( 10000 )
|
WINDOW = xbmcgui.Window( 10000 )
|
||||||
pDialog = None
|
pDialog = None
|
||||||
startedSync = datetime.today()
|
startedSync = datetime.today()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
|
||||||
dbSyncIndication = addon.getSetting("dbSyncIndication")
|
dbSyncIndication = addon.getSetting("dbSyncIndication")
|
||||||
|
dbSyncFirstRun = addon.getSetting("SyncFirstMovieRunDone")
|
||||||
|
|
||||||
if(addon.getSetting("SyncFirstMovieRunDone") != "true" or dbSyncIndication == "Dialog Progress"):
|
if(dbSyncFirstRun != "true" or dbSyncIndication == "Dialog Progress"):
|
||||||
pDialog = xbmcgui.DialogProgress()
|
pDialog = xbmcgui.DialogProgress()
|
||||||
elif(dbSyncIndication == "BG Progress"):
|
elif(dbSyncIndication == "BG Progress"):
|
||||||
pDialog = xbmcgui.DialogProgressBG()
|
pDialog = xbmcgui.DialogProgressBG()
|
||||||
|
@ -224,7 +226,9 @@ class LibrarySync():
|
||||||
if cleanNeeded:
|
if cleanNeeded:
|
||||||
self.doKodiLibraryUpdate(True, pDialog)
|
self.doKodiLibraryUpdate(True, pDialog)
|
||||||
|
|
||||||
addon.setSetting("SyncFirstMovieRunDone", "true")
|
if(dbSyncFirstRun != "true"):
|
||||||
|
addon = xbmcaddon.Addon(id='plugin.video.mb3sync') #force a new instance of the addon
|
||||||
|
addon.setSetting("SyncFirstMovieRunDone", "true")
|
||||||
|
|
||||||
# display notification if set up
|
# display notification if set up
|
||||||
notificationString = ""
|
notificationString = ""
|
||||||
|
@ -263,8 +267,9 @@ class LibrarySync():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dbSyncIndication = addon.getSetting("dbSyncIndication")
|
dbSyncIndication = addon.getSetting("dbSyncIndication")
|
||||||
|
dbSyncFirstRun = addon.getSetting("SyncFirstTVRunDone")
|
||||||
|
|
||||||
if(addon.getSetting("SyncFirstTVRunDone") != "true" or dbSyncIndication == "Dialog Progress"):
|
if(dbSyncFirstRun != "true" or dbSyncIndication == "Dialog Progress"):
|
||||||
pDialog = xbmcgui.DialogProgress()
|
pDialog = xbmcgui.DialogProgress()
|
||||||
elif(dbSyncIndication == "BG Progress"):
|
elif(dbSyncIndication == "BG Progress"):
|
||||||
pDialog = xbmcgui.DialogProgressBG()
|
pDialog = xbmcgui.DialogProgressBG()
|
||||||
|
@ -581,7 +586,9 @@ class LibrarySync():
|
||||||
if cleanNeeded:
|
if cleanNeeded:
|
||||||
self.doKodiLibraryUpdate(True, pDialog)
|
self.doKodiLibraryUpdate(True, pDialog)
|
||||||
|
|
||||||
addon.setSetting("SyncFirstTVRunDone", "true")
|
if(dbSyncFirstRun != "true"):
|
||||||
|
addon = xbmcaddon.Addon(id='plugin.video.mb3sync') #force a new instance of the addon
|
||||||
|
addon.setSetting("SyncFirstTVRunDone", "true")
|
||||||
|
|
||||||
# display notification if set up
|
# display notification if set up
|
||||||
notificationString = ""
|
notificationString = ""
|
||||||
|
@ -619,8 +626,9 @@ class LibrarySync():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dbSyncIndication = addon.getSetting("dbSyncIndication")
|
dbSyncIndication = addon.getSetting("dbSyncIndication")
|
||||||
|
dbSyncFirstRun = addon.getSetting("SyncFirstMusicVideoRunDone")
|
||||||
|
|
||||||
if(addon.getSetting("SyncFirstMusicVideoRunDone") != "true" or dbSyncIndication == "Dialog Progress"):
|
if(dbSyncFirstRun != "true" or dbSyncIndication == "Dialog Progress"):
|
||||||
pDialog = xbmcgui.DialogProgress()
|
pDialog = xbmcgui.DialogProgress()
|
||||||
elif(dbSyncIndication == "BG Progress"):
|
elif(dbSyncIndication == "BG Progress"):
|
||||||
pDialog = xbmcgui.DialogProgressBG()
|
pDialog = xbmcgui.DialogProgressBG()
|
||||||
|
@ -736,7 +744,9 @@ class LibrarySync():
|
||||||
if cleanNeeded:
|
if cleanNeeded:
|
||||||
self.doKodiLibraryUpdate(True, pDialog)
|
self.doKodiLibraryUpdate(True, pDialog)
|
||||||
|
|
||||||
addon.setSetting("SyncFirstMusicVideoRunDone", "true")
|
if(dbSyncFirstRun != "true"):
|
||||||
|
addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
|
||||||
|
addon.setSetting("SyncFirstMusicVideoRunDone", "true")
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
|
@ -768,8 +778,9 @@ class LibrarySync():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
playCountSyncIndication = addon.getSetting("playCountSyncIndication")
|
playCountSyncIndication = addon.getSetting("playCountSyncIndication")
|
||||||
|
playCountSyncFirstRun = addon.getSetting("SyncFirstCountsRunDone")
|
||||||
|
|
||||||
if(addon.getSetting("SyncFirstCountsRunDone") != "true" or playCountSyncIndication == "Dialog Progress"):
|
if(playCountSyncFirstRun != "true" or playCountSyncIndication == "Dialog Progress"):
|
||||||
pDialog = xbmcgui.DialogProgress()
|
pDialog = xbmcgui.DialogProgress()
|
||||||
elif(playCountSyncIndication == "BG Progress"):
|
elif(playCountSyncIndication == "BG Progress"):
|
||||||
pDialog = xbmcgui.DialogProgressBG()
|
pDialog = xbmcgui.DialogProgressBG()
|
||||||
|
@ -900,7 +911,9 @@ class LibrarySync():
|
||||||
|
|
||||||
showCurrent += 1
|
showCurrent += 1
|
||||||
|
|
||||||
addon.setSetting("SyncFirstCountsRunDone", "true")
|
if(playCountSyncFirstRun != "true"):
|
||||||
|
addon = xbmcaddon.Addon(id='plugin.video.mb3sync')
|
||||||
|
addon.setSetting("SyncFirstCountsRunDone", "true")
|
||||||
|
|
||||||
# display notification if set up
|
# display notification if set up
|
||||||
notificationString = ""
|
notificationString = ""
|
||||||
|
|
|
@ -6,8 +6,7 @@ import threading
|
||||||
import json
|
import json
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
addonSettings = xbmcaddon.Addon(id='plugin.video.mb3sync')
|
cwd = xbmcaddon.Addon(id='plugin.video.mb3sync').getAddonInfo('path')
|
||||||
cwd = addonSettings.getAddonInfo('path')
|
|
||||||
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( cwd, 'resources', 'lib' ) )
|
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( cwd, 'resources', 'lib' ) )
|
||||||
sys.path.append(BASE_RESOURCE_PATH)
|
sys.path.append(BASE_RESOURCE_PATH)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue