Skip to content

Commit

Permalink
release: v1.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Feb 13, 2021
1 parent 45e868a commit 8078313
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 6 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ignore =
E704,
E722,
E731,
F812,
F401,
W503,
W504,
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
* [v1.17.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.17.0):
* Support subtitles from Premiumize files browsing if located next to video file with same name

* [v1.16.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.16.0):
* New settings:
* Autoplay - instead of showing source select, auto choose the first source that resolves
* New context menu:
* Force source select - only available when Autoplay is enabled
* Add more episode auto selection checks
* Allow browsing cast and crew to find titles which they are known for. (This is new API which currently returns test results)
* Allow browsing cast and crew to find titles which they are known for (This is new API which currently returns test results)

* [v1.15.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.15.0):
* Add RD expired notification
Expand Down
10 changes: 10 additions & 0 deletions a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,20 @@ def cloud(core, params):

if file['type'] == 'file':
isvideo = core.os.path.splitext(file['name'])[1].upper() in video_ext
subfile = None

if isvideo:
filename_without_ext = core.os.path.splitext(file['name'])[0]
subfile_ext = ['srt', 'sub', 'ass', 'smi', 'ssa']
subfile_names = ['%s.%s' % (filename_without_ext, ext) for ext in subfile_ext]
subfiles = [file for file in files if any(subfile_name in file['name'] for subfile_name in subfile_names)]
subfile = next(iter(subfiles), None)

items.append({
'label': file['name'],
'subitems': False,
'url': file.get('link', file.get('stream_link', None)) if isvideo else '',
'subfile': subfile.get('link', None) if subfile else None,
'contextmenu': {
'Premiumize: Delete': 'RunPlugin(plugin://plugin.video.a4kstreaming/?action=cloud&type=premiumize_file_delete&id=%s)' % file['id']
}
Expand Down
1 change: 1 addition & 0 deletions a4kStreaming/lib/kodi_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def __add_directory_item(*args, **kwargs): return None
__listitem.setLabel = lambda _: None
__listitem.setCast = lambda _: None
__listitem.setRating = lambda n, r, v, d: None
__listitem.setSubtitles = lambda _: None
__listitem.addContextMenuItems = lambda _: None
__listitem.setContentLookup = lambda _: None
__listitem.addStreamInfo = lambda _, __: None
Expand Down
2 changes: 2 additions & 0 deletions a4kStreaming/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def generic_list_items(core, items):
url += '&%s=%s' % (param, params[param])

list_item.setContentLookup(False)
if item.get('subfile', None):
list_item.setSubtitles([item['subfile']])

context_menu_items = []
contextmenu = item.get('contextmenu', {})
Expand Down
7 changes: 5 additions & 2 deletions 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.16.0"
version="1.17.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -32,13 +32,16 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.17.0]:
* Support subtitles from Premiumize files browsing if located next to video file with same name

[v1.16.0]:
* New settings:
* Autoplay - instead of showing source select, auto choose the first source that resolves
* New context menu:
* Force source select - only available when Autoplay is enabled
* Add more episode auto selection checks
* Allow browsing cast and crew to find titles which they are known for. (This is new API which currently returns test results)
* Allow browsing cast and crew to find titles which they are known for (This is new API which currently returns test results)

[v1.15.0]:
* Add RD expired notification
Expand Down
7 changes: 5 additions & 2 deletions 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.16.0"
version="1.17.0"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand Down Expand Up @@ -35,13 +35,16 @@ Designed for low-end devices and Estuary skin.
<screenshot>screenshot-06.jpg</screenshot>
</assets>
<news>
[v1.17.0]:
* Support subtitles from Premiumize files browsing if located next to video file with same name

[v1.16.0]:
* New settings:
* Autoplay - instead of showing source select, auto choose the first source that resolves
* New context menu:
* Force source select - only available when Autoplay is enabled
* Add more episode auto selection checks
* Allow browsing cast and crew to find titles which they are known for. (This is new API which currently returns test results)
* Allow browsing cast and crew to find titles which they are known for (This is new API which currently returns test results)

[v1.15.0]:
* Add RD expired notification
Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f8c2f01c3e8253a38641bbaaefa3cc4b95b4e2db
0f2147345dd20d599bbe349266cbd04b2baa80ea
14 changes: 14 additions & 0 deletions tests/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,20 @@ def test_premiumize_files():

assert len(fn.results) > 0

result = [result for result in fn.results if 'aws' in result['label'].lower()][0]
fn = __invoke(a4kstreaming_api, 'cloud', { 'type': 'premiumize_files', 'id': result['params']['id'] })

assert len(fn.results) > 0

result = [result for result in fn.results if 'aws' in result['label'].lower()][0]
fn = __invoke(a4kstreaming_api, 'cloud', { 'type': 'premiumize_files', 'id': result['params']['id'] })

assert len(fn.results) > 0

fn = __invoke(a4kstreaming_api, 'cloud', { 'type': 'premiumize_files', 'id': fn.results[0]['params']['id'] })

assert len(fn.results) > 0

def test_premiumize_transfers():
a4kstreaming_api = api.A4kStreamingApi({'kodi': True})

Expand Down

0 comments on commit 8078313

Please sign in to comment.