Skip to content

Commit

Permalink
release: v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Feb 3, 2021
1 parent dd43409 commit a6a39ed
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* [v1.5.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.5.0):
* When poster and thumb are the same use the same size for them
* Fix poster aspect ratio in some skins

* [v1.4.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.4.0):
* Fix titles do not have poster in AURA skin

Expand Down
3 changes: 2 additions & 1 deletion a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,11 @@ def __add_titles(core, titles, browse, silent=False):
poster_image = title.get('poster', None)
if poster_image:
poster_image = core.utils.fix_poster_size(poster_image)
thumb_image = core.utils.fix_thumb_size(primary_image) if primary_image else poster_image
else:
poster_image = core.utils.fix_poster_size(primary_image)
thumb_image = poster_image

thumb_image = core.utils.fix_thumb_size(primary_image) if primary_image else poster_image
fanart_image = title.get('fanart', None)
if fanart_image:
fanart_image = core.utils.fix_fanart_size(fanart_image)
Expand Down
18 changes: 8 additions & 10 deletions a4kStreaming/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,17 @@ def get_image_params(image, desired_width, desired_height):
target_width = desired_width if scaled_height >= desired_height else scaled_width
target_height = desired_height if scaled_width >= desired_width else scaled_height

if target_width < desired_width:
aspect_change = (width > height and desired_width < desired_height)
cx = 0

if aspect_change or target_width < desired_width or scaled_height < desired_height:
params = 'UY%s' % target_height
if aspect_change:
cx = (scaled_width - desired_width) / 2
else:
params = 'UX%s' % target_width

return '_V1_%s_CR0,0,%s,%s_AL_.' % (params, desired_width, desired_height)
return '_V1_%s_CR%s,0,%s,%s_AL_.' % (params, cx, desired_width, desired_height)

def fix_thumb_size(image):
if image and image.get('url', None):
Expand All @@ -419,14 +424,7 @@ def fix_fanart_size(image):

def fix_poster_size(image):
if image and image.get('url', None):
if not image.get('width', None) or not image.get('height', None):
params = get_image_params(image, 0, 0)
elif image['width'] < image['height']:
params = get_image_params(image, 528, 781)
else:
params = '_V1_UX528.'

return image['url'].replace('_V1_.', params)
return image['url'].replace('_V1_.', get_image_params(image, 528, 781))

def apply_viewtype(core):
kodi.xbmc.executebuiltin('Container.SetViewMode(%s)' % core.viewTypes[int(core.viewType)])
Expand Down
6 changes: 5 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.a4kstreaming"
name="a4kStreaming"
version="1.4.0"
version="1.5.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -32,6 +32,10 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.5.0]:
* When poster and thumb are the same use the same size for them
* Fix poster aspect ratio in some skins

[v1.4.0]:
* Fix titles do not have poster in AURA skin

Expand Down
6 changes: 5 additions & 1 deletion packages/addons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<addons>
<addon id="plugin.video.a4kstreaming"
name="a4kStreaming"
version="1.4.0"
version="1.5.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -35,6 +35,10 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.5.0]:
* When poster and thumb are the same use the same size for them
* Fix poster aspect ratio in some skins

[v1.4.0]:
* Fix titles do not have poster in AURA skin

Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fb663b8e0032990a256021e33b8e4410bb8eb32f
f225d90ec96787e9df68cc0f03d1a5e76cecb091

0 comments on commit a6a39ed

Please sign in to comment.