Skip to content

Commit

Permalink
Merge pull request #563 from quickmic/next-gen-dev-python3
Browse files Browse the repository at this point in the history
11.1.19, review changelog for details
  • Loading branch information
quickmic authored Jan 13, 2025
2 parents ff3c405 + d2914f9 commit 60a186d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8' standalone="yes"?>
<addon id="plugin.service.emby-next-gen" name="Emby for Kodi Next Gen" version="11.1.18" provider-name="quickmic">
<addon id="plugin.service.emby-next-gen" name="Emby for Kodi Next Gen" version="11.1.19" provider-name="quickmic">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.dateutil" version="2.8.1" />
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
11.1.19
=============
fix multiversion update issue



11.1.18
=============
Fix movie update issue
Expand Down
2 changes: 1 addition & 1 deletion core/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def change(self, Item, IncrementalSync):
DelteItem = {'KodiFileId': Movieversion[1], 'KodiItemId': Movieversion[2], 'Id': Movieversion[0], 'KodiPathId': Movieversion[3], 'LibraryId': Item['LibraryId']}
self.remove(DelteItem, False)

Item['UpdateItem'] = False
Item['UpdateItem'] = False

common.set_trailer(Item, self.EmbyServer)
common.set_RunTimeTicks(Item)
Expand Down
15 changes: 12 additions & 3 deletions database/emby_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,11 +1318,20 @@ def add_multiversion(self, item, EmbyType, API, SQLs, ServerId):

if SQLs['video']: # video otherwise unsynced content e.g. specials
if EmbyType == "Episode":
SQLs['video'].delete_episode(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], KodiIds[7]) # KodiIds[7] = KodiPathId
if KodiIds[7] != item['KodiPathId']: # KodiIds[7] = KodiPathId
SQLs['video'].delete_episode(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], KodiIds[7])
else: # Do not delete path if default item path matches sub item path
SQLs['video'].delete_episode(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], None)
elif EmbyType in ("Movie", "Video"):
SQLs['video'].delete_movie(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], KodiIds[6]) # KodiIds[6] = KodiPathId
if KodiIds[6] != item['KodiPathId']: # KodiIds[6] = KodiPathId
SQLs['video'].delete_movie(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], KodiIds[6])
else: # Do not delete path if default item path matches sub item path
SQLs['video'].delete_movie(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], None)
elif EmbyType == "MusicVideo":
SQLs['video'].delete_musicvideos(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], KodiIds[6]) # KodiIds[6] = KodiPathId
if KodiIds[6] != item['KodiPathId']: # KodiIds[6] = KodiPathId
SQLs['video'].delete_musicvideos(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], KodiIds[6])
else: # Do not delete path if default item path matches sub item path
SQLs['video'].delete_musicvideos(ItemReferenced['KodiItemId'], ItemReferenced['KodiFileId'], None)

# Add references
ItemReferenced = item.copy()
Expand Down
8 changes: 6 additions & 2 deletions database/video_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def delete_movie(self, KodiItemId, KodiFileId, KodiPathId):
self.cursor.execute("DELETE FROM files WHERE idFile = ?", (KodiFileId,))
self.cursor.execute("DELETE FROM movielinktvshow WHERE idMovie = ?", (KodiItemId,))
self.cursor.execute("DELETE FROM videoversion WHERE idFile = ?", (KodiFileId,))
self.cursor.execute("DELETE FROM path WHERE idPath = ?", (KodiPathId,))

if KodiPathId:
self.cursor.execute("DELETE FROM path WHERE idPath = ?", (KodiPathId,))

def get_movie_metadata_for_listitem(self, KodiItemId, PathAndFilename):
self.cursor.execute("SELECT * FROM movie_view WHERE idMovie = ?", (KodiItemId,))
Expand Down Expand Up @@ -244,7 +246,9 @@ def create_entry_musicvideos(self):
def delete_musicvideos(self, KodiItemId, KodiFileId, KodiPathId):
self.cursor.execute("DELETE FROM musicvideo WHERE idMVideo = ?", (KodiItemId,))
self.cursor.execute("DELETE FROM files WHERE idFile = ?", (KodiFileId,))
self.cursor.execute("DELETE FROM path WHERE idPath = ?", (KodiPathId,))

if KodiPathId:
self.cursor.execute("DELETE FROM path WHERE idPath = ?", (KodiPathId,))

def get_musicvideos_metadata_for_listitem(self, KodiItemId, PathAndFilename):
self.cursor.execute("SELECT * FROM musicvideo_view WHERE idMVideo = ?", (KodiItemId,))
Expand Down

0 comments on commit 60a186d

Please sign in to comment.