Skip to content

Commit

Permalink
Fix regression where trickplay broke external MPV.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwalton3 committed Feb 17, 2023
1 parent 80f980e commit b6eb3b0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Jellyfin MPV Shim.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Jellyfin MPV Shim"
#define MyAppVersion "2.4.0"
#define MyAppVersion "2.4.1"
#define MyAppPublisher "Ian Walton"
#define MyAppURL "https://github.com/jellyfin/jellyfin-mpv-shim"
#define MyAppExeName "run.exe"
Expand Down
2 changes: 1 addition & 1 deletion jellyfin_mpv_shim/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP_NAME = "jellyfin-mpv-shim"
USER_APP_NAME = "Jellyfin MPV Shim"
CLIENT_VERSION = "2.4.0"
CLIENT_VERSION = "2.4.1"
USER_AGENT = "Jellyfin-MPV-Shim/%s" % CLIENT_VERSION
CAPABILITIES = {
"PlayableMediaTypes": "Video",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<content_rating type="oars-1.1" />
<releases>
<release version="2.4.0" date="2023-02-16">
<release version="2.4.1" date="2023-02-16">
<description>
<p>Add preview images on seek bar. (Works with chapter images by default, also supports JellyScrub.)</p>
<p>Handle removal of already configured shader profiles gracefully.</p>
Expand Down
12 changes: 7 additions & 5 deletions jellyfin_mpv_shim/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,15 @@ def __init__(self):

self.trickplay = TrickPlay(self)
self.trickplay.start()

if settings.thumbnail_custom_script:
scripts.append(settings.thumbnail_custom_script)
else:
scripts.append(get_resource("trickplay.lua"))
except Exception:
log.error("Could not enable trickplay.", exc_info=True)

if settings.thumbnail_custom_script:
scripts.append(settings.thumbnail_custom_script)
else:
scripts.append(get_resource("trickplay.lua"))
mpv_options["osc"] = False

if scripts:
mpv_options["scripts"] = (
Expand Down Expand Up @@ -1052,7 +1054,7 @@ def set_osd_settings(self, back_color: str, font_size: int):
def enable_osc(self, enabled: bool):
if settings.thumbnail_enable and self.trickplay:
self.script_message(
"osc-visibility", "always" if enabled else "never", False
"osc-visibility", "always" if enabled else "never", "False"
)
else:
if hasattr(self._player, "osc"):
Expand Down
5 changes: 5 additions & 0 deletions jellyfin_mpv_shim/trickplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2948,6 +2948,11 @@ function visibility_mode(mode, no_osd)
always_on(true)
elseif mode == "never" then
enable_osc(false)
-- BEGIN patch add thumbnails
if img_is_shown then
mp.commandv("overlay-remove", 46)
end
-- END patch add thumbnails
else
msg.warn("Ignoring unknown visibility mode '" .. mode .. "'")
return
Expand Down
14 changes: 7 additions & 7 deletions jellyfin_mpv_shim/trickplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def run(self):

self.player.script_message(
"shim-trickplay-bif",
bif_meta["count"],
bif["multiplier"],
bif_meta["width"],
bif_meta["height"],
str(bif_meta["count"]),
str(bif["multiplier"]),
str(bif_meta["width"]),
str(bif_meta["height"]),
img_file,
)
log.info(
Expand Down Expand Up @@ -108,9 +108,9 @@ def run(self):

self.player.script_message(
"shim-trickplay-chapters",
bif_meta["width"],
bif_meta["height"],
img_file,
str(bif_meta["width"]),
str(bif_meta["height"]),
str(img_file),
",".join(str(x["start"]) for x in chapter_data),
)
log.info(f"Collected {len(chapter_data)} chapter preview images")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="jellyfin-mpv-shim",
version="2.4.0",
version="2.4.1",
author="Ian Walton",
author_email="iwalton3@gmail.com",
description="Cast media from Jellyfin Mobile and Web apps to MPV.",
Expand Down

0 comments on commit b6eb3b0

Please sign in to comment.