flathub / org.gnome.Lollypop

https://flathub.org/apps/details/org.gnome.Lollypop
5 stars 9 forks source link

Flatpak version doesn't find "kid3-cli" from host #179

Open felipehw opened 2 years ago

felipehw commented 2 years ago

Environment

Bug

Lollypop Flatpak version doesn't find kid3-cli from host.

My Silverblue host:

$ rpm-ostree status
State: idle
Deployments:
● fedora:fedora/36/x86_64/silverblue
                   Version: 36.20220514.0 (2022-05-14T00:45:42Z)
                BaseCommit: 37a03048e5cebd64eb20ad9ff42ad4b7672a7722e9d1f3a6705927c64bb8bbfa
              GPGSignature: Valid signature by 53DED2CB922D8B8D9E63FD18999F7CBF38AB71F4
           LayeredPackages: kid3-common

I accessing kid3-cli from host:

$ which kid3-cli
/usr/bin/kid3-cli
$ kid3-cli
kid3-cli> 

Lollypop Flatpak version doesn't find kid3-cli from host:

$ flatpak run org.gnome.Lollypop 
[INFO] 2022-05-14 12:40:54 Collection web service started
[INFO] 2022-05-14 12:40:54 Collection download started
[INFO] 2022-05-14 12:40:54 Last.fm web service started
[INFO] 2022-05-14 12:40:54 Collection download finished
[INFO] 2022-05-14 12:40:54 Libre.fm web service started
[INFO] 2022-05-14 12:40:54 ListenBrainz web service started
[INFO] 2022-05-14 12:40:55 Scan started
[INFO] 2022-05-14 12:40:55 lollypop.collection_scanner::__get_objects_for_uris: execution time 0:0.007901
[INFO] 2022-05-14 12:40:55 lollypop.collection_scanner::__scan: execution time 0:0.424732
[INFO] 2022-05-14 12:40:55 Scan finished
[INFO] 2022-05-14 12:40:55 Collection download started
[INFO] 2022-05-14 12:40:55 Collection download finished
[ERROR] 2022-05-14 12:41:02 RatingWidget::__on_can_set_popularity(): g-exec-error-quark: Failed to execute child process “kid3-cli” (No such file or directory) (8)

What I expect:

The mentioned behavior of calling kid3-cli from host via flatpak-spawn.
I can access the kid3-cli from host manually:

$ flatpak run --command=sh org.gnome.Lollypop
[📦 org.gnome.Lollypop ~]$ flatpak-spawn  --host kid3-cli
kid3-cli> 

From what I know, the flatpak-spawn way is the only way to Save changes to file option to work in the Flatpak version.

Observation: I opened this issue at upstream, but the developer ask me to open it here.

Eonfge commented 2 years ago

How did I miss this? My apologies for responding too late


There are two options;

The problem with flatpak-spawn is that it's a hack. I could create a wrapper that includes the --host but it would be a really messy thing.

What do you think is best?

bellegarde-c commented 2 years ago

Not possible to add this as a Flatpak plugin ?

bilelmoussaoui commented 2 years ago

I could bundle kid3-cli with the application

That would require qt right?

Eonfge commented 2 years ago

@bellegarde-c I could bundle the entire kid3-cli application, but a plug-in wouldn't actually make it any easier.

@bilelmoussaoui I'll have to double check the dependencies, but Kid3 can be compiled without the KDE UI so it likely won't need the KDE runtime: https://github.com/flathub/org.kde.kid3/blob/5db32165aaf8d0eb42533998b1e8123d8fe68645/org.kde.kid3.json#L79

Shall I try to bundle kid3? Might be the best solution right now


Edit. Never mind. I tested both scenarios and I must have Qt to build kid3-cli... It might be possible to do so in a separate module, but at that point it might be easier to just add Kid3 as an extension and to symlink the packages together.... Not very elegant.

felipehw commented 2 years ago

Humph, I see ... Bundle kid3-cli demands ugly solutions.

@Eonfge, the option of directly using kid3 isn't really an option because I don't use kid3 to occasionally edit music tags like name, etc., I use the integration in Lollypop to automatically write in the file my ratings of the music (★★★★★) while I'm hearing them.

Maybe use the more straightforward hackish option (flatpak-spawn --host) or adding to the README.md of the repo the know limitations of the Flatpak version.

Eonfge commented 2 years ago

I even found another issue with this workflow; the user will need to have kid3 as non-flatpak application... else, the sandboxed version of kid3-cli (from org.kde.kid3) will complain that it can't find the file since it's at a different mount point: The sandbox of Lollypop and Kid3 don't see the same files.

So... the problem gets bigger. even If I configure flatpak-spawn --host kid3-cli to work... it would not work for Flathub users since Lollypop actually mounts all user's music using the proper sandboxing flow.

I'm at a dead end. Even the proposed solution is not ideal.

@bellegarde-c Weird question perhaps, but who kid3-cli? Are there not multiple python libraries to write metadata into tracks? It's a bit odd to have such a hard dependency on a KDE application like this.