Music: do not sync obsolete artwork
This commit is contained in:
parent
4b9fda9e81
commit
4da58d72dd
2 changed files with 8 additions and 41 deletions
|
@ -172,16 +172,6 @@ class Artist(MusicMixin, ItemBase):
|
||||||
|
|
||||||
if app.SYNC.artwork:
|
if app.SYNC.artwork:
|
||||||
artworks = api.artwork()
|
artworks = api.artwork()
|
||||||
if 'poster' in artworks:
|
|
||||||
thumb = "<thumb>%s</thumb>" % artworks['poster']
|
|
||||||
else:
|
|
||||||
thumb = None
|
|
||||||
if 'fanart' in artworks:
|
|
||||||
fanart = "<fanart>%s</fanart>" % artworks['fanart']
|
|
||||||
else:
|
|
||||||
fanart = None
|
|
||||||
else:
|
|
||||||
thumb, fanart = None, None
|
|
||||||
|
|
||||||
# UPDATE THE ARTIST #####
|
# UPDATE THE ARTIST #####
|
||||||
if update_item:
|
if update_item:
|
||||||
|
@ -196,7 +186,6 @@ class Artist(MusicMixin, ItemBase):
|
||||||
kodi_id = self.kodidb.add_artist(api.title(), musicBrainzId)
|
kodi_id = self.kodidb.add_artist(api.title(), musicBrainzId)
|
||||||
self.kodidb.update_artist(api.list_to_string(api.genres()),
|
self.kodidb.update_artist(api.list_to_string(api.genres()),
|
||||||
api.plot(),
|
api.plot(),
|
||||||
thumb,
|
|
||||||
timing.unix_date_to_kodi(self.last_sync),
|
timing.unix_date_to_kodi(self.last_sync),
|
||||||
kodi_id)
|
kodi_id)
|
||||||
if app.SYNC.artwork:
|
if app.SYNC.artwork:
|
||||||
|
@ -276,12 +265,6 @@ class Album(MusicMixin, ItemBase):
|
||||||
genre = api.list_to_string(api.genres())
|
genre = api.list_to_string(api.genres())
|
||||||
if app.SYNC.artwork:
|
if app.SYNC.artwork:
|
||||||
artworks = api.artwork()
|
artworks = api.artwork()
|
||||||
if 'poster' in artworks:
|
|
||||||
thumb = "<thumb>%s</thumb>" % artworks['poster']
|
|
||||||
else:
|
|
||||||
thumb = None
|
|
||||||
else:
|
|
||||||
thumb = None
|
|
||||||
|
|
||||||
# UPDATE THE ALBUM #####
|
# UPDATE THE ALBUM #####
|
||||||
if update_item:
|
if update_item:
|
||||||
|
@ -296,7 +279,6 @@ class Album(MusicMixin, ItemBase):
|
||||||
api.premiere_date(),
|
api.premiere_date(),
|
||||||
compilation,
|
compilation,
|
||||||
api.plot(),
|
api.plot(),
|
||||||
thumb,
|
|
||||||
api.list_to_string(api.studios()),
|
api.list_to_string(api.studios()),
|
||||||
api.userrating(),
|
api.userrating(),
|
||||||
timing.unix_date_to_kodi(self.last_sync),
|
timing.unix_date_to_kodi(self.last_sync),
|
||||||
|
@ -317,7 +299,6 @@ class Album(MusicMixin, ItemBase):
|
||||||
api.premiere_date(),
|
api.premiere_date(),
|
||||||
compilation,
|
compilation,
|
||||||
api.plot(),
|
api.plot(),
|
||||||
thumb,
|
|
||||||
api.list_to_string(api.studios()),
|
api.list_to_string(api.studios()),
|
||||||
api.userrating(),
|
api.userrating(),
|
||||||
timing.unix_date_to_kodi(self.last_sync),
|
timing.unix_date_to_kodi(self.last_sync),
|
||||||
|
|
|
@ -196,12 +196,11 @@ class KodiMusicDB(common.KodiDBBase):
|
||||||
strOrigReleaseDate,
|
strOrigReleaseDate,
|
||||||
bCompilation,
|
bCompilation,
|
||||||
strReview,
|
strReview,
|
||||||
strImage,
|
|
||||||
strLabel,
|
strLabel,
|
||||||
iUserrating,
|
iUserrating,
|
||||||
lastScraped,
|
lastScraped,
|
||||||
strReleaseType)
|
strReleaseType)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
''', (args))
|
''', (args))
|
||||||
else:
|
else:
|
||||||
args = list(args)
|
args = list(args)
|
||||||
|
@ -237,7 +236,6 @@ class KodiMusicDB(common.KodiDBBase):
|
||||||
strOrigReleaseDate = ?,
|
strOrigReleaseDate = ?,
|
||||||
bCompilation = ?,
|
bCompilation = ?,
|
||||||
strReview = ?,
|
strReview = ?,
|
||||||
strImage = ?,
|
|
||||||
strLabel = ?,
|
strLabel = ?,
|
||||||
iUserrating = ?,
|
iUserrating = ?,
|
||||||
lastScraped = ?,
|
lastScraped = ?,
|
||||||
|
@ -425,25 +423,13 @@ class KodiMusicDB(common.KodiDBBase):
|
||||||
|
|
||||||
@db.catch_operationalerrors
|
@db.catch_operationalerrors
|
||||||
def update_artist(self, *args):
|
def update_artist(self, *args):
|
||||||
if app.SYNC.artwork:
|
self.cursor.execute('''
|
||||||
self.cursor.execute('''
|
UPDATE artist
|
||||||
UPDATE artist
|
SET strGenres = ?,
|
||||||
SET strGenres = ?,
|
strBiography = ?,
|
||||||
strBiography = ?,
|
lastScraped = ?
|
||||||
strImage = ?,
|
WHERE idArtist = ?
|
||||||
lastScraped = ?
|
''', (args))
|
||||||
WHERE idArtist = ?
|
|
||||||
''', (args))
|
|
||||||
else:
|
|
||||||
args = list(args)
|
|
||||||
del args[3], args[2]
|
|
||||||
self.cursor.execute('''
|
|
||||||
UPDATE artist
|
|
||||||
SET strGenres = ?,
|
|
||||||
strBiography = ?,
|
|
||||||
lastScraped = ?
|
|
||||||
WHERE idArtist = ?
|
|
||||||
''', (args))
|
|
||||||
|
|
||||||
@db.catch_operationalerrors
|
@db.catch_operationalerrors
|
||||||
def remove_song(self, kodi_id):
|
def remove_song(self, kodi_id):
|
||||||
|
|
Loading…
Reference in a new issue