Skip to content

Commit

Permalink
release: v1.34.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Nov 28, 2021
1 parent f1ae94e commit 9f96399
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* [v1.34.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.34.0):
* Add movie results max size filter

* [v1.33.1](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.33.1):
* Fix py3 issue

Expand Down
10 changes: 9 additions & 1 deletion a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,7 @@ def sorter():

results_keys = sorted(results_keys, key=sorter())

max_quality = int(core.kodi.get_setting('general.max_quality')) + 1
max_quality = core.kodi.get_int_setting('general.max_quality') + 1
quality_list = ['4K', '1080P', '720P', 'SD']
excluded_quality = quality_list[:len(quality_list) - max_quality]
if len(excluded_quality) > 0:
Expand All @@ -2310,6 +2310,14 @@ def sorter():
else:
core.kodi.notification('No results for specified quality. Showing all results.')

if provider_params.title.mediatype == 'movie':
max_movie_size = core.kodi.get_int_setting('general.max_movie_size')
results_keys_filtered = [key for key in results_keys if results[key]['size'] <= max_movie_size]
if len(results_keys_filtered) > 0:
results_keys = results_keys_filtered
else:
core.kodi.notification('No results for specified movie size. Showing all results.')

result_style = '[LIGHT]%s[/LIGHT]'
autoplay = core.kodi.get_bool_setting('general.autoplay') and not params.force_sourceselect

Expand Down
12 changes: 7 additions & 5 deletions a4kStreaming/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,17 @@ def __search(core, params):

use_recommended = core.kodi.get_bool_setting('provider.use_recommended')
recommended = core.utils.recommended
try:
source = core.importlib.import_module(__sources_module_name(core) + ('.%s' % recommended.lower()))
sources[recommended] = source.sources()
except: pass

if use_recommended:
try:
source = core.importlib.import_module(__sources_module_name(core) + ('.%s' % recommended.lower()))
sources[recommended] = source.sources()
except: pass

if len(sources) == 0 or not use_recommended:
use_recommended = False
for key in provider:
if not provider[key] or key == recommended:
if not provider[key] or sources.get(key, None):
continue

try:
Expand Down
5 changes: 4 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.33.1"
version="1.34.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -32,6 +32,9 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.34.0]:
* Add movie results max size filter

[v1.33.1]:
* Fix py3 issue

Expand Down
5 changes: 4 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.33.1"
version="1.34.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -35,6 +35,9 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.34.0]:
* Add movie results max size filter

[v1.33.1]:
* Fix py3 issue

Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
059eeb95c9894b50e059aa26893d6f08d2669a22
0133a8a6f1b2c51403ffc52ed28ffa88819d2fa0
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ msgctxt "#33107"
msgid "Episode title template"
msgstr ""

msgctxt "#33108"
msgid "Max movie size (GB)"
msgstr ""

# Season Title Templates
msgctxt "#33111"
msgid "Season 1 (2020) - 10 Episodes"
Expand Down
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- General -->
<category label="33001">
<setting id="general.max_quality" label="33101" type="enum" default="3" lvalues='33120|33121|33122|33123'/>
<setting id="general.max_movie_size" label="33108" type="slider" default="200" option="int" range="5,200"/>
<setting id="general.autoplay" label="33102" type="bool" default="false"/>
<setting id="general.mark_as_watched_rating" label="33103" type="slider" default="7" option="int" range="1,10"/>
<setting id="general.page_size" label="33104" type="slider" default="29" option="int" range="10,100"/>
Expand Down
1 change: 1 addition & 0 deletions tests/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __invoke(a4kstreaming_api, action, params={}, settings={}, prerun=None, remo
'general.lists_page_size': '29',
'general.season_title_template': '0',
'general.episode_title_template': '0',
'general.max_movie_size': '200',
'views.menu': '0',
'views.titles': '0',
'views.seasons': '0',
Expand Down

0 comments on commit 9f96399

Please sign in to comment.