Skip to content

Commit

Permalink
9.4.21, review changelog for details
Browse files Browse the repository at this point in the history
  • Loading branch information
quickmic committed Apr 21, 2024
1 parent a6372ad commit b1f9dd8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 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.video.emby-next-gen" name="Emby for Kodi Next Gen" version="9.4.20" provider-name="quickmic, angelblue05, sualfred">
<addon id="plugin.video.emby-next-gen" name="Emby for Kodi Next Gen" version="9.4.21" provider-name="quickmic, angelblue05, sualfred">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.requests" version="2.22.0" />
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
9.4.21
=============
fix multiversion episode delete issue
fix strm file issue
fix websocket close issue


9.4.20
=============
fix 'FreeTypeFont' object has no attribute 'getsize' -> python pillow api change
Expand Down
7 changes: 3 additions & 4 deletions core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def get_path(Item, ServerId):
ForceNativeMode = False
KodiPathLower = Item['KodiPath'].lower()
Container = Item.get('Container', "")
Item['KodiFilteredFilename'] = utils.PathToFilenameReplaceSpecialCharecters(Item['KodiPath']).replace("-", "_").replace(" ", "_")

if Container == 'dvd':
Item['KodiPath'] += "/VIDEO_TS/"
Expand Down Expand Up @@ -251,10 +252,8 @@ def get_filename(Item, API):
if int(Item['SpecialFeatureCount']):
HasSpecials = "s"

FilteredFilename = utils.PathToFilenameReplaceSpecialCharecters(Item['Path']).replace("-", "_").replace(" ", "_")

if Item['Type'] == "Audio":
Item['KodiFilename'] = f"a-{Item['Id']}-{FilteredFilename}"
Item['KodiFilename'] = f"a-{Item['Id']}-{Item['KodiFilteredFilename']}"
return

VideoBitrate, VideoCodec = get_Bitrate_Codec(Item, "Video")
Expand All @@ -266,7 +265,7 @@ def get_filename(Item, API):
else:
IsRemote = "0"

Item['KodiFilename'] = f"{MediaID}-{Item['Id']}-{Item['MediaSources'][0]['Id']}-{Item['KodiItemId']}-{Item['KodiFileId']}-{Item['Streams'][0]['HasExternalSubtitle']}-{len(Item['MediaSources'])}-{Item['IntroStartPositionTicks']}-{Item['IntroEndPositionTicks']}-{Item['CreditsPositionTicks']}-{IsRemote}-{VideoCodec}-{VideoBitrate}-{AudioCodec}-{AudioBitrate}-{HasSpecials}-{FilteredFilename}"
Item['KodiFilename'] = f"{MediaID}-{Item['Id']}-{Item['MediaSources'][0]['Id']}-{Item['KodiItemId']}-{Item['KodiFileId']}-{Item['Streams'][0]['HasExternalSubtitle']}-{len(Item['MediaSources'])}-{Item['IntroStartPositionTicks']}-{Item['IntroEndPositionTicks']}-{Item['CreditsPositionTicks']}-{IsRemote}-{VideoCodec}-{VideoBitrate}-{AudioCodec}-{AudioBitrate}-{HasSpecials}-{Item['KodiFilteredFilename']}"
set_multipart(Item, API, MediaID)

# Detect Multipart videos
Expand Down
2 changes: 2 additions & 0 deletions database/emby_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,8 @@ def add_multiversion(self, item, EmbyType, API, SQLs):
xbmc.log(f"EMBY.database.emby_db: Multiversion video detected, referenced item not found: {DataSource['Id']}", 0) # LOGDEBUG
continue

common.get_PresentationUniqueKey(ItemReferenced)

if item['Id'] != ItemReferenced['Id']:
KodiIds = self.get_item_by_id(ItemReferenced['Id'], None)

Expand Down
8 changes: 4 additions & 4 deletions hooks/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ def close(self, Terminate=True):

if self.sock:
xbmc.log(f"Emby.hooks.websocket: Close connection {self.EmbyServer.ServerData['ServerId']} / {self.EmbyServer.ServerData['ServerName']}", 1) # LOGINFO
self.sock.settimeout(1)
self.sendCommands(struct.pack('!H', 1000), 0x8)

try:
self.sock.settimeout(1)
self.sendCommands(struct.pack('!H', 1000), 0x8)
self.sock.shutdown(_socket.SHUT_RDWR)
self.sock.close()
self.sock = None
except Exception as error:
xbmc.log(f"Emby.hooks.websocket: {error}", 3) # LOGERROR

self.sock.close()
self.sock = None
self._recv_buffer = ()
self._frame_header = None
self._frame_length = None
Expand Down

0 comments on commit b1f9dd8

Please sign in to comment.