Skip to content

Commit

Permalink
Merge pull request #811 from MoojMidge/master
Browse files Browse the repository at this point in the history
v7.0.8+beta.4
  • Loading branch information
MoojMidge committed Jun 21, 2024
2 parents adfef50 + 571681e commit 9406152
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 18 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.8+beta.3" provider-name="anxdpanic, bromix, MoojMidge">
<addon id="plugin.video.youtube" name="YouTube" version="7.0.8+beta.4" 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
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v7.0.8+beta.4
### Fixed
- Poll for http server restart when required for playback #746 #808
- Fix unsubscribe from My Subscriptions #809

## v7.0.8+beta.3
### Fixed
- Additional fixes for redacting IP addresses in debug logs #801
Expand Down
14 changes: 12 additions & 2 deletions resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,5 +775,15 @@ def tear_down(self):
except AttributeError:
pass

def wakeup(self):
self.send_notification(WAKEUP)
def wakeup(self, target):
self.send_notification(WAKEUP, target)
if not target:
return
pop_property = self.get_ui().pop_property
while 1:
awake = pop_property(WAKEUP)
if awake:
if awake != target:
self.log_error('Incorrect wakeup target')
break
wait(0.5)
23 changes: 10 additions & 13 deletions resources/lib/youtube_plugin/kodion/monitors/service_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,27 @@ def onNotification(self, sender, method, data):
if event == CHECK_SETTINGS:
if not isinstance(data, dict):
data = json.loads(data)
log_debug('onNotification: |check_settings| -> |{data}|'
.format(data=data))

if data == 'defer':
self._settings_state = data
return
if data == 'process':
elif data == 'process':
self._settings_state = data
self.onSettingsChanged()
self._settings_state = None
return
elif event == WAKEUP:
self.interrupt = True
if not isinstance(data, dict):
data = json.loads(data)
if data:
self.set_property(WAKEUP, data)
if data == 'plugin':
self.interrupt = True
elif data == 'server':
if not self.httpd and self.httpd_required():
self.start_httpd()
elif event == REFRESH_CONTAINER:
self.refresh_container()
elif event == RELOAD_ACCESS_MANAGER:
self._context.reload_access_manager()
self.refresh_container()
elif event == PLAYBACK_INIT:
if not self.httpd and self.httpd_required():
self.start_httpd()
else:
log_debug('onNotification: |unhandled method| -> |{method}|'
.format(method=method))

def onSettingsChanged(self):
self._settings_changes += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def run(self, provider, context, focused=None):
ui.clear_property(PLAYLIST_POSITION)

if ui.get_property(SLEEPING):
context.wakeup()
context.wakeup('plugin')

if ui.get_property(REFRESH_CONTAINER):
focused = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ def get_property(property_id):
property_id = '-'.join((ADDON_ID, property_id))
return xbmcgui.Window(10000).getProperty(property_id)

@staticmethod
def pop_property(property_id):
property_id = '-'.join((ADDON_ID, property_id))
window = xbmcgui.Window(10000)
value = window.getProperty(property_id)
if value:
window.clearProperty(property_id)
return value

@staticmethod
def clear_property(property_id):
property_id = '-'.join((ADDON_ID, property_id))
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/youtube_plugin/youtube/helper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ def update_video_infos(provider, context, video_id_dict,

# update channel mapping
channel_id = snippet.get('channelId', '')
video_item.set_subscription_id(channel_id)
video_item.set_channel_id(channel_id)
if channel_id and channel_items_dict is not None:
if channel_id not in channel_items_dict:
channel_items_dict[channel_id] = []
Expand Down
1 change: 1 addition & 0 deletions resources/lib/youtube_plugin/youtube/helper/yt_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def play_video(provider, context):
'refresh_only': screensaver
}

context.wakeup('server')
ui.set_property(PLAYER_DATA, json.dumps(playback_data, ensure_ascii=False))
context.send_notification(PLAYBACK_INIT, playback_data)
return video_item
Expand Down

1 comment on commit 9406152

@DjDiabolik
Copy link
Contributor

@DjDiabolik DjDiabolik commented on 9406152 Jun 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MoojMidge another possibily unrelated issue/trouble after update youtube addons to beta 4.

I'll try to get the debug log but I'm noticing that if I open Kodi and use something else it doesn't happen.
But if I open Kodi and try to watch any YouTube video then when I try to exit Kodi itself it never ends and remains frozen in the closing screen (i have also wait in this for about 30 minutes)... at this point i need to force kill or by system monitor of ubuntu or by Terminal using command like "flatpak kill tv.kodi.Kodi".

So if i can reproduce this issue/trouble whit a single video i try to make a full debug log and open a new issue of that.

EDIT
Issue created :)
#813

If you have some idea..... beta 3 it's not cause this same issue.. strange.

Please sign in to comment.