v1.0.2 — fix SponsorBlock silent-break on pv.youtube delegation
SponsorBlockMonitor's "playing file changed mid-monitor" exit was too aggressive on the delegation path. When torttube hands off to plugin.video.youtube, Kodi cycles through three URLs (torttube plugin → pv.youtube plugin → MPD on localhost:50152) before settling. If initial_file captured an intermediate one, the next poll's current_file tripped the exit and SponsorBlock silently stopped without skipping anything. Removed the check. The isPlaying() guard already covers the "player stopped" exit; the rare "user started a different video while our monitor is still alive" case isn't worth breaking the common path.
This commit is contained in:
parent
5f2145e5fe
commit
7645688533
3 changed files with 5 additions and 21 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.torttube"
|
<addon id="plugin.video.torttube"
|
||||||
name="torttube"
|
name="torttube"
|
||||||
version="1.0.1"
|
version="1.0.2"
|
||||||
provider-name="Sulkta-Coop">
|
provider-name="Sulkta-Coop">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="3.0.0"/>
|
<import addon="xbmc.python" version="3.0.0"/>
|
||||||
|
|
|
||||||
|
|
@ -663,31 +663,15 @@ class SponsorBlockMonitor(xbmc.Monitor):
|
||||||
_log("sponsorblock: timed out waiting for playback to start")
|
_log("sponsorblock: timed out waiting for playback to start")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Capture the file path that's actually playing now; bail if it changes
|
|
||||||
# mid-monitor (delegate-to-pv.youtube means our SponsorBlockMonitor is
|
|
||||||
# alive in our plugin's context while pv.youtube drives playback —
|
|
||||||
# if the user starts a different video, our skip-segments are stale).
|
|
||||||
#
|
|
||||||
try:
|
|
||||||
initial_file = player.getPlayingFile()
|
|
||||||
except Exception:
|
|
||||||
initial_file = ""
|
|
||||||
|
|
||||||
while not self.abortRequested() and player.isPlaying():
|
while not self.abortRequested() and player.isPlaying():
|
||||||
try:
|
try:
|
||||||
pos = float(player.getTime())
|
pos = float(player.getTime())
|
||||||
current_file = player.getPlayingFile()
|
|
||||||
except Exception:
|
except Exception:
|
||||||
# getTime raises various exception types when the player goes
|
# getTime raises various types when the player goes away
|
||||||
# away mid-poll (Kodi shutdown, plugin reload, etc). Wider catch
|
# mid-poll (Kodi shutdown, plugin reload, etc). Wider catch so
|
||||||
# so an exception path doesn't escape into _play's finally and
|
# an exception path doesn't escape into _play's finally and
|
||||||
# leak the MPD HTTP server.
|
# leak the MPD HTTP server.
|
||||||
return
|
return
|
||||||
if initial_file and current_file and current_file != initial_file:
|
|
||||||
# User started a different video — our skip segments are for the
|
|
||||||
# old one, abort instead of spurious-skipping the new content.
|
|
||||||
_log("sponsorblock: playing file changed, monitor exiting")
|
|
||||||
return
|
|
||||||
for seg in self.segments:
|
for seg in self.segments:
|
||||||
uuid = seg.get("UUID", "")
|
uuid = seg.get("UUID", "")
|
||||||
if uuid in self.skipped:
|
if uuid in self.skipped:
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ resolver = "2"
|
||||||
members = ["crates/torttube-sidecar"]
|
members = ["crates/torttube-sidecar"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
authors = ["Cobb <cobb@sulkta.com>"]
|
authors = ["Cobb <cobb@sulkta.com>"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue