z------------- / CPod

(UNMAINTAINED) A simple, beautiful podcast app for Windows, macOS, and Linux.
Apache License 2.0
749 stars 75 forks source link

MPRIS Support #28

Closed benjamindaines closed 6 years ago

benjamindaines commented 6 years ago

https://specifications.freedesktop.org/mpris-spec/latest/

Great podcast app! Please consider adding MPRIS 2.0 support, which enables widget controls and general integration into Linux environments at some point. Thanks.

z------------- commented 6 years ago

I'll look into it. Thanks 😊

z------------- commented 6 years ago

Hi, (pre)release 1.20.0 contains basic MPRIS integration; a list of implemented MPRIS features can be found in the release notes. Tested on KDE neon. Please let me know if there are any problems.

benjamindaines commented 6 years ago

Seems to work. Also glad to see that the feed is working now, I may be able to start testing this full time now :+1:

Only thing is the metadata could use a little polishing for MPRIS. I think it should display the podcast name where it currently displays "Unknown Artist" and then the episode title on the second line. If you could also get the album cover (or whatever the podcast equivalent is) to show up there too it would be "on fleek"

As always, awesome work! screenshot from 2018-03-15 16-36-29

z------------- commented 6 years ago

Got it. CPod currently puts the podcast title into MPRIS's album title field rather than the artist name field, so I'll switch it around.

As for the image, I'm guessing the reason it shows up empty is that the podcasts you have are in the old image storage format, which saves the image as a Blob directly into localForage, whereas the new format saves the images to disk as files. My understanding is that MPRIS's album image field only supports http(s):// and file:// URLs, and there is no clean and easy way to turn said blobs into either of those.

Assuming that this is the cause of the problem, I would recommend that you try Settings > Update podcast cover art. After that's done, the next played episode (or the same one, after a CPod restart) should now have the podcast image showing in the MPRIS controller.

I will investigate better solutions to this problem.

z------------- commented 6 years ago

(Pre)release 1.20.1 includes the improvements you suggested. For podcasts using the old image format, it updates the podcast image during playback before passing the information to MPRIS -- no additional actions required on the user's part. Please try it out and let me know if it fixes the problems for you.

By the way, thanks for the kind words :)

benjamindaines commented 6 years ago

Something's still off there. For some reason now it's back to unknown / unknown. Album art didn't show up when it was displaying correct metadata thought.

z------------- commented 6 years ago

To clarify: is the current situation that no metadata or album art is showing?

Edit: and is this behaviour consistent across podcasts and episodes?

Edit 2: CPod isn't able to show/update MPRIS information until playback of the relevant episode has started -- does the problem persist after having started playback?

benjamindaines commented 6 years ago

Neither album art nor metadata is show up. Might it be gnome specific if it seems to be working for you in KDE? I don't know why MPRIS would be different between the two DEs tho.

z------------- commented 6 years ago

Could you let me know what podcasts you're trying it with? Maybe there's a bug related to getting the correct episode information.

Edit: I'll put out a new prerelease of CPod that allows you to open the DevTools from Settings -- I'll ping here again when it's available, and could you reproduce the problem while DevTools > Console is open (hopefully a bunch of helpful errors will show up), right click inside the log area and choose "Save as..." and send me the .log file? Thanks.

z------------- commented 6 years ago

Here it is: (pre)release 1.22.3

benjamindaines commented 6 years ago

I'm not sure how to grab a link from cpod, but BBC's Planet Money is an example.

z------------- commented 6 years ago

I couldn't find any "Planet Money" from the BBC, I assume you mean the one from NPR? CPod's MPRIS integration seems to work fine with it, and the image update procedure I mentioned earlier seems to work fine as well. This might be hard to figure this out without those logs.

One thing we could try, though, is to set the podcast title as MPRIS's artist name as well as the album name -- this latest problem seems to have arisen only after I switched those two fields around per your request. Maybe GNOME is seeing the missing album name and treating the metadata as invalid. Please try out (pre)release 1.22.4 and let me know if that solves the problem.

logix2 commented 6 years ago

The MPRIS implementation is a bit buggy for me. I'm using Ubuntu 18.04 and CPod creates MPRIS entries with the old application name in the Media Player Indicator extension each time it runs, here's a screenshot: https://i.imgur.com/VLA1bnW.png

z------------- commented 6 years ago

@benjamindaines It turns out that GNOME wants the MPRIS artist field as an array rather than a string, which is what CPod was giving it. 90e1bfb4a0bc30a07e02b32a017ec95f85205dd6 fixes this and this fix will be live in the next release of CPod:

Screenshot

@logix2 f3173eb209e5c211197ba628db9ba98797433c94 fixes the old application name showing. I'll make a new issue for the duplicate entries bug.

Screenshot