Skip to content

Commit

Permalink
release: v1.37.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Dec 24, 2021
1 parent b5fc639 commit c9674dd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* [v1.37.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.37.0):
* .m2ts resolve support for RD

* [v1.36.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.36.0):
* Change RD resolve order

Expand Down
26 changes: 22 additions & 4 deletions a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2409,15 +2409,28 @@ def resolve_rd(resolve_files='videos'):

if resolve_files == 'videos':
title_name = provider_params.title.title.lower()
has_mt2s = False
for file_id in result['debrid_files'].keys():
file = result['debrid_files'][file_id]
is_video = core.os.path.splitext(file['filename'])[1].upper() in video_ext
ext = core.os.path.splitext(file['filename'])[1].upper()
is_video = ext in video_ext
if ext == '.M2TS':
has_mt2s = True
break
is_enough_size = int(file['filesize']) > size
is_sample = 'sample' not in title_name and 'sample' in file['filename'].lower()
if is_video and is_enough_size and not is_sample:
file_ids.append(file_id)
if len(file_ids) == len(all_files):
file_ids = []
if has_mt2s:
fsize = None
fid = None
for file_id in result['debrid_files'].keys():
file = result['debrid_files'][file_id]
if fsize is None or fsize < int(file['filesize']):
fsize = int(file['filesize'])
fid = file_id
if fid:
file_ids = [fid]

if result['ref'].mediatype == 'episode' and (len(file_ids) == 0 or resolve_files == 'exact'):
resolve_files = 'exact'
Expand Down Expand Up @@ -2448,7 +2461,12 @@ def resolve_rd(resolve_files='videos'):
if resolve_files == 'videos':
request = core.debrid.realdebrid_delete(auth, id)
core.request.execute(core, request)
return resolve_rd(resolve_files='all')
if len(file_ids) < len(all_files):
return resolve_rd(resolve_files='all')
elif result['ref'].mediatype == 'episode':
return resolve_rd(resolve_files='exact')
else:
return files
elif resolve_files == 'all' and result['ref'].mediatype == 'episode':
request = core.debrid.realdebrid_delete(auth, id)
core.request.execute(core, request)
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.36.0"
version="1.37.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.37.0]:
* .m2ts resolve support for RD

[v1.36.0]:
* Change RD resolve order

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.36.0"
version="1.37.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.37.0]:
* .m2ts resolve support for RD

[v1.36.0]:
* Change RD resolve order

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

0 comments on commit c9674dd

Please sign in to comment.