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.1.0+beta.1 #894

Merged
merged 12 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.9.2" provider-name="anxdpanic, bromix, MoojMidge">
<addon id="plugin.video.youtube" name="YouTube" version="7.1.0+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
15 changes: 15 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## v7.1.0+beta.1
###
- Fix logging/retry of sqlite3.OperationalError
- Fix trying to use ISA for progressive live streams
- Retain list position when refreshing listings
- Add workarounds for trying to play videos using RunPlugin rather PlayMedia

### Changed
- Update multiple busy dialog crash workaround #891
- Use all playable codecs but deprioritise if not selected in stream features
- Change default live stream type to suit ISA and Youtube stream availability

### New
- Allow ask for quality from context menu to override audio only setting

## v7.0.9.2
### Fixed
- Fix various Kodi 18 listitem setInfo compatibility issues
Expand Down
37 changes: 30 additions & 7 deletions resources/lib/youtube_plugin/kodion/abstract_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@

import re

from .constants import CHECK_SETTINGS, CONTENT, PATHS, REROUTE_PATH
from .constants import (
CHECK_SETTINGS,
CONTAINER_ID,
CONTAINER_POSITION,
CONTENT,
PATHS,
REROUTE_PATH,
)
from .exceptions import KodionException
from .items import (
DirectoryItem,
Expand Down Expand Up @@ -234,11 +241,21 @@ def reroute(self, context, path=None, params=None, uri=None):

if not path:
return False

do_refresh = 'refresh' in params

if path == current_path and params == current_params:
if 'refresh' not in params:
if not do_refresh:
return False
params['refresh'] += 1

if do_refresh:
container = context.get_infolabel('System.CurrentControlId')
position = context.get_infolabel('Container.CurrentItem')
else:
container = None
position = None

result = None
function_cache = context.get_function_cache()
window_return = params.pop('window_return', True)
Expand All @@ -252,16 +269,22 @@ def reroute(self, context, path=None, params=None, uri=None):
except Exception as exc:
context.log_error('Rerouting error: |{0}|'.format(exc))
finally:
context.log_debug('Rerouting to |{path}| |{params}|{status}'
.format(path=path,
params=params,
uri = context.create_uri(path, params)
context.log_debug('Rerouting to |{uri}|{status}'
.format(uri=uri,
status='' if result else ' failed'))
if not result:
return False
context.get_ui().set_property(REROUTE_PATH, path)

ui = context.get_ui()
ui.set_property(REROUTE_PATH, path)
if container and position:
ui.set_property(CONTAINER_ID, container)
ui.set_property(CONTAINER_POSITION, position)

context.execute(''.join((
'ActivateWindow(Videos, ',
context.create_uri(path, params),
uri,
', return)' if window_return else ')',
)))
return True
Expand Down
6 changes: 6 additions & 0 deletions resources/lib/youtube_plugin/kodion/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
PLAY_WITH = 'play_with'

# Stored data
CONTAINER_ID = 'container_id'
CONTAINER_FOCUS = 'container_focus'
CONTAINER_POSITION = 'container_position'
CONTENT_TYPE = 'content_type'
DEVELOPER_CONFIGS = 'configs'
LICENSE_TOKEN = 'license_token'
Expand Down Expand Up @@ -127,6 +130,9 @@
'PLAY_WITH',

# Stored data
'CONTAINER_ID',
'CONTAINER_FOCUS',
'CONTAINER_POSITION',
'CONTENT_TYPE',
'DEVELOPER_CONFIGS',
'LICENSE_TOKEN',
Expand Down
11 changes: 1 addition & 10 deletions resources/lib/youtube_plugin/kodion/context/abstract_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,7 @@ def reload_access_manager(self, get_uuid=False):
return uuid
return access_manager

def get_video_playlist(self):
raise NotImplementedError()

def get_audio_playlist(self):
raise NotImplementedError()

def get_video_player(self):
raise NotImplementedError()

def get_audio_player(self):
def get_playlist_player(self):
raise NotImplementedError()

def get_ui(self):
Expand Down
42 changes: 10 additions & 32 deletions resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
SORT,
WAKEUP,
)
from ...player import XbmcPlayer, XbmcPlaylist
from ...player import XbmcPlaylistPlayer
from ...settings import XbmcPluginSettings
from ...ui import XbmcContextUI
from ...utils import (
Expand Down Expand Up @@ -320,10 +320,7 @@ def __init__(self,
self._version = self._addon.getAddonInfo('version')

self._ui = None
self._video_playlist = None
self._audio_playlist = None
self._video_player = None
self._audio_player = None
self._playlist = None

atexit.register(self.tear_down)

Expand Down Expand Up @@ -426,25 +423,12 @@ def get_subtitle_language(self):
sub_language = None
return sub_language

def get_video_playlist(self):
if not self._video_playlist:
self._video_playlist = XbmcPlaylist('video', proxy(self))
return self._video_playlist

def get_audio_playlist(self):
if not self._audio_playlist:
self._audio_playlist = XbmcPlaylist('audio', proxy(self))
return self._audio_playlist

def get_video_player(self):
if not self._video_player:
self._video_player = XbmcPlayer('video', proxy(self))
return self._video_player

def get_audio_player(self):
if not self._audio_player:
self._audio_player = XbmcPlayer('audio', proxy(self))
return self._audio_player
def get_playlist_player(self, playlist_type=None):
if not self._playlist or playlist_type:
self._playlist = XbmcPlaylistPlayer(playlist_type,
proxy(self),
retry=3)
return self._playlist

def get_ui(self):
if not self._ui:
Expand Down Expand Up @@ -593,10 +577,7 @@ def clone(self, new_path=None, new_params=None):
new_context._watch_later_list = self._watch_later_list

new_context._ui = self._ui
new_context._video_playlist = self._video_playlist
new_context._audio_playlist = self._audio_playlist
new_context._video_player = self._video_player
new_context._audio_player = self._audio_player
new_context._playlist = self._playlist

return new_context

Expand Down Expand Up @@ -761,10 +742,7 @@ def tear_down(self):

attrs = (
'_ui',
'_video_playlist',
'_audio_playlist',
'_video_player',
'_audio_player',
'_playlist',
)
for attr in attrs:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ def cleanup_threads(self, only_ended=True):
self.threads = active_threads

def onPlayBackStarted(self):
if not self._ui.busy_dialog_active():
self._ui.clear_property(BUSY_FLAG)

if self._ui.get_property(PLAY_WITH):
self._context.execute('Action(SwitchPlayer)')
self._context.execute('Action(Stop)')
Expand All @@ -363,9 +366,6 @@ def onAVStarted(self):
if self._ui.get_property(PLAY_WITH):
return

if not self._ui.busy_dialog_active():
self._ui.clear_property(BUSY_FLAG)

playback_data = self._ui.pop_property(PLAYER_DATA)
if not playback_data:
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from ..constants import (
ADDON_ID,
CHECK_SETTINGS,
CONTAINER_FOCUS,
PLUGIN_WAKEUP,
REFRESH_CONTAINER,
RELOAD_ACCESS_MANAGER,
Expand Down Expand Up @@ -88,7 +89,7 @@ def onNotification(self, sender, method, data):
return
group, separator, event = method.partition('.')
if event == CHECK_SETTINGS:
if not isinstance(data, dict):
if data:
data = json.loads(data)
if data == 'defer':
self._settings_state = data
Expand All @@ -113,6 +114,12 @@ def onNotification(self, sender, method, data):
self.set_property(WAKEUP, target)
elif event == REFRESH_CONTAINER:
self.refresh_container()
elif event == CONTAINER_FOCUS:
if data:
data = json.loads(data)
if not data or not self.is_plugin_container(check_all=True):
return
xbmc.executebuiltin('SetFocus({0},{1},absolute)'.format(*data))
elif event == RELOAD_ACCESS_MANAGER:
self._context.reload_access_manager()
self.refresh_container()
Expand Down
5 changes: 2 additions & 3 deletions resources/lib/youtube_plugin/kodion/player/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

from __future__ import absolute_import, division, unicode_literals

from .xbmc.xbmc_player import XbmcPlayer
from .xbmc.xbmc_playlist import XbmcPlaylist
from .xbmc.xbmc_playlist_player import XbmcPlaylistPlayer


__all__ = ('XbmcPlayer', 'XbmcPlaylist',)
__all__ = ('XbmcPlaylistPlayer',)
29 changes: 0 additions & 29 deletions resources/lib/youtube_plugin/kodion/player/abstract_player.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""


class AbstractPlaylist(object):
class AbstractPlaylistPlayer(object):
def __init__(self):
pass

Expand Down
58 changes: 0 additions & 58 deletions resources/lib/youtube_plugin/kodion/player/xbmc/xbmc_player.py

This file was deleted.

Loading
Loading