mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Failsafe incase view is named after existing tag
After the initial sync already completed.
This commit is contained in:
parent
77dd006f21
commit
b61b8ae894
1 changed files with 42 additions and 16 deletions
|
@ -852,6 +852,7 @@ class Kodidb_Functions():
|
|||
|
||||
if self.kodiversion in (15, 16):
|
||||
# Kodi Isengard, Jarvis
|
||||
try:
|
||||
query = ' '.join((
|
||||
|
||||
"UPDATE tag_link",
|
||||
|
@ -861,8 +862,21 @@ class Kodidb_Functions():
|
|||
"AND tag_id = ?"
|
||||
))
|
||||
cursor.execute(query, (newtag, kodiid, mediatype, oldtag,))
|
||||
except Exception as e:
|
||||
# The new tag we are going to apply already exists for this item
|
||||
# delete current tag instead
|
||||
self.logMsg("Exception: %s" % e, 1)
|
||||
query = ' '.join((
|
||||
|
||||
"DELETE FROM tag_link",
|
||||
"WHERE media_id = ?",
|
||||
"AND media_type = ?",
|
||||
"AND tag_id = ?"
|
||||
))
|
||||
cursor.execute(query, (kodiid, mediatype, oldtag,))
|
||||
else:
|
||||
# Kodi Helix
|
||||
try:
|
||||
query = ' '.join((
|
||||
|
||||
"UPDATE taglinks",
|
||||
|
@ -872,6 +886,18 @@ class Kodidb_Functions():
|
|||
"AND idTag = ?"
|
||||
))
|
||||
cursor.execute(query, (newtag, kodiid, mediatype, oldtag,))
|
||||
except Exception as e:
|
||||
# The new tag we are going to apply already exists for this item
|
||||
# delete current tag instead
|
||||
self.logMsg("Exception: %s" % e, 1)
|
||||
query = ' '.join((
|
||||
|
||||
"DELETE FROM taglinks",
|
||||
"WHERE idMedia = ?",
|
||||
"AND media_type = ?",
|
||||
"AND idTag = ?"
|
||||
))
|
||||
cursor.execute(query, (kodiid, mediatype, oldtag,))
|
||||
|
||||
def removeTag(self, kodiid, tagname, mediatype):
|
||||
|
||||
|
|
Loading…
Reference in a new issue