An alternative approach for handling playlists

Hello all

I’d like to extend Volumio so as to deal with playlists in a particular way.

Before I start investing time I’d like to get some more experienced opinions on:

  • feasibility (whether what I’d like to achieve is even possible)
  • the extent to which I might be re-inventing the wheel
  • pointers and ideas you may have on how to solve this and what to look out for
  • general feedback and whether or not this would be appreciated.

This reflects my current understanding of how Volumio handles playlists and also hints at what I’d like to to enhance:

  • Volumio uses its own proprietary format for playlists (no M3U or PLS support)
  • All playlists are stored in one designated location [Browse > Playlists], so there is no way to structurally organize them. This lack of organizational/structural facilities isn’t limited to playlists however. This is a general limitation.
  • Playlists have their own name, but can’t have their own images

More details on what I’d like to improve:

In our household, each member manages their own collection of music. Jane has access to everyone’s music via [Browse > Albums] or [Browse > Artists], but Jane can also go to [Browse > Music Library > USB > Audio > Jane], where she can browse only the subset of albums that are hers. However, since Volumio’s playlists aren’t integrated into the filesystem, this doesn’t work for playlists. For playlists, Jane is forced to share a single “bucket” with everyone else, with no way to filter out everything that isn’t “hers”. That’s one thing I’d like to improve.

Second, I question whether it makes sense to deal with playlists and albums in such a disconnected way. Playlists and albums are physically different concepts. That’s true. Albums are defined via the metadata embedded within audio files whereas playlists are defined externally in separate files and have nothing to do with metadata. Logically however, there is no difference between the two. Both are named collections of audio tracks. Logically, playlists are just compilation albums that are put together by users rather than production companies. For a music player and its front-end UI, I think it makes more sense to focus on the logical concepts rather than physical differences of how information is stored. I have no idea if this is technically feasible with the current architecture. I’m recording this primarily so as to be clear on what I would consider ideal and what I’m striving towards. Basically, the ability for albums and playlists to appear as if they are the same things or at least similar.

Lastly, while I don’t think Volumio must support PLS or M3U files directly, I do think Volumio must at least be able to import/export those formats.

First thoughts about a potential solution

My first thought is to create a new mdp database plugin that is based on the simple plugin that already exists.

Anytime this modified plugin encounters a directory that contains only one M3u or PLS file (and possibly image files) it would import it as if it originated from audio-file metadata. I’m hoping this would be entirely transparent to Volumio, e.g. if Volumio queried mdp for that directory, mdp would return the list of tracks specified by the playlist. Because the playlist resides in a directory it could also have its own album art. To these playlist based “albums” the modified database plugin would assign:

album = [the playlist filename]
album-artist = [first entry used in Settings > My Music > Music Library Settings | Compilation Metadata fields]

All the other information would be extracted from the audio file’s metadata just as it would be for any other album.

I think that would address all my requirements, but I haven’t put a whole lot of thought into this yet, nor have I invested any time to determine whether or not it is even technically feasible. Depending on what others think and where this conversation leads I might be willing to give it a shot.

What do you folks think?

From my point of view an enhanced playlist handling would be really nice. My wishes are the same as yours :

  • store playlists in a user-defined location
  • structurally organization (i.e. categories, genres)

Confirmed.

This has been asked several times. Due to the number of different playlist formats / different synthax within one format / different path notations / different character sets this is not an easy mission.

So you want the playlists listed just as albums in the album menu among all the albums. Nice idea … but there should be a way to filter for playlists. I often go explicitly for playlists. If you take just album and artist from the playlist file how do you want to categorize playlists (i.e. for Jane) ?

Cheers
Pirx

Hey Pirx

To achieve the filtration capability you are asking for I see multiple possibilities. What I’m listing here is just the low-hanging fruit (wouldn’t require any changes to Volumio) I can think of off the top of my head.

You’d just put your playlists into a separate top level directory. For example, since I have my entire music collection on an USB drive that is plugged into the RPi3, I would navigate to [Browse > Music Library > USB > [DriveName] > Playlists]. Using the filesystem you can setup any organizational hierarchy you like, so it could also get more complicated than that. Since I’m also segmenting music collections by family member, for us the directory structure would look like this:

John
Jane
  |- Albums
  |- Playlists
Junior

So, if Jane navigates to [Browse > Music Library > USB > [DriveName] > Jane > Albums] she gets the subset of albums which are hers. If she navigates to [Browse > Music Library > USB > [DriveName] > Jane > Playlists] she gets the subset of playlists that are hers (and they’d also look like albums and potentially also have their own playlist “album-art”).

The playlist import-mechanism I’m proposing would use the playlist’s filename as the album name, so that would be another filtration option. For example, assume you named all your playlists like so:

[Name]-pl.m3u

You might then have an album in your collection called Workout-pl (your playlist for the gym). You could then just type “-pl” into the search box and find all your playlists that way.

In my first post I suggested that the playlist import-mechanism would use the first term in [Settings > My Music > Music Library Settings | Compilation Metadata fields] as the playlist’s album-artist name. After all, a playlist is really just a user defined compilation album.

However, these compilation related terms can’t be used as search terms, i.e. typing ‘Various’ into the search box returns am empty set.

If the playlist import-mechanism were to instead use a term that is excluded from [Settings > My Music > Music Library Settings | Compilation Metadata fields], then that would be another option. So, if the term used for playlist album-artists is, e.g. ‘Playlist’ rather than ‘Various’, then typing ‘playlist’ into the search box would also list all your playlists.

The benefit of this approach is that it doesn’t require playlist files to be named in any particular way.

The downside is that configuration files would have to be modified using SSH (to specify the term used for playlist’s album-artist field, i.e. ‘playlist’ or otherwise).

On the other hand, this whole concept, as I currently envision it, relies on the installation of a modified mdp database plugin. I know nothing about the Volumio plugin architecture, but I suspect installing mdp plugins and re-configuring mdp isn’t covered by that. Therefore, installing this feature would likely require SSH skills regardless.

The separation/categorization by subfolders will only be available in the playlist view, while the album view will show all playlists, right ?
So you want to keep the playlist view. That’s not the big deal. I thought you are up to integrate playlists into the album view and remove the playlist view.

A special naming of the playlist for categorization … that’s not my favourite concept.

Categorization by playlist album-artist … that’s the way I’d prefer. But of course this must be possible for with Volumio created playlists (new and existing) either.

Cheers
Pirx

No.

You’re correct that the [Browse > Album] view would show you all playlists (and all your albums). However, the playlist view is irrelevant to this discussion. If it was relevant you would have seen me mention:

[Browse > Playlists]

which I didn’t. I’m probably using an unusual notation. In the text you quoted I mentioned this:

[Browse > Music Library > USB > [DriveName] > Jane > Playlists]

That is an example of how Jane would access only her playlists, but that probably isn’t applicable to you (particularly if you don’t store you music collection on a USB drive plugged directly into the Volumio host as I do). Anyway, the important part that would be identical for all of us is this:

[Browse > Music Library]

What you see there today is already based on the directories you’ve instructed Volumio to import audio tracks from. To the locations Volumio already knows about, you could simply add another location with your playlists. Below that root location you can have any hierarchical directory structure you want, so that would allow you to separate/categorize your playlists however you want.

So, the [Browse > Playlists] view is irrelevant to this discussion. This is in fact about integrating playlists into both the [Browse > Albums] and
[Browse > Music Library] views.

You understood that you would define that naming scheme though, right? You’d just have to be consistent in how you name your playlists. It’s just an option that would work without any additional effort. You don’t have to use it.

I’m not sure I understand what “Categorization by playlist album-artist” means. For a playlist that you made, you are the “album-artist”.

Returning to the example I gave in my first post, I’d say Jane is the “album-artist” for the playlists she makes. If she puts all her self-made playlists into a directory on the filesystem named “Jane”, then that effectively categorizes her playlists into one group.

Whatever you mean, I think the important point you likely missed is that you can define your own hierarchical directory structure on the filesystem. Since you can place your playlists into that directory structure wherever and however you like, you can categorize your playlists however you like. All of that would be accessible in Volumio below:

[Browse > Music Library]

Playlists in Volumio deserves some TLC. Importing of standard formats is very desirable, but please bear in mind that the current structure is there for a reason. Having said that, personally, I am very pleased to see a discussion about making playlists more flexible & inclusive is a good scenario. Keep discussing guys …

Hey chsims1

Thanks for ch(s)iming in :wink:

I can easily bear in mind that the current structure is there for a reason. That’s just not very useful if I don’t know what that reason is. Can you elaborate?

I assume you’re referring to how Volumio treats playlists and albums as disconnected and unrelated entities. I realize that this is common practice. In the opening post I attempted to briefly explain why I think that approach is flawed. If you can share your views on that as part of your elaborations I’d be very interested to hear them.

To better illustrate my own position I’ll add this:

According to Musicbrainz.org the term “album” is very generic, i.e. no matter what type of album we’re referring to, there is likely to exist a more specific term that would more precisely define the album’s type. The most common type of album is an LP release (long play), but we also have compilations, soundtracks, singles, EPs and Audiobooks (just to name a few). The fundamental trait all albums share is that they are all named collections of tracks. A playlist is also exactly that. A playlist is essentially a compilation album that was created by a consumer rather than an artist and/or production company. That’s the only difference. IMHO that doesn’t warrant dealing with playlists in an entirely disconnected and unrelated way.

It’s the fundamental traits that all albums share which should define how users interact with them through the UI; not the technicalities of how the different types of albums (which includes playlists) are stored/defined.

Sorry. I overlooked this detail. So the playlists are stored (and shown) in the music library where a folder structure is usual business. That means you can store playlists in every location defined in the Volumio Music-Settings. Now it makes sense. That sounds interesting.

Yes, I did. But I don’t like to do it this way.

That’s the default setting for the playlist album-artist :

You mentioned the possibility to use it otherwise :

My understanding is that this offers another possibility to categorize playlists. For my needs that would be a good way - even if I’m no longer the album artist.

Cheers
Pirx

Hey Pirx

Okay, I think you understand how the search-box and the value assigned to the album-artist fields for playlists could be used to filter out everything except playlists. There is likely still a misunderstanding here somewhere though:

Missunderstanding

I think the way you use the term “categorization” is throwing me off. In the context in which I think you are using it, I’d prefer to speak of “assignment”. It’s probably also unclear when I’m discussing ideas that are purely conceptual and when I’m discussing actual implementation details.

Conceptual

Whenever I stated that “you” are the album-artist or that “Jane” is the album-artist, I’m speaking conceptually. This statement is made primarily to convey how playlists and albums are conceptually similar, specifically to convey the idea that conceptually, playlists are just compilation albums that were created by a consumer (e.g. you or Jane) rather than an artist and/or production company. None of this has anything to do with default values being assigned to anything.

Implementation

In Volumio’s database, all the tracks belonging to the same album must have the same value assigned to their album-artist fields, for example, all the tracks belonging to the album “Thriller” must have their album-artist fields set to “Michael Jackson”).

In Volumio’s database, all the tracks belonging to playlists would have their album-artist fields set to a value that is specified in a configuration file. The default value specified in that configuration file would likely be “Playlist”.

If you changed the default value in the configuration file and re-scaned your music collection, then in Volumio’s database the album-artist fields for all tracks belonging to playlists would then be updated to the new value.

Whatever that value is, typing that value into the search box would present you with a list of albums who’s tracks have album-artist fields set to that value.

So far I’ve understood.

Sorry for the misunderstandings. I’m no native english nor a Volumio insider. Thanks for your patience.

Cheers
Pirx

No Problem. So now that you understand it, what do you (and others) think? Worth doing? Waste of time? Suggestions?

Sorry, but I don’t have a clear YES or NO for you.

Let me summarize it.

Pro:

  • playlists can be stored everywhere Volumio is configured to search for music files (USB drive or network)
  • playlists can be structurally organized in subfolders in the music library
  • playlists are visible in the album view

Con:

  • playlist visibility in the album view will depend on the content of the album-artist field in the music files

Remark
I gave it a try filled the album-artist field in a few songs (with “playlist”) and found this “playlist” in the artist view. The songs are ordered according to the song numbers they have in their albums and I haven’t found a proper way to change that. I wander what to do to get a song in a second playlist (the album-artist field can contain just one value). I know what I did is not exactly the same you want to do. Just to set a value in the album-artist field will obviously not do the job. There must be more than that.

Thoughts
Any solution must be easy to use.

Change the place to store playlists and if desired create subfolders there should every user be able to manage without a lot of explanations.

Using the album-artist field in the music files adds complexity. Users might want to use this field otherwise. Songs would disappear from the playlist in the album view if the album-artist field is cleared later for any reason, whereas they remain in the stored playlist.

Cheers
Pirx

Okay, I’ve had to put this on hold. I would like to return to it, but right now I’m holding off until I can get my other issues with Volumio sorted out. In my view Volumio has huge potential, but it’s just not quite ready yet. If my other issues get sorted then I would love to come back to this, and hopefully do a better job at explaining how this is intended to work, as so far I’ve failed at that :slight_smile:

@Prix
You’re right about the PRO’s, but mistaken about the CON’s.

I understand what you’re trying to test, but right now it’s impossible to test what I’m proposing, because it’s currently impossible for one audio file to be associated with two different albums.

Even if it were possible to associate one audio file with two different albums, my proposal wouldn’t require you to change ANY of the metadata for ANY of your tracks. In fact, you shouldn’t. Rather than modify metadata, you’d just add a playlist. Assume the following:

You have this playlist:                "Joe's Scary Music.m3u"
The third track in that playlist is:   "Revolution #9" (by The Beatles)

The playlist is stored in a folder which Volumio scans for music.

Now, when you do tell Volumio to scan/update, and the enhanced importer encounters that playlist, that is when a second album is created! The enhanced importer would import all the same metadata from the audio file just as it did the first time, except for the following differences:

album-name    =  [playlist file name], e.g. "Joe's Scary Music"
album-artist  =  [an arbitrary name the user can specify in a configuration file], e.g. "Joe"
track-number  =  [based on the sequence/order of tracks as specified in playlist file]
album-art     =  [The image file stored in the same folder as the playlist file]

At this point you would effectively have one audio file associated with two albums. The database used to store all the metadata would contain the same track twice, like so:

track-name     album-artist  album-name			track #	
-------------  ------------  -----------------  -------
Revolution #9  The Beatles   The White Album    12
Revolution #9  Joe           Joe's Scary Music  03

Looking at each album, you’d find the same track in both albums, with a different track #, but clicking on either would play the same audio file.

If you delete the playlist and tell volumio to scan/update, then the second track would be removed from your collection.

IMHO that’s exactly how you’d want a playlist to work. I don’t think this adds any complexity at all.