Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.0.8+beta.1 #793

Merged
merged 39 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cd99592
Apply content type, category, and sort methods only when adding listi…
MoojMidge May 27, 2024
41fefce
Merge remote-tracking branch 'upstream/master'
MoojMidge May 27, 2024
e0b42c2
Fix My Subscriptions next page error #779
MoojMidge May 28, 2024
de6c286
Fix page jump when page_token is not used
MoojMidge May 28, 2024
407ec2c
Fix not reloading access manager when performing user actions #780
MoojMidge May 28, 2024
5569064
Misc tidy ups
MoojMidge May 28, 2024
3a75ec4
Set default value for data parameter of XbmcContext.send_notification
MoojMidge May 28, 2024
314b3f2
Fix incorrect comparison after cd45122
MoojMidge May 28, 2024
8b95bfd
Ensure container is always refreshed when required and available
MoojMidge May 28, 2024
4f2ad64
Don't use keyword blocking parameter for acquire of any threading object
MoojMidge May 28, 2024
15c740c
Only enable recommendations when logged in
MoojMidge May 28, 2024
cd6f370
Update icons
MoojMidge May 28, 2024
21735b3
Limit need to check window property for sleep and wakeup
MoojMidge May 28, 2024
f4c40d3
Rename XbmcContext.get_listitem_detail to XbmcContext.get_listitem_pr…
MoojMidge May 29, 2024
4ab2406
Improve sync with internal Kodi watched state #709
MoojMidge Jun 3, 2024
138800f
Attempt to fix PlaylistPlayer race condition error #704
MoojMidge May 29, 2024
d01e71d
Version bump v7.0.7.1
MoojMidge May 29, 2024
a7d9465
Use consistent return values for function cache to avoid caching erro…
MoojMidge May 31, 2024
ed7d818
Align default value for watched percentage with Kodi default #746
MoojMidge Jun 2, 2024
c167571
Allow for additional return data formats for Storage._get and Storage…
MoojMidge Jun 2, 2024
368b7c9
Improve handling of context menu play items
MoojMidge Jun 3, 2024
acf9a65
Allow for custom options to be returned from routes used in AbstractP…
MoojMidge Jun 3, 2024
ba82c30
Remove duplicate code for resolving first/only playable item in resul…
MoojMidge Jun 3, 2024
37ffb08
Check for allowable mediatype when setting value
MoojMidge Jun 3, 2024
ce05026
Enable action parameter in play playlist route
MoojMidge Jun 7, 2024
8681103
Allow XbmcContext.is_plugin_path to check multiple paths
MoojMidge Jun 7, 2024
bd0040b
Use new XbmcContext.is_plugin_path to check for search query route
MoojMidge Jun 7, 2024
24ae21d
Only show Next Page listitem linking to first page when opening listi…
MoojMidge Jun 7, 2024
ff0999c
Cache and update My Subscriptions content per channel feed #785 #786
MoojMidge Jun 8, 2024
2d5c503
Use separate database for My Subscription feed history #785
MoojMidge Jun 8, 2024
b456e66
Remove use of hardcoded sort order for itag formats
MoojMidge Jun 10, 2024
7bfb9a7
Consistent use of set for peephole optimisation to frozenset in multi…
MoojMidge Jun 10, 2024
010b5f3
Use constants for playback notification event names
MoojMidge Jun 10, 2024
ebcb57d
Wakeup http server on playback start if required #746
MoojMidge Jun 10, 2024
53bf137
Misc tidy ups
MoojMidge Jun 10, 2024
964c5bc
Fix using cached settings for XbmcContext.use_inputstream_adaptive
MoojMidge Jun 10, 2024
37724af
Use shortened YouTube url with external players for better compatibil…
MoojMidge Jun 11, 2024
b9af63c
Update selection and sorting of streams
MoojMidge Jun 12, 2024
19e1455
Version bump v7.0.8+beta.1
MoojMidge Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.youtube" name="YouTube" version="7.0.7" provider-name="anxdpanic, bromix, MoojMidge">
<addon id="plugin.video.youtube" name="YouTube" version="7.0.8+beta.1" provider-name="anxdpanic, bromix, MoojMidge">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.27.1"/>
Expand Down
28 changes: 27 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## v7.0.8+beta.1
### Fixed
- Update selection and sorting of streams to fix missing live streams
- Fix using cached settings for XbmcContext.use_inputstream_adaptive
- Wakeup http server on playback start if required #746
- Improve handling of context menu play items
- Use consistent return values for function cache to avoid caching errors #782
- Attempt to fix PlaylistPlayer race condition error #704
- Fix not reloading access manager when performing user actions #780
- Fix page jump when page_token is not used
- Ensure container is always refreshed when required and available
- Fix incorrect comparison after cd45122

### Changed
- Update icons
- Only enable recommendations when logged in
- Improve sync with internal Kodi watched state #709
- Align default value for watched percentage with Kodi default #746
- Limit need to check window property for sleep and wakeup
- Only show Next Page listitem linking to first page when opening listings from the GUI #787
- Use shortened YouTube url with external players for better compatibility with different types of videos

### New
- Cache and update My Subscriptions content per channel feed #785 #786
- Use separate database for My Subscription feed history #785
- Enable action parameter in play playlist route

## v7.0.7
### Fixed
- Fixed not being able to re-refresh a directory listing that has already been refreshed
Expand All @@ -22,7 +49,6 @@
- Improve resource usage
- Fix adding video to playlist #764
- Fix plugin settings raising exception in Kodi 19-20 #769
- Fix location icon background colour

### Changed
- Removed Settings > Advanced > Views > Show channel fanart
Expand Down
12 changes: 12 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -1552,3 +1552,15 @@ msgstr ""
msgctxt "#30811"
msgid "Filter Live folders"
msgstr ""

msgctxt "#30812"
msgid "Clear subscription feed history"
msgstr ""

msgctxt "#30813"
msgid "Delete subscription feed history database"
msgstr ""

msgctxt "#30814"
msgid "feed history"
msgstr ""
33 changes: 19 additions & 14 deletions resources/lib/youtube_plugin/kodion/abstract_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

class AbstractProvider(object):
RESULT_CACHE_TO_DISC = 'cache_to_disc' # (bool)
RESULT_UPDATE_LISTING = 'update_listing'
RESULT_FORCE_RESOLVE = 'force_resolve' # (bool)
RESULT_UPDATE_LISTING = 'update_listing' # (bool)

def __init__(self):
# map for regular expression (path) to method (names)
Expand Down Expand Up @@ -139,14 +140,14 @@ def navigate(self, context):
if not re_match:
continue

options = {
self.RESULT_CACHE_TO_DISC: True,
self.RESULT_UPDATE_LISTING: False,
}
result = method(context, re_match)
if isinstance(result, tuple):
result, options = result
else:
options = {
self.RESULT_CACHE_TO_DISC: True,
self.RESULT_UPDATE_LISTING: False,
}
result, new_options = result
options.update(new_options)

refresh = context.get_param('refresh')
if refresh is not None:
Expand Down Expand Up @@ -197,9 +198,12 @@ def _internal_goto_page(self, context, re_match):

path = re_match.group('path')
params = context.get_params()
page_token = NextPageItem.create_page_token(
page, params.get('items_per_page', 50)
)
if 'page_token' in params:
page_token = NextPageItem.create_page_token(
page, params.get('items_per_page', 50)
)
else:
page_token = ''
params = dict(params, page=page, page_token=page_token)
return self.reroute(context, path=path, params=params)

Expand All @@ -220,8 +224,8 @@ def reroute(self, context, re_match=None, path=None, params=None):
result, options = function_cache.run(
self.navigate,
seconds=None,
_cacheparams=function_cache.PARAMS_NONE,
_refresh=True,
_scope=function_cache.SCOPE_NONE,
context=context.clone(path, params),
)
finally:
Expand Down Expand Up @@ -277,13 +281,14 @@ def _internal_search(self, context, re_match):
if command == 'input':
data_cache = context.get_data_cache()

folder_path = context.get_infolabel('Container.FolderPath')
query = None
# came from page 1 of search query by '..'/back
# user doesn't want to input on this path
if (not params.get('refresh')
and folder_path.startswith('plugin://%s' % context.get_id())
and re.match('.+/(?:query|input)/.*', folder_path)):
and context.is_plugin_path(
context.get_infolabel('Container.FolderPath'),
('query', 'input')
)):
cached = data_cache.get_item('search_query', data_cache.ONE_DAY)
if cached:
query = to_unicode(cached)
Expand Down
30 changes: 30 additions & 0 deletions resources/lib/youtube_plugin/kodion/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,29 @@

ABORT_FLAG = 'abort_requested'
BUSY_FLAG = 'busy'
CHANNEL_ID = 'channel_id'
CHECK_SETTINGS = 'check_settings'
DEVELOPER_CONFIGS = 'configs'
CONTENT_TYPE = 'content_type'
LICENSE_TOKEN = 'license_token'
LICENSE_URL = 'license_url'
PLAY_COUNT = 'video_play_count'
PLAY_FORCE_AUDIO = 'audio_only'
PLAY_PROMPT_QUALITY = 'ask_for_quality'
PLAY_PROMPT_SUBTITLES = 'prompt_for_subtitles'
PLAYBACK_INIT = 'playback_init'
PLAYBACK_STARTED = 'playback_started'
PLAYBACK_STOPPED = 'playback_stopped'
PLAYER_DATA = 'player_json'
PLAYLIST_ID = 'playlist_id'
PLAYLISTITEM_ID = 'playlistitem_id'
PLAYLIST_PATH = 'playlist_path'
PLAYLIST_POSITION = 'playlist_position'
REFRESH_CONTAINER = 'refresh_container'
RELOAD_ACCESS_MANAGER = 'reload_access_manager'
REROUTE = 'reroute'
SLEEPING = 'sleeping'
SUBSCRIPTION_ID = 'subscription_id'
SWITCH_PLAYER_FLAG = 'switch_player'
VIDEO_ID = 'video_id'
WAIT_FLAG = 'builtin_running'
Expand All @@ -52,17 +67,32 @@
'ADDON_ID',
'ADDON_PATH',
'BUSY_FLAG',
'CHANNEL_ID',
'CHECK_SETTINGS',
'CONTENT_TYPE',
'DATA_PATH',
'DEVELOPER_CONFIGS',
'LICENSE_TOKEN',
'LICENSE_URL',
'MEDIA_PATH',
'PLAY_COUNT',
'PLAY_FORCE_AUDIO',
'PLAY_PROMPT_QUALITY',
'PLAY_PROMPT_SUBTITLES',
'PLAYBACK_INIT',
'PLAYBACK_STARTED',
'PLAYBACK_STOPPED',
'PLAYER_DATA',
'PLAYLIST_ID',
'PLAYLISTITEM_ID',
'PLAYLIST_PATH',
'PLAYLIST_POSITION',
'REFRESH_CONTAINER',
'RELOAD_ACCESS_MANAGER',
'RESOURCE_PATH',
'REROUTE',
'SLEEPING',
'SUBSCRIPTION_ID',
'SWITCH_PLAYER_FLAG',
'TEMP_PATH',
'VALUE_FROM_STR',
Expand Down
28 changes: 21 additions & 7 deletions resources/lib/youtube_plugin/kodion/context/abstract_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from ..sql_store import (
BookmarksList,
DataCache,
FeedHistory,
FunctionCache,
PlaybackHistory,
SearchHistory,
Expand Down Expand Up @@ -107,13 +108,15 @@ class AbstractContext(object):
}

def __init__(self, path='/', params=None, plugin_id=''):
self._function_cache = None
self._access_manager = None

self._bookmarks_list = None
self._data_cache = None
self._search_history = None
self._feed_history = None
self._function_cache = None
self._playback_history = None
self._bookmarks_list = None
self._search_history = None
self._watch_later_list = None
self._access_manager = None

self._plugin_handle = -1
self._plugin_id = plugin_id
Expand Down Expand Up @@ -155,6 +158,14 @@ def get_playback_history(self):
self._playback_history = PlaybackHistory(filepath)
return self._playback_history

def get_feed_history(self):
if not self._feed_history:
uuid = self.get_access_manager().get_current_user_id()
filename = 'feeds.sqlite'
filepath = os.path.join(self.get_data_path(), uuid, filename)
self._feed_history = FeedHistory(filepath)
return self._feed_history

def get_data_cache(self):
if not self._data_cache:
settings = self.get_settings()
Expand Down Expand Up @@ -208,6 +219,9 @@ def get_access_manager(self):
self._access_manager = AccessManager(self)
return self._access_manager

def reload_access_manager(self):
self._access_manager = AccessManager(self)

def get_video_playlist(self):
raise NotImplementedError()

Expand Down Expand Up @@ -306,7 +320,7 @@ def parse_params(self, params=None):
)
# process and translate deprecated parameters
elif param == 'action':
if parsed_value in ('play_all', 'play_video'):
if parsed_value in {'play_all', 'play_video'}:
to_delete.append(param)
self.set_path('play')
continue
Expand Down Expand Up @@ -375,7 +389,7 @@ def get_id(self):
def get_handle(self):
return self._plugin_handle

def get_settings(self, flush=False):
def get_settings(self, refresh=False):
raise NotImplementedError()

def localize(self, text_id, default_text=None):
Expand Down Expand Up @@ -425,7 +439,7 @@ def get_infolabel(name):
raise NotImplementedError()

@staticmethod
def get_listitem_detail(detail_name):
def get_listitem_property(detail_name):
raise NotImplementedError()

@staticmethod
Expand Down
Loading
Loading