Skip to content

Commit

Permalink
9.4.20, review changelog for details
Browse files Browse the repository at this point in the history
  • Loading branch information
quickmic committed Mar 18, 2024
1 parent 59fb9a1 commit a6372ad
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 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.19" provider-name="quickmic, angelblue05, sualfred">
<addon id="plugin.video.emby-next-gen" name="Emby for Kodi Next Gen" version="9.4.20" 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
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
9.4.20
=============
fix 'FreeTypeFont' object has no attribute 'getsize' -> python pillow api change
fix playertracker issue
fix library removal issue for edge case
fix player crash


9.4.19
=============
fix Studio sync issue
Expand Down
4 changes: 4 additions & 0 deletions core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
}

def load_ExistingItem(Item, EmbyServer, emby_db, EmbyType):
if Item['LibraryId'] not in EmbyServer.library.WhitelistUnique:
xbmc.log(f"EMBY.core.common: Libray not synced: {Item['LibraryId']}", 3) # LOGERROR
return False

ExistingItem = emby_db.get_item_by_id(Item['Id'], EmbyType)
ForceNew = False

Expand Down
16 changes: 8 additions & 8 deletions helper/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ def PlayerCommands():

pluginmenu.QueryCache["Video"]["Theme"] = [True, ((FullPath, ListItem, False), )]

if isTheme:
globals()["QueuedPlayingItem"] = [{'CanSeek': True, 'QueueableMediaTypes': "Video,Audio", 'IsPaused': False, 'ItemId': int(EmbyId), 'MediaSourceId': None, 'PlaySessionId': str(uuid.uuid4()).replace("-", ""), 'PositionTicks': 0, 'RunTimeTicks': 0, 'VolumeLevel': Volume, 'IsMuted': Muted}, None, None, None, utils.EmbyServers[ServerId]]
if utils.XbmcPlayer.isPlaying():
utils.XbmcPlayer.updateInfoTag(ListItem)
else:
xbmc.log("EMBY.helper.player: XbmcPlayer not playing 2", 3) # LOGERROR
continue

if utils.XbmcPlayer.isPlaying():
utils.XbmcPlayer.updateInfoTag(ListItem)
else:
xbmc.log("EMBY.helper.player: XbmcPlayer not playing 2", 3) # LOGERROR
continue
if isTheme:
globals()["QueuedPlayingItem"] = [{'CanSeek': True, 'QueueableMediaTypes': "Video,Audio", 'IsPaused': False, 'ItemId': int(EmbyId), 'MediaSourceId': None, 'PlaySessionId': str(uuid.uuid4()).replace("-", ""), 'PositionTicks': 0, 'RunTimeTicks': 0, 'VolumeLevel': Volume, 'IsMuted': Muted}, None, None, None, utils.EmbyServers[ServerId]]
else:
KodiId = EventData['item']['id']
KodiType = EventData['item']['type']
Expand Down Expand Up @@ -509,7 +509,7 @@ def PositionTracker():

while PlayingItem[0] and not utils.SystemShutdown:
if not utils.sleep(1):
if PlayBackEnded:
if PlayBackEnded or not PlayingItem[0]:
break

Position = int(playerops.PlayBackPosition())
Expand Down
20 changes: 10 additions & 10 deletions helper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,21 @@ def image_overlay(ImageTag, ServerId, EmbyID, ImageType, ImageIndex, OverlayText
img = Image.open(io.BytesIO(BinaryData))
ImageWidth, ImageHeight = img.size
draw = ImageDraw.Draw(img, "RGBA")
BoxY = int(ImageHeight * 0.9)
BorderSize = int(ImageHeight * 0.01)
fontsize = 1
BorderSize = int(ImageHeight * 0.01) # 1% of image height is box border size
BoxTop = int(ImageHeight * 0.75) # Box top position is 75% of image height
BoxHeight = int(ImageHeight * 0.15) # 15% of image height is box height
BoxWidth = int(ImageWidth - 2 * BorderSize)
fontsize = 5
font = ImageFont.truetype(FontPath, 1)
_, _, FontWidth, FontHeight = font.getbbox("Title Seauence")

#Use longest possible text to determine font width
ImageWidthMod = ImageHeight / 3 * 4

while font.getsize("Title Sequence")[0] < 0.80 * ImageWidthMod and font.getsize("Title Sequence")[1] < 0.80 * BoxY:
while FontHeight < BoxHeight - BorderSize * 2 and FontWidth < BoxWidth - BorderSize * 2:
fontsize += 1
font = ImageFont.truetype(FontPath, fontsize)
_, _, FontWidth, FontHeight = font.getbbox("Title Seauence")

FontSizeY = font.getsize(OverlayText)[1]
draw.rectangle((-BorderSize, BoxY - FontSizeY, ImageWidth + BorderSize, BoxY), fill=(0, 0, 0, 127), outline="white", width=BorderSize)
draw.text(xy=(ImageWidth / 2, BoxY - FontSizeY / 2), text=OverlayText, fill="#FFFFFF", font=font, anchor="mm", align="center")
draw.rectangle((-BorderSize, BoxTop - BorderSize, BoxWidth + BorderSize * 2, BoxTop + BoxHeight + BorderSize * 2), fill=(0, 0, 0, 127), outline="white", width=BorderSize)
draw.text(xy=(ImageWidth / 2, BoxTop + BorderSize * 2 + FontHeight / 2), text=OverlayText, fill="#FFFFFF", font=font, anchor="mm", align="center")
imgByteArr = io.BytesIO()
img.save(imgByteArr, format=img.format)
return imgByteArr.getvalue(), "image/jpeg"
Expand Down

0 comments on commit a6372ad

Please sign in to comment.