Centralized logging

This commit is contained in:
angelblue05 2016-06-17 22:03:28 -05:00
parent 02e7c2946b
commit 5658801f72
10 changed files with 336 additions and 373 deletions

View file

@ -20,6 +20,7 @@ import kodidb_functions as kodidb
import read_embyserver as embyserver
import userclient
import videonodes
from utils import Logging, window, settings, language as lang
##################################################################################################
@ -42,6 +43,9 @@ class LibrarySync(threading.Thread):
def __init__(self):
global log
log = Logging(self.__class__.__name__).log
self.__dict__ = self._shared_state
self.monitor = xbmc.Monitor()
@ -54,26 +58,20 @@ class LibrarySync(threading.Thread):
threading.Thread.__init__(self)
def logMsg(self, msg, lvl=1):
className = self.__class__.__name__
utils.logMsg("%s %s" % (self.addonName, className), msg, lvl)
def progressDialog(self, title, forced=False):
dialog = None
if utils.settings('dbSyncIndicator') == "true" or forced:
if settings('dbSyncIndicator') == "true" or forced:
dialog = xbmcgui.DialogProgressBG()
dialog.create("Emby for Kodi", title)
self.logMsg("Show progress dialog: %s" % title, 2)
log("Show progress dialog: %s" % title, 2)
return dialog
def startSync(self):
settings = utils.settings
# Run at start up - optional to use the server plugin
if settings('SyncInstallRunDone') == "true":
@ -88,7 +86,7 @@ class LibrarySync(threading.Thread):
for plugin in result:
if plugin['Name'] == "Emby.Kodi Sync Queue":
self.logMsg("Found server plugin.", 2)
log("Found server plugin.", 2)
completed = self.fastSync()
break
@ -103,37 +101,31 @@ class LibrarySync(threading.Thread):
def fastSync(self):
lastSync = utils.settings('LastIncrementalSync')
lastSync = settings('LastIncrementalSync')
if not lastSync:
lastSync = "2010-01-01T00:00:00Z"
lastSyncTime = utils.convertdate(lastSync)
self.logMsg("Last sync run: %s" % lastSyncTime, 1)
lastSyncTime = utils.convertDate(lastSync)
log("Last sync run: %s" % lastSyncTime, 1)
# get server RetentionDateTime
result = self.doUtils("{server}/emby/Emby.Kodi.SyncQueue/GetServerDateTime?format=json")
retention_time = "2010-01-01T00:00:00Z"
if result and result.get('RetentionDateTime'):
retention_time = result['RetentionDateTime']
#Try/except equivalent
'''
try:
retention_time = result['RetentionDateTime']
except (TypeError, KeyError):
retention_time = "2010-01-01T00:00:00Z"
'''
retention_time = utils.convertdate(retention_time)
self.logMsg("RetentionDateTime: %s" % retention_time, 1)
retention_time = utils.convertDate(retention_time)
log("RetentionDateTime: %s" % retention_time, 1)
# if last sync before retention time do a full sync
if retention_time > lastSyncTime:
self.logMsg("Fast sync server retention insufficient, fall back to full sync", 1)
log("Fast sync server retention insufficient, fall back to full sync", 1)
return False
params = {'LastUpdateDT': lastSync}
result = self.doUtils("{server}/emby/Emby.Kodi.SyncQueue/{UserId}/GetItems?format=json", parameters=params)
url = "{server}/emby/Emby.Kodi.SyncQueue/{UserId}/GetItems?format=json"
result = self.doUtils(url, parameters=params)
try:
processlist = {
@ -145,11 +137,11 @@ class LibrarySync(threading.Thread):
}
except (KeyError, TypeError):
self.logMsg("Failed to retrieve latest updates using fast sync.", 1)
log("Failed to retrieve latest updates using fast sync.", 1)
return False
else:
self.logMsg("Fast sync changes: %s" % result, 1)
log("Fast sync changes: %s" % result, 1)
for action in processlist:
self.triage_items(action, processlist[action])
@ -163,60 +155,55 @@ class LibrarySync(threading.Thread):
result = self.doUtils("{server}/emby/Emby.Kodi.SyncQueue/GetServerDateTime?format=json")
try: # datetime fails when used more than once, TypeError
server_time = result['ServerDateTime']
server_time = utils.convertdate(server_time)
server_time = utils.convertDate(server_time)
except Exception as e:
# If the server plugin is not installed or an error happened.
self.logMsg("An exception occurred: %s" % e, 1)
log("An exception occurred: %s" % e, 1)
time_now = datetime.utcnow()-timedelta(minutes=overlap)
lastSync = time_now.strftime('%Y-%m-%dT%H:%M:%SZ')
self.logMsg("New sync time: client time -%s min: %s" % (overlap, lastSync), 1)
log("New sync time: client time -%s min: %s" % (overlap, lastSync), 1)
else:
lastSync = (server_time - timedelta(minutes=overlap)).strftime('%Y-%m-%dT%H:%M:%SZ')
self.logMsg("New sync time: server time -%s min: %s" % (overlap, lastSync), 1)
log("New sync time: server time -%s min: %s" % (overlap, lastSync), 1)
finally:
utils.settings('LastIncrementalSync', value=lastSync)
settings('LastIncrementalSync', value=lastSync)
def shouldStop(self):
# Checkpoint during the syncing process
if self.monitor.abortRequested():
return True
elif utils.window('emby_shouldStop') == "true":
elif window('emby_shouldStop') == "true":
return True
else: # Keep going
return False
def dbCommit(self, connection):
window = utils.window
# Central commit, verifies if Kodi database update is running
kodidb_scan = window('emby_kodiScan') == "true"
while kodidb_scan:
self.logMsg("Kodi scan is running. Waiting...", 1)
log("Kodi scan is running. Waiting...", 1)
kodidb_scan = window('emby_kodiScan') == "true"
if self.shouldStop():
self.logMsg("Commit unsuccessful. Sync terminated.", 1)
log("Commit unsuccessful. Sync terminated.", 1)
break
if self.monitor.waitForAbort(1):
# Abort was requested while waiting. We should exit
self.logMsg("Commit unsuccessful.", 1)
log("Commit unsuccessful.", 1)
break
else:
connection.commit()
self.logMsg("Commit successful.", 1)
log("Commit successful.", 1)
def fullSync(self, manualrun=False, repair=False, forceddialog=False):
window = utils.window
settings = utils.settings
# Only run once when first setting up. Can be run manually.
music_enabled = utils.settings('enableMusic') == "true"
music_enabled = settings('enableMusic') == "true"
xbmc.executebuiltin('InhibitIdleShutdown(true)')
screensaver = utils.getScreensaver()
@ -284,7 +271,7 @@ class LibrarySync(threading.Thread):
self.dbCommit(kodiconn)
embyconn.commit()
elapsedTime = datetime.now() - startTime
self.logMsg("SyncDatabase (finished %s in: %s)"
log("SyncDatabase (finished %s in: %s)"
% (itemtype, str(elapsedTime).split('.')[0]), 1)
else:
# Close the Kodi cursor
@ -312,7 +299,7 @@ class LibrarySync(threading.Thread):
musicconn.commit()
embyconn.commit()
elapsedTime = datetime.now() - startTime
self.logMsg("SyncDatabase (finished music in: %s)"
log("SyncDatabase (finished music in: %s)"
% (str(elapsedTime).split('.')[0]), 1)
musiccursor.close()
@ -335,7 +322,7 @@ class LibrarySync(threading.Thread):
xbmcgui.Dialog().notification(
heading="Emby for Kodi",
message="%s %s %s" %
(message, utils.language(33025), str(elapsedtotal).split('.')[0]),
(message, lang(33025), str(elapsedtotal).split('.')[0]),
icon="special://home/addons/plugin.video.emby/icon.png",
sound=False)
return True
@ -378,7 +365,7 @@ class LibrarySync(threading.Thread):
if view['type'] == "mixed":
sorted_views.append(view['name'])
sorted_views.append(view['name'])
self.logMsg("Sorted views: %s" % sorted_views, 1)
log("Sorted views: %s" % sorted_views, 1)
# total nodes for window properties
self.vnodes.clearProperties()
@ -415,7 +402,8 @@ class LibrarySync(threading.Thread):
'Limit': 1,
'IncludeItemTypes': emby_mediatypes[mediatype]
} # Get one item from server using the folderid
result = self.doUtils("{server}/emby/Users/{UserId}/Items?format=json", parameters=params)
url = "{server}/emby/Users/{UserId}/Items?format=json"
result = self.doUtils(url, parameters=params)
try:
verifyitem = result['Items'][0]['Id']
except (TypeError, IndexError):
@ -430,14 +418,14 @@ class LibrarySync(threading.Thread):
# Take the userview, and validate the item belong to the view
if self.emby.verifyView(grouped_view['Id'], verifyitem):
# Take the name of the userview
self.logMsg("Found corresponding view: %s %s"
log("Found corresponding view: %s %s"
% (grouped_view['Name'], grouped_view['Id']), 1)
foldername = grouped_view['Name']
break
else:
# Unable to find a match, add the name to our sorted_view list
sorted_views.append(foldername)
self.logMsg("Couldn't find corresponding grouped view: %s" % sorted_views, 1)
log("Couldn't find corresponding grouped view: %s" % sorted_views, 1)
# Failsafe
try:
@ -453,7 +441,7 @@ class LibrarySync(threading.Thread):
current_tagid = view[2]
except TypeError:
self.logMsg("Creating viewid: %s in Emby database." % folderid, 1)
log("Creating viewid: %s in Emby database." % folderid, 1)
tagid = kodi_db.createTag(foldername)
# Create playlist for the video library
if (foldername not in playlists and
@ -472,7 +460,7 @@ class LibrarySync(threading.Thread):
emby_db.addView(folderid, foldername, viewtype, tagid)
else:
self.logMsg(' '.join((
log(' '.join((
"Found viewid: %s" % folderid,
"viewname: %s" % current_viewname,
@ -488,7 +476,7 @@ class LibrarySync(threading.Thread):
# View was modified, update with latest info
if current_viewname != foldername:
self.logMsg("viewid: %s new viewname: %s" % (folderid, foldername), 1)
log("viewid: %s new viewname: %s" % (folderid, foldername), 1)
tagid = kodi_db.createTag(foldername)
# Update view with new info
@ -556,20 +544,19 @@ class LibrarySync(threading.Thread):
utils.window('Emby.nodes.total', str(totalnodes))
# Remove any old referenced views
self.logMsg("Removing views: %s" % current_views, 1)
log("Removing views: %s" % current_views, 1)
for view in current_views:
emby_db.removeView(view)
def movies(self, embycursor, kodicursor, pdialog):
lang = utils.language
# Get movies from emby
emby_db = embydb.Embydb_Functions(embycursor)
movies = itemtypes.Movies(embycursor, kodicursor)
views = emby_db.getView_byType('movies')
views += emby_db.getView_byType('mixed')
self.logMsg("Media folders: %s" % views, 1)
log("Media folders: %s" % views, 1)
##### PROCESS MOVIES #####
for view in views:
@ -604,7 +591,7 @@ class LibrarySync(threading.Thread):
count += 1
movies.add_update(embymovie, view['name'], view['id'])
else:
self.logMsg("Movies finished.", 2)
log("Movies finished.", 2)
##### PROCESS BOXSETS #####
@ -631,7 +618,7 @@ class LibrarySync(threading.Thread):
count += 1
movies.add_updateBoxset(boxset)
else:
self.logMsg("Boxsets finished.", 2)
log("Boxsets finished.", 2)
return True
@ -642,7 +629,7 @@ class LibrarySync(threading.Thread):
mvideos = itemtypes.MusicVideos(embycursor, kodicursor)
views = emby_db.getView_byType('musicvideos')
self.logMsg("Media folders: %s" % views, 1)
log("Media folders: %s" % views, 1)
for view in views:
@ -656,7 +643,7 @@ class LibrarySync(threading.Thread):
if pdialog:
pdialog.update(
heading="Emby for Kodi",
message="%s %s..." % (utils.language(33019), viewName))
message="%s %s..." % (lang(33019), viewName))
# Initial or repair sync
all_embymvideos = self.emby.getMusicVideos(viewId, dialog=pdialog)
@ -679,7 +666,7 @@ class LibrarySync(threading.Thread):
count += 1
mvideos.add_update(embymvideo, viewName, viewId)
else:
self.logMsg("MusicVideos finished.", 2)
log("MusicVideos finished.", 2)
return True
@ -691,7 +678,7 @@ class LibrarySync(threading.Thread):
views = emby_db.getView_byType('tvshows')
views += emby_db.getView_byType('mixed')
self.logMsg("Media folders: %s" % views, 1)
log("Media folders: %s" % views, 1)
for view in views:
@ -702,7 +689,7 @@ class LibrarySync(threading.Thread):
if pdialog:
pdialog.update(
heading="Emby for Kodi",
message="%s %s..." % (utils.language(33020), view['name']))
message="%s %s..." % (lang(33020), view['name']))
all_embytvshows = self.emby.getShows(view['id'], dialog=pdialog)
total = all_embytvshows['TotalRecordCount']
@ -737,7 +724,7 @@ class LibrarySync(threading.Thread):
pdialog.update(percentage, message="%s - %s" % (title, episodetitle))
tvshows.add_updateEpisode(episode)
else:
self.logMsg("TVShows finished.", 2)
log("TVShows finished.", 2)
return True
@ -757,7 +744,7 @@ class LibrarySync(threading.Thread):
if pdialog:
pdialog.update(
heading="Emby for Kodi",
message="%s %s..." % (utils.language(33021), itemtype))
message="%s %s..." % (lang(33021), itemtype))
all_embyitems = process[itemtype][0](dialog=pdialog)
total = all_embyitems['TotalRecordCount']
@ -778,7 +765,7 @@ class LibrarySync(threading.Thread):
process[itemtype][1](embyitem)
else:
self.logMsg("%s finished." % itemtype, 2)
log("%s finished." % itemtype, 2)
return True
@ -799,7 +786,7 @@ class LibrarySync(threading.Thread):
itemids.append(item['ItemId'])
items = itemids
self.logMsg("Queue %s: %s" % (process, items), 1)
log("Queue %s: %s" % (process, items), 1)
processlist[process].extend(items)
def incrementalSync(self):
@ -833,7 +820,7 @@ class LibrarySync(threading.Thread):
}
for process_type in ['added', 'update', 'userdata', 'remove']:
if process[process_type] and utils.window('emby_kodiScan') != "true":
if process[process_type] and window('emby_kodiScan') != "true":
listItems = list(process[process_type])
del process[process_type][:] # Reset class list
@ -871,7 +858,7 @@ class LibrarySync(threading.Thread):
if update_embydb:
update_embydb = False
self.logMsg("Updating emby database.", 1)
log("Updating emby database.", 1)
embyconn.commit()
self.saveLastSync()
@ -880,8 +867,8 @@ class LibrarySync(threading.Thread):
self.forceLibraryUpdate = False
self.dbCommit(kodiconn)
self.logMsg("Updating video library.", 1)
utils.window('emby_kodiScan', value="true")
log("Updating video library.", 1)
window('emby_kodiScan', value="true")
xbmc.executebuiltin('UpdateLibrary(video)')
if pDialog:
@ -893,7 +880,7 @@ class LibrarySync(threading.Thread):
def compareDBVersion(self, current, minimum):
# It returns True is database is up to date. False otherwise.
self.logMsg("current: %s minimum: %s" % (current, minimum), 1)
log("current: %s minimum: %s" % (current, minimum), 1)
currMajor, currMinor, currPatch = current.split(".")
minMajor, minMinor, minPatch = minimum.split(".")
@ -911,7 +898,7 @@ class LibrarySync(threading.Thread):
try:
self.run_internal()
except Exception as e:
utils.window('emby_dbScan', clear=True)
window('emby_dbScan', clear=True)
xbmcgui.Dialog().ok(
heading="Emby for Kodi",
line1=(
@ -922,14 +909,11 @@ class LibrarySync(threading.Thread):
def run_internal(self):
lang = utils.language
window = utils.window
settings = utils.settings
dialog = xbmcgui.Dialog()
startupComplete = False
self.logMsg("---===### Starting LibrarySync ###===---", 0)
log("---===### Starting LibrarySync ###===---", 0)
while not self.monitor.abortRequested():
@ -947,12 +931,12 @@ class LibrarySync(threading.Thread):
uptoDate = self.compareDBVersion(currentVersion, minVersion)
if not uptoDate:
self.logMsg("Database version out of date: %s minimum version required: %s"
log("Database version out of date: %s minimum version required: %s"
% (currentVersion, minVersion), 0)
resp = dialog.yesno("Emby for Kodi", lang(33022))
if not resp:
self.logMsg("Database version is out of date! USER IGNORED!", 0)
log("Database version is out of date! USER IGNORED!", 0)
dialog.ok("Emby for Kodi", lang(33023))
else:
utils.reset()
@ -967,7 +951,7 @@ class LibrarySync(threading.Thread):
videoDb = utils.getKodiVideoDBPath()
if not xbmcvfs.exists(videoDb):
# Database does not exists
self.logMsg(
log(
"The current Kodi version is incompatible "
"with the Emby for Kodi add-on. Please visit "
"https://github.com/MediaBrowser/Emby.Kodi/wiki "
@ -979,12 +963,12 @@ class LibrarySync(threading.Thread):
break
# Run start up sync
self.logMsg("Database version: %s" % settings('dbCreatedWithVersion'), 0)
self.logMsg("SyncDatabase (started)", 1)
log("Database version: %s" % settings('dbCreatedWithVersion'), 0)
log("SyncDatabase (started)", 1)
startTime = datetime.now()
librarySync = self.startSync()
elapsedTime = datetime.now() - startTime
self.logMsg("SyncDatabase (finished in: %s) %s"
log("SyncDatabase (finished in: %s) %s"
% (str(elapsedTime).split('.')[0], librarySync), 1)
# Only try the initial sync once per kodi session regardless
# This will prevent an infinite loop in case something goes wrong.
@ -999,32 +983,32 @@ class LibrarySync(threading.Thread):
# Set in kodimonitor.py
window('emby_onWake', clear=True)
if window('emby_syncRunning') != "true":
self.logMsg("SyncDatabase onWake (started)", 0)
log("SyncDatabase onWake (started)", 0)
librarySync = self.startSync()
self.logMsg("SyncDatabase onWake (finished) %s" % librarySync, 0)
log("SyncDatabase onWake (finished) %s" % librarySync, 0)
if self.stop_thread:
# Set in service.py
self.logMsg("Service terminated thread.", 2)
log("Service terminated thread.", 2)
break
if self.monitor.waitForAbort(1):
# Abort was requested while waiting. We should exit
break
self.logMsg("###===--- LibrarySync Stopped ---===###", 0)
log("###===--- LibrarySync Stopped ---===###", 0)
def stopThread(self):
self.stop_thread = True
self.logMsg("Ending thread...", 2)
log("Ending thread...", 2)
def suspendThread(self):
self.suspend_thread = True
self.logMsg("Pausing thread...", 0)
log("Pausing thread...", 0)
def resumeThread(self):
self.suspend_thread = False
self.logMsg("Resuming thread...", 0)
log("Resuming thread...", 0)
class ManualSync(LibrarySync):
@ -1041,14 +1025,13 @@ class ManualSync(LibrarySync):
def movies(self, embycursor, kodicursor, pdialog):
lang = utils.language
# Get movies from emby
emby_db = embydb.Embydb_Functions(embycursor)
movies = itemtypes.Movies(embycursor, kodicursor)
views = emby_db.getView_byType('movies')
views += emby_db.getView_byType('mixed')
self.logMsg("Media folders: %s" % views, 1)
log("Media folders: %s" % views, 1)
# Pull the list of movies and boxsets in Kodi
try:
@ -1095,7 +1078,7 @@ class ManualSync(LibrarySync):
# Only update if movie is not in Kodi or checksum is different
updatelist.append(itemid)
self.logMsg("Movies to update for %s: %s" % (viewName, updatelist), 1)
log("Movies to update for %s: %s" % (viewName, updatelist), 1)
embymovies = self.emby.getFullItems(updatelist)
total = len(updatelist)
del updatelist[:]
@ -1137,7 +1120,7 @@ class ManualSync(LibrarySync):
updatelist.append(itemid)
embyboxsets.append(boxset)
self.logMsg("Boxsets to update: %s" % updatelist, 1)
log("Boxsets to update: %s" % updatelist, 1)
total = len(updatelist)
if pdialog:
@ -1161,13 +1144,13 @@ class ManualSync(LibrarySync):
if kodimovie not in all_embymoviesIds:
movies.remove(kodimovie)
else:
self.logMsg("Movies compare finished.", 1)
log("Movies compare finished.", 1)
for boxset in all_kodisets:
if boxset not in all_embyboxsetsIds:
movies.remove(boxset)
else:
self.logMsg("Boxsets compare finished.", 1)
log("Boxsets compare finished.", 1)
return True
@ -1178,7 +1161,7 @@ class ManualSync(LibrarySync):
mvideos = itemtypes.MusicVideos(embycursor, kodicursor)
views = emby_db.getView_byType('musicvideos')
self.logMsg("Media folders: %s" % views, 1)
log("Media folders: %s" % views, 1)
# Pull the list of musicvideos in Kodi
try:
@ -1201,7 +1184,7 @@ class ManualSync(LibrarySync):
if pdialog:
pdialog.update(
heading="Emby for Kodi",
message="%s %s..." % (utils.language(33028), viewName))
message="%s %s..." % (lang(33028), viewName))
all_embymvideos = self.emby.getMusicVideos(viewId, basic=True, dialog=pdialog)
for embymvideo in all_embymvideos['Items']:
@ -1218,7 +1201,7 @@ class ManualSync(LibrarySync):
# Only update if musicvideo is not in Kodi or checksum is different
updatelist.append(itemid)
self.logMsg("MusicVideos to update for %s: %s" % (viewName, updatelist), 1)
log("MusicVideos to update for %s: %s" % (viewName, updatelist), 1)
embymvideos = self.emby.getFullItems(updatelist)
total = len(updatelist)
del updatelist[:]
@ -1245,20 +1228,19 @@ class ManualSync(LibrarySync):
if kodimvideo not in all_embymvideosIds:
mvideos.remove(kodimvideo)
else:
self.logMsg("MusicVideos compare finished.", 1)
log("MusicVideos compare finished.", 1)
return True
def tvshows(self, embycursor, kodicursor, pdialog):
lang = utils.language
# Get shows from emby
emby_db = embydb.Embydb_Functions(embycursor)
tvshows = itemtypes.TVShows(embycursor, kodicursor)
views = emby_db.getView_byType('tvshows')
views += emby_db.getView_byType('mixed')
self.logMsg("Media folders: %s" % views, 1)
log("Media folders: %s" % views, 1)
# Pull the list of tvshows and episodes in Kodi
try:
@ -1305,7 +1287,7 @@ class ManualSync(LibrarySync):
# Only update if movie is not in Kodi or checksum is different
updatelist.append(itemid)
self.logMsg("TVShows to update for %s: %s" % (viewName, updatelist), 1)
log("TVShows to update for %s: %s" % (viewName, updatelist), 1)
embytvshows = self.emby.getFullItems(updatelist)
total = len(updatelist)
del updatelist[:]
@ -1349,7 +1331,7 @@ class ManualSync(LibrarySync):
# Only update if movie is not in Kodi or checksum is different
updatelist.append(itemid)
self.logMsg("Episodes to update for %s: %s" % (viewName, updatelist), 1)
log("Episodes to update for %s: %s" % (viewName, updatelist), 1)
embyepisodes = self.emby.getFullItems(updatelist)
total = len(updatelist)
del updatelist[:]
@ -1374,13 +1356,13 @@ class ManualSync(LibrarySync):
if koditvshow not in all_embytvshowsIds:
tvshows.remove(koditvshow)
else:
self.logMsg("TVShows compare finished.", 1)
log("TVShows compare finished.", 1)
for kodiepisode in all_kodiepisodes:
if kodiepisode not in all_embyepisodesIds:
tvshows.remove(kodiepisode)
else:
self.logMsg("Episodes compare finished.", 1)
log("Episodes compare finished.", 1)
return True
@ -1421,7 +1403,7 @@ class ManualSync(LibrarySync):
if pdialog:
pdialog.update(
heading="Emby for Kodi",
message="%s %s..." % (utils.language(33031), data_type))
message="%s %s..." % (lang(33031), data_type))
if data_type != "artists":
all_embyitems = process[data_type][0](basic=True, dialog=pdialog)
else:
@ -1446,7 +1428,7 @@ class ManualSync(LibrarySync):
if all_kodisongs.get(itemid) != API.getChecksum():
# Only update if songs is not in Kodi or checksum is different
updatelist.append(itemid)
self.logMsg("%s to update: %s" % (data_type, updatelist), 1)
log("%s to update: %s" % (data_type, updatelist), 1)
embyitems = self.emby.getFullItems(updatelist)
total = len(updatelist)
del updatelist[:]
@ -1467,15 +1449,15 @@ class ManualSync(LibrarySync):
if kodiartist not in all_embyartistsIds and all_kodiartists[kodiartist] is not None:
music.remove(kodiartist)
else:
self.logMsg("Artist compare finished.", 1)
log("Artist compare finished.", 1)
for kodialbum in all_kodialbums:
if kodialbum not in all_embyalbumsIds:
music.remove(kodialbum)
else:
self.logMsg("Albums compare finished.", 1)
log("Albums compare finished.", 1)
for kodisong in all_kodisongs:
if kodisong not in all_embysongsIds:
music.remove(kodisong)
else:
self.logMsg("Songs compare finished.", 1)
return True
log("Songs compare finished.", 1)
return True