Skip to content

Commit

Permalink
Merge pull request #793 from MoojMidge/master
Browse files Browse the repository at this point in the history
v7.0.8+beta.1
  • Loading branch information
MoojMidge authored Jun 12, 2024
2 parents 382ad06 + 19e1455 commit ac15fb4
Show file tree
Hide file tree
Showing 49 changed files with 1,439 additions and 1,102 deletions.
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

0 comments on commit ac15fb4

Please sign in to comment.