Skip to content

Commit

Permalink
Merge pull request #544 from quickmic/next-gen-dev-python3
Browse files Browse the repository at this point in the history
10.0.46, review changelog for details
  • Loading branch information
quickmic authored Aug 3, 2024
2 parents 5efcb41 + 8ca1ff9 commit 35ff53a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 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="10.0.45" provider-name="quickmic">
<addon id="plugin.service.emby-next-gen" name="Emby for Kodi Next Gen" version="10.0.46" provider-name="quickmic">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.dateutil" version="2.8.1" />
Expand Down
18 changes: 18 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
10.0.46
=============
fix multiversion content assinged to collection
fix Windows specific connection issues



10.0.45
=============
fix dynamic node recommended (double items)
fix upcoming dynamic node when not item name is reported
fix soundtrack tagged as compilation
add context menu refresh option for seasons and series
add config redirect from helper plugin
fix boxset/collection updates



10.0.44
=============
fix init sync for records when recording in progress
Expand Down
5 changes: 3 additions & 2 deletions core/boxsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def change(self, Item):
# Query assigned content for collections
ContentsAssignedToBoxset = []

for ContentAssignedToBoxset in self.EmbyServer.API.get_Items(Item['Id'], ["All"], True, True, {'GroupItemsIntoCollections': True}, "", False):
for ContentAssignedToBoxset in self.EmbyServer.API.get_Items(Item['Id'], ["All"], True, True, {'GroupItemsIntoCollections': True, "Fields": "PresentationUniqueKey"}, "", False):
ContentsAssignedToBoxset.append(ContentAssignedToBoxset)

# Add new collection tag
Expand Down Expand Up @@ -47,7 +47,8 @@ def change(self, Item):
continue

ContentAssignedToBoxset.update({'KodiItemId': Item['KodiItemId']})
ContentItemKodiId = self.SQLs["emby"].get_KodiId_by_EmbyId_EmbyType(ContentAssignedToBoxset['Id'], ContentAssignedToBoxset['Type'])
common.set_PresentationUniqueKey(ContentAssignedToBoxset)
ContentItemKodiId = self.SQLs["emby"].get_KodiId_by_EmbyPresentationKey(ContentAssignedToBoxset['Type'], ContentAssignedToBoxset['PresentationUniqueKey'])

if ContentAssignedToBoxset['Type'] in ("Movie", "Video") and ContentItemKodiId:
if str(ContentItemKodiId) in CurrentBoxSetContent:
Expand Down
13 changes: 8 additions & 5 deletions database/emby_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def get_AudioStreams(self, EmbyId, MediaIndex):
# Mapping
def get_embypresentationkey_by_id_embytype(self, EmbyId, Tables):
for Table in Tables:
self.cursor.execute(f"SELECT EmbyPresentationKey FROM {Table} WHERE EmbyId = ?", (EmbyId,))
self.cursor.execute(f"SELECT EmbyPresentationKey FROM {Table} WHERE EmbyId = ?", (EmbyId,))
Data = self.cursor.fetchone()

if Data:
Expand Down Expand Up @@ -884,11 +884,14 @@ def remove_item_multi_db(self, EmbyId, KodiId, EmbyType, EmbyLibraryId, LibraryI
self.cursor.execute(f"UPDATE {EmbyType} SET KodiId = ?, LibraryIds = ? WHERE EmbyId = ?", (KodiId, LibraryIds, EmbyId))

def get_KodiId_by_EmbyPresentationKey(self, EmbyType, EmbyPresentationKey):
self.cursor.execute(f"SELECT KodiId FROM {EmbyType} WHERE EmbyPresentationKey = ?", (EmbyPresentationKey,))
Data = self.cursor.fetchone()
if EmbyPresentationKey:
self.cursor.execute(f"SELECT KodiId FROM {EmbyType} WHERE EmbyPresentationKey = ?", (EmbyPresentationKey,))
KodiIds = self.cursor.fetchall()

if Data:
return Data[0]
if KodiIds:
for KodiId in KodiIds:
if KodiId[0]:
return KodiId[0]

return None

Expand Down
4 changes: 2 additions & 2 deletions emby/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def socket_open(self, ConnectionString, ConnectionId):
if StatusCodeSocket:
return StatusCodeSocket

if str(error) == "timed out": # workaround when TimeoutError not raised
if str(error).find("timed out") != -1: # workaround when TimeoutError not raised
if RetryCounter <= 10:
continue

Expand Down Expand Up @@ -312,7 +312,7 @@ def socket_io(self, Request, ConnectionId, Timeout):
StatusCode = 605
break
except Exception as error:
if str(error) == "timed out": # workaround when TimeoutError not raised
if str(error).find("timed out") != -1: # workaround when TimeoutError not raised
if not Timeout or (ConnectionId != "MAIN" and self.SocketBusy["MAIN"].locked()): # Websocket or binary -> wait longer for e.g. images. MAIN queries could block IO
continue

Expand Down

0 comments on commit 35ff53a

Please sign in to comment.