mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
additional fix to prevent doubled updated
This commit is contained in:
parent
ae06548c9d
commit
79644ca3e8
2 changed files with 10 additions and 0 deletions
|
@ -2191,9 +2191,18 @@ class Music(Items):
|
||||||
return
|
return
|
||||||
|
|
||||||
if mediatype == "song":
|
if mediatype == "song":
|
||||||
|
|
||||||
|
#should we ignore this item ?
|
||||||
|
#happens when userdata updated by ratings method
|
||||||
|
if utils.window("ignore-update-%s" %itemid):
|
||||||
|
utils.window("ignore-update-%s" %itemid,clear=True)
|
||||||
|
return
|
||||||
|
|
||||||
# Process playstates
|
# Process playstates
|
||||||
playcount = userdata['PlayCount']
|
playcount = userdata['PlayCount']
|
||||||
dateplayed = userdata['LastPlayedDate']
|
dateplayed = userdata['LastPlayedDate']
|
||||||
|
|
||||||
|
#process item ratings
|
||||||
rating, comment, hasEmbeddedCover = musicutils.getAdditionalSongTags(itemid, rating, API, kodicursor, emby_db, self.enableimportsongrating, self.enableexportsongrating, self.enableupdatesongrating)
|
rating, comment, hasEmbeddedCover = musicutils.getAdditionalSongTags(itemid, rating, API, kodicursor, emby_db, self.enableimportsongrating, self.enableexportsongrating, self.enableupdatesongrating)
|
||||||
|
|
||||||
query = "UPDATE song SET iTimesPlayed = ?, lastplayed = ?, rating = ? WHERE idSong = ?"
|
query = "UPDATE song SET iTimesPlayed = ?, lastplayed = ?, rating = ? WHERE idSong = ?"
|
||||||
|
|
|
@ -165,6 +165,7 @@ def getAdditionalSongTags(embyid, emby_rating, API, kodicursor, emby_db, enablei
|
||||||
if updateEmbyRating and enableexportsongrating:
|
if updateEmbyRating and enableexportsongrating:
|
||||||
# sync details to emby server. Translation needed between ID3 rating and emby likes/favourites:
|
# sync details to emby server. Translation needed between ID3 rating and emby likes/favourites:
|
||||||
like, favourite, deletelike = getEmbyRatingFromKodiRating(rating)
|
like, favourite, deletelike = getEmbyRatingFromKodiRating(rating)
|
||||||
|
utils.window("ignore-update-%s" %embyid, "true") #set temp windows prop to ignore the update from webclient update
|
||||||
API.updateUserRating(embyid, like, favourite, deletelike)
|
API.updateUserRating(embyid, like, favourite, deletelike)
|
||||||
|
|
||||||
return (rating, comment, hasEmbeddedCover)
|
return (rating, comment, hasEmbeddedCover)
|
||||||
|
|
Loading…
Reference in a new issue