Mopidy/MPD - Sort albums by Date Added?

Hey community!

In the recent days, I’ve run to a number of dead-ends trying to view and navigate my music collection through Mopidy. At first, I thought the issue might be the Front-end I’m using, but now after comparing a bunch, it seems the problem might be in the core of Mopidy/MPD itself.

For me, having a decent sized music collection, and having the habit of listening to new music by new artists often times, the most common way for me to browse my collection would be by checking my latest additions. How I have it in my head, and how I’m used to having it in Bandcamp/Spotify/Soundcloud/etc, is a grid view of covers, with newest showing up on top, that would then expand into the tracks inside the album. Sounds simple enough, eh?

It seems to me now, that Mopidy doesn’t support this sort of Sort, at least not easily? Using Iris and going into the Album view, I’m able to sort my Spotify-collection by Date Added, but my local collection refuses to Sort by date Added. I thought the issue might be due to the front end, and thus I checked a more elaborate one, which led me to RompR, which seems to be favored by many. At least according a brief glance through the documentation led me to think, that also with RompR the album view can’t be sorted by Date Added / Newest first.

Which now leads me to a place where I’m wondering whether the Mopidy / MPD world is meant for me in the end, which would be a bummer after coming this far!

I wanted to ask - is the case really how I just reasoned or am I just missing something? Is it not possible to sort my music via Mopidy/MPD by Date Added? Or maybe there’s an awesome front-end that I don’t know of, that would allow for all sorts of customized sorting with some sort of clever customizable column system, a la Rekordbox, that I don’t know of?

(I’m not looking for a automatic/smart playlist-based option)

You can see the fields we currently support in our data model documentation. There is a last modified field:


Integer representing when the track was last modified. Exact meaning depends on source of track. For local files this is the modification time in milliseconds since Unix epoch. For other backends it could be an equivalent timestamp or simply a version counter.

But I dont think many backends support it. Local does, and I believe you can use the configurable directory functionality to add an entry for recently added tracks. Don’t ask me the syntax for that though… Maybe you can find it with a search on here.

There’s also an album release date field. That should be much better supported by backends.

1 Like

Hey @kingosticks!

Thanks for the swift reply and insights ( once again! )!

Hmm, the ‘last modified’ would do the job pretty closely actually! Thanks for pointing me towards the data model docu. And actually, now that I look closer, when I sort my files with Nautilus, or CLI even, the field I’m always looking at is Date Modified, not Date Added, so it’s pretty darn close!

What do you mean with configurable directory functionality exactly?
I couldn’t find anything with a quick search.

And since we are getting closer to an answer here, could I maybe ask whether you’d be aware of a Mopidy/MPD front-end with support of ‘date modified’ field for local-files?

Thanks again for your time! Knowing that at least the back-end supports ‘date modified’ has partly revived my hope towards my personal utopian music server implementation!

It has a configuration option which allows you to add custom stuff to the browse list:

local/directories : List of top-level directory names and URIs for browsing.

The default value (below) has two options which might be close to what you want:

# top-level directories for browsing, as <name> <uri>
directories =
    Albums                  local:directory?type=album
    Artists                 local:directory?type=artist
    Composers               local:directory?type=artist&role=composer
    Genres                  local:directory?type=genre
    Performers              local:directory?type=artist&role=performer
    Release Years           local:directory?type=date&format=%25Y
    Tracks                  local:directory?type=track
    Last Week's Updates     local:directory?max-age=604800
    Last Month's Updates    local:directory?max-age=2592000

And since we are getting closer to an answer here, could I maybe ask whether you’d be aware of a Mopidy/MPD front-end with support of ‘date modified’ field for local-files?

Anything that supports browsing will let you access the “Last Month’s Updates” (or similar) folder above. Other than that I can’t help, you’ll have to try some.

1 Like

Actually, I’ve just realised that Mopidy-MPD doesn’t output the Last-Modified field in it’s track info so even if you found an MPD client with true support for it, it wouldn’t work with Mopidy. That’s pretty easy to fix if someone was interested in doing so.

EDIT! I am going mad, all of the above is rubbish. It does support that field.

Hey @kingosticks

Thanks for your insights again!

Re: configurable directory functionality:
Oh, yeah now I get it! We are talking of the “Browse” options and it’s features. Thanks for pointing out it’s customizable as well, I never tweaked ‘local’ really, and hadn’t realized the directories are also customizable! Thanks for the heads up!

And now after thinking about this thing for a couple of days, and looking at the ‘data model’ implementation ( thanks for pointing me towards the docu, I hadn’t really looked so far under the hood yet ), I think the main problem, that also the ‘Iris’ front-end developers pointed me towards, is that the data model doesn’t provide ‘date modified’ for Albums, and thus sorting by Date Added/Modified is not easily supported when looking at albums. Maybe there would be some sort of a work-around involving looking at the ‘Date Modified’ of tracks, and then sorting Albums using that info, but at least the ‘Iris’ developers hadn’t found a way.

Also, I checked RompR in the meanwhile and confirmed I can’t sort my Music Collection / Albums by Date Modified / Added as I suspected.

The quest continues…

I think that workaround should work OK but I see Iris has implemented something now anyway. Exposing an album last modified field is a bit abstract, where would we stop? Artist last modified? Genre last modified? Like mpd (the program), everything revolves around tracks. So while we could work out the album last modified from the associated tracks, it might be a potentially expensive operation for Internet-based backends (and difficult to cache. Not sure about this.

Hey @kingosticks!

Yes, the Iris team has answered to my prayers and actually implemented album sort based on 'last_modified" as given by the tracks inside the albums! Soooooo gooooood! So yes, the work-around is pretty much a solution.

Also, I agree with your reasoning on ‘where to stop’. But I do think being able to see one’s music acquisitions in a chronological order in the library is quite essential. My analogy would be buying new LPs/CDs/tapes and then having them next to your record player as the latest things to listen to. And since it’s always been a feature in all the digital music platforms that I can think of right now, I was feeling confused at first when I wasn’t able to sort my Mopidy collection based on that info.

Anyways, sorry for my long ramblings. Everything seems to be in order now and I’m quite excited for this!