Sticker data for cuesheet subsongs?

Need help with MPD?
Post Reply
Galicarnax
Posts: 2
Joined: March 16th, 2020, 5:27 pm

Sticker data for cuesheet subsongs?

Post by Galicarnax »

I'd like to be able to save/retrieve custom data for tracks (like rating, first_played, last_played, play_count,...) into sticker database. I think I can manage that using, e.g., python-mpd2. There is one thing I can't figure out. I have many albums as single files (images) accompanied by cuesheets. As far as I understand, MPD treats cuesheets as playlists, but this makes no big difference for me, as long as I can uniquely identify tracks (from the MPD's currentsong I can retrieve both the URI of the file and the track number). But is it possible to get/set sticker values for these "subsongs". I read in the docs that currently stickers work only for "song" types, but do tracks from the cue sheet count as "songs"? If so, how can I use sticker data for them?

P.S. Perhaps something similar has been asked here, but the search functionality of the forum is weird. If I search the word `cuesheet` it gives me the list of results, but whenever I try to search for `sticker`, it fails with "forum.musicpd.org is currently unable to handle this request".

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: Sticker data for cuesheet subsongs?

Post by max »

In MPD 0.22, songs in CUE sheets are song objects.

Galicarnax
Posts: 2
Joined: March 16th, 2020, 5:27 pm

Re: Sticker data for cuesheet subsongs?

Post by Galicarnax »

Ok, but how am I supposed to handle stickers for them? E.g., to set a sticker I need to pass type (song), uri (image-file path?), the name and the value for the sticker. How do I distinguish between tracks of a multi-track image, if I provide only URI? Is it encoded in URI?

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: Sticker data for cuesheet subsongs?

Post by max »

Just like you handle sticker for song objects which are regular files. A CUE sheet is a directory, and it contains song objects, and those song objects can have stickers.

Galicarnax
Posts: 2
Joined: March 16th, 2020, 5:27 pm

Re: Sticker data for cuesheet subsongs?

Post by Galicarnax »

Well, this clarifies a lot, thanks!

UPD: A silly question (sorry): is version 0.22 available for download already? I couldn't find it in Downloads section and in github branches.
Last edited by Galicarnax on March 17th, 2020, 1:23 pm, edited 1 time in total.

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: Sticker data for cuesheet subsongs?

Post by max »

It's git master. It's open source, everything's always available, even if it's not "officially" released.

Galicarnax
Posts: 2
Joined: March 16th, 2020, 5:27 pm

Re: Sticker data for cuesheet subsongs?

Post by Galicarnax »

Actually, I've cloned master branch and compiled it, but then ran "mpd --version" and somehow noticed only the number in parenthesis in "Music Player Daemon 0.22~git (v0.21.20-865-g6d91b5c7b)" :) Thanks again.
Last edited by Galicarnax on March 17th, 2020, 3:13 pm, edited 1 time in total.

Galicarnax
Posts: 2
Joined: March 16th, 2020, 5:27 pm

Re: Sticker data for cuesheet subsongs?

Post by Galicarnax »

So, I see it in action now. I have one more question (and hopefully last on this topic): after a bit of playing around, I see that the song names under the "cue directory" always have the form path/to/cue/trackXXXX, where XXXX is the track number as a four-digit string left-padded with zeros (e.g., /track0003). Is this a common pattern that I can rely on, or in some cases mpd might use, e.g., subsong names (from cue-sheet) instead of track numbers?
Last edited by Galicarnax on March 17th, 2020, 4:12 pm, edited 1 time in total.

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: Sticker data for cuesheet subsongs?

Post by max »

This is an implementation detail and not part of the API contract.

Post Reply