Simplify remove function calls

This commit is contained in:
Matt 2020-03-28 23:37:07 -04:00
parent a96877f34d
commit e414e28157
2 changed files with 4 additions and 7 deletions

View file

@ -530,15 +530,14 @@ class FullSync(object):
default_args = (self.server, jellyfindb, kodidb, direct_path) default_args = (self.server, jellyfindb, kodidb, direct_path)
for item in items: for item in items:
if item[1] in ('Series', 'Season', 'Episode'): if item[1] in ('Series', 'Season', 'Episode'):
obj = TVShows(*default_args).remove TVShows(*default_args).remove(item[0])
elif item[1] in ('Movie', 'BoxSet'): elif item[1] in ('Movie', 'BoxSet'):
obj = Movies(*default_args).remove Movies(*default_args).remove(item[0])
elif item[1] in ('MusicAlbum', 'MusicArtist', 'AlbumArtist', 'Audio'): elif item[1] in ('MusicAlbum', 'MusicArtist', 'AlbumArtist', 'Audio'):
obj = Music(*default_args).remove Music(*default_args).remove(item[0])
elif item[1] == 'MusicVideo': elif item[1] == 'MusicVideo':
obj = MusicVideos(*default_args).remove MusicVideos(*default_args).remove(item[0])
obj(item[0])
dialog.update(int((float(count) / float(len(items)) * 100)), heading="%s: %s" % (translate('addon_name'), library[0])) dialog.update(int((float(count) / float(len(items)) * 100)), heading="%s: %s" % (translate('addon_name'), library[0]))
count += 1 count += 1
@ -551,7 +550,6 @@ class FullSync(object):
self.sync['Whitelist'].remove('Mixed:%s' % library_id) self.sync['Whitelist'].remove('Mixed:%s' % library_id)
save_sync(self.sync) save_sync(self.sync)
xbmc.executebuiltin('ReloadSkin()')
def __exit__(self, exc_type, exc_val, exc_tb): def __exit__(self, exc_type, exc_val, exc_tb):

View file

@ -46,7 +46,6 @@ class Monitor(xbmc.Monitor):
LOG.info("-->[ kodi scan/%s ]", library) LOG.info("-->[ kodi scan/%s ]", library)
def onScanFinished(self, library): def onScanFinished(self, library):
xbmc.executebuiltin("ReloadSkin()")
LOG.info("--<[ kodi scan/%s ]", library) LOG.info("--<[ kodi scan/%s ]", library)
def onNotification(self, sender, method, data): def onNotification(self, sender, method, data):