eonpatapon / mpDris2

MPRIS V2.1 support for mpd
GNU General Public License v3.0
210 stars 46 forks source link

Add mopidy local url cover art support #153

Closed lilyinstarlight closed 2 years ago

lilyinstarlight commented 2 years ago

This PR adds support for finding cover art based on music_dir when using the local plugin from Mopidy. Only the first few lines of the diff matter, which parse the local:track:[path/relative/to/music_dir.ext] URL format that plugin gives over MPD metadata and prepends it with the configured music_dir

The rest of the diff de-indents everything else in the find_cover method since it now parses song_path early and returns if that fails (which allows for other adaptations to be made later, if for some reason that's necessary)

It works great in my testing with the rest of mpDris2 and this was my last local patch I have been running it with. Let me know if anything needs to be changed. Thank you all for this handy bit of software!