Skip to content

Commit

Permalink
release: v1.56.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Jan 1, 2024
1 parent 5165c58 commit 3ac201c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* [v1.56.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.56.0):
* Remember last selected result until the list changes
* Increase cache size

* [v1.55.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.55.0):
* Proper fix for Dolby Vision detection and other result title clean improvements

Expand Down
8 changes: 7 additions & 1 deletion a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2326,7 +2326,7 @@ def play(core, params):
season_results = None
pack_results = None

while len(last_results) > 10:
while len(last_results) > 20:
oldest_key = list(last_results.keys())[0]
for key in last_results:
if last_results[key]['time'] < last_results[oldest_key]['time']:
Expand Down Expand Up @@ -2389,6 +2389,11 @@ def sorter():
autoplay = core.kodi.get_bool_setting('general.autoplay') and not params.force_sourceselect

selection = 1
last_selected_result = core.cache.get_last_selected_result()
result_keys_hash = core.utils.hash_data(''.join(results_keys))
if result_keys_hash in last_selected_result:
selection = last_selected_result[result_keys_hash]

label .selection # type: ignore # noqa: F821
if not autoplay:
selection = core.kodi.xbmcgui.Dialog().select(
Expand All @@ -2415,6 +2420,7 @@ def sorter():
core.cache.save_general(general)
return play(core, params)
else:
core.cache.save_last_selected_result({ result_keys_hash: selection })
selection -= 1

label .afterselection # type: ignore # noqa: F821
Expand Down
6 changes: 6 additions & 0 deletions a4kStreaming/lib/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
__provider_filepath = os.path.join(kodi.addon_profile, 'provider.json')
__last_results_filepath = os.path.join(kodi.addon_profile, 'last_results.json')
__last_title_filepath = os.path.join(kodi.addon_profile, 'last_title.json')
__last_selected_result_filepath = os.path.join(kodi.addon_profile, 'last_selected_result.json')
__general_filepath = os.path.join(kodi.addon_profile, 'general.json')

def __get_cache(filepath):
Expand Down Expand Up @@ -46,6 +47,11 @@ def save_last_title(data):
def get_last_title():
return __get_cache(__last_title_filepath)

def save_last_selected_result(data):
return __save_cache(__last_selected_result_filepath, data)
def get_last_selected_result():
return __get_cache(__last_selected_result_filepath)

def save_general(data):
return __save_cache(__general_filepath, data)
def get_general():
Expand Down
4 changes: 4 additions & 0 deletions a4kStreaming/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import shutil
import time
import base64
import hashlib
from datetime import datetime
from io import BytesIO
from itertools import islice
Expand Down Expand Up @@ -847,3 +848,6 @@ def sanitize_response(response):
response[key] = sanitize_response(response[key])

return response

def hash_data(data):
return hashlib.sha256(data.encode(default_encoding)).hexdigest()
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.55.0"
version="1.56.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.56.0]:
* Remember last selected result until the list changes
* Increase cache size

[v1.55.0]:
* Proper fix for Dolby Vision detection and other result title clean improvements

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.55.0"
version="1.56.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.56.0]:
* Remember last selected result until the list changes
* Increase cache size

[v1.55.0]:
* Proper fix for Dolby Vision detection and other result title clean improvements

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

0 comments on commit 3ac201c

Please sign in to comment.