Skip to content

fix: correct user-level flatpak mpv path (io.mpv.Mpv, not io.mpv/Mpv) - #1863

Merged
port19x merged 4 commits into
pystardust:masterfrom
TigerShark900:fedora44-flatpak-mpv-fix
Aug 11, 2026
Merged

fix: correct user-level flatpak mpv path (io.mpv.Mpv, not io.mpv/Mpv)#1863
port19x merged 4 commits into
pystardust:masterfrom
TigerShark900:fedora44-flatpak-mpv-fix

Conversation

@TigerShark900

@TigerShark900 TigerShark900 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes ani-cli failing to find/launch mpv on Fedora 44 Workstation (and any distro where mpv is installed via Flatpak rather than a native package). Fedora ships no mpv package by default — it needs RPM Fusion, which isn't enabled out of the box — so most Fedora users install mpv via Flatpak/GNOME Software instead. Two separate bugs in the Linux player-detection path stack on top of each other to break that case entirely:

1. Wrong user-level flatpak path (ani-cli line ~410)
The Linux fallback in b0993d4 added a correct system-wide flatpak path check (/var/lib/flatpak/app/io.mpv.Mpv/) but the existing user-level path ($HOME/.local/share/flatpak/app/io.mpv/Mpv/) has a typo: a slash where the real flatpak app-id uses a dot. Flatpak's real app-id directory is always io.mpv.Mpv (confirmed via flatpak remote-info flathub io.mpv.MpvRef: app/io.mpv.Mpv/x86_64/stable, and the layout of other installed flatpaks on a real system, e.g. app/com.brave.Browser/). As written, io.mpv/Mpv can never exist, so a genuine user-level flatpak install of mpv is never detected.

2. Missing case arm in the post-detection dependency check (ani-cli line ~513-519)
Even once player_function correctly resolves to the flatpak path, a second, separate check (dep_ch "$player_function") re-validates it with command -v, which fails on a literal directory path like /var/lib/flatpak/app/io.mpv.Mpv/ — even though play_episode() already knows how to launch it via flatpak run io.mpv.Mpv. This check had no *flatpak*mpv* arm to skip past it, unlike play_episode(), so it always dies with Program /var/lib/flatpak/app/io.mpv.Mpv/ not found. Please install it.

Both bugs had to be fixed for flatpak-installed mpv to work at all on Linux, system-wide or per-user.

Test plan

  • sh -n ani-cli passes
  • Reproduced and fixed live on Fedora 44 Workstation: installed mpv via flatpak install flathub io.mpv.Mpv (system-wide, matching GNOME Software's default), confirmed each error in sequence (No player found...Program /var/lib/flatpak/app/io.mpv.Mpv/ not found...), fixed both, then ran ani-cli end-to-end and confirmed playback actually works
  • Simulated dep_ch_failover against both the correct (io.mpv.Mpv) and buggy (io.mpv/Mpv) user-level paths to confirm the exact failure mode before the fix
  • Verified the real flatpak app-id via flatpak remote-info --user flathub io.mpv.Mpv

🤖 Generated with Claude Code

@port19x

port19x commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Hey @TigerShark900 good catch!
Could you amend your commit to have Claude Code coauthor it?
We're still working on making an official policy around AI use, but coauthorship is definitely desired.

@port19x port19x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This one is not necessary, as flatpak availability is implicity checked via the dep_ch_failover function.

Comment thread ani-cli
TigerShark900 and others added 2 commits August 11, 2026 09:52
Fedora Workstation ships no mpv package by default (needs RPM Fusion,
off by default), so most Fedora users install mpv via Flatpak/GNOME
Software. The Linux player-detection path checked for a directory at
$HOME/.local/share/flatpak/app/io.mpv/Mpv/ (slash), but the real
Flatpak app-id directory uses dots throughout: io.mpv.Mpv. That check
could never match a real user-level flatpak install of mpv, so ani-cli
would die with "No player found. Looked for mpv and vlc" even when
mpv was correctly installed. Confirmed against live Flathub metadata
(flatpak remote-info io.mpv.Mpv -> Ref: app/io.mpv.Mpv/x86_64/stable)
and by simulating dep_ch_failover against both path forms.

The system-wide path (/var/lib/flatpak/app/io.mpv.Mpv/, added in
b0993d4) was already correct and is unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The post-detection dependency check (dep_ch on \$player_function) had
no case arm for the flatpak-resolved path, so it fell through to the
generic \`dep_ch "\$player_function"\`, which runs \`command -v\` on a
literal directory path like /var/lib/flatpak/app/io.mpv.Mpv/ and
always fails ("Program ... not found. Please install it.") even
though play_episode() already knows how to launch it via
\`flatpak run io.mpv.Mpv\`. Confirmed live: after fixing the
detection path in the previous commit, this was the very next error
hit when actually installing mpv system-wide via flatpak and running
ani-cli for real. Added a matching *flatpak*mpv* arm that checks for
the flatpak binary itself instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@TigerShark900
TigerShark900 force-pushed the fedora44-flatpak-mpv-fix branch from c116ed7 to eb03ec3 Compare August 11, 2026 07:53
@port19x

port19x commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

That first commit makes sense, but I don't see the purpose of explicitly checking for a flatpak binary when the very specific flatpak paths do exist

@port19x

port19x commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Eyo wtf, shoutout to my own @claude Opus for pointing out the line 518 default case that would otherwise run raw dep_ch on player function...
This is why I'm looking forward to #1861

Comment thread ani-cli
@port19x
port19x merged commit 92e9d79 into pystardust:master Aug 11, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants