Kodi Community Forum

Full Version: Recently Added Albums Sort Order Incorrect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I’ve been struggling with this for a while and finally realised Recently Added Albums is sorted by Artist. I believe (and would like) to have this sorted by Date Added. That’s what Recently added implies to me. Kodi has only had the Artist sort order recently, maybe 18.5?

It’s not the skin (Aeon Nox Silvo) as I also get the same order on my iPad Kodi Music app.

THX
Garry
Garry, actually it gets sorted by idAlbum which when you have rescanned your entire library looks a lot like by artist.

It has been like that since v16 I think, because dateadded is usually the file timestamp (rather than being the time the item was first added to the library). So scan an old file into your library and it didn't show as recenltly added, while using idAlbum it did.  But when everything gets rescanned the results are not helpful.

I have WIP to fix this - store both the file timestamp, the actual date that the item was fist added to the library and when it was modified. Then we can have both "recently added" (based on adding it to the library) and "recent" (as in from a new file) nodes, and one day do proper differential sync for remote apps too.

It would also help if dateadded was available as a smart playlist sort order for albums and songs, then you could at least make your own custom node
(2020-02-29, 10:07)DaveBlake Wrote: [ -> ]Garry, actually it gets sorted by idAlbum which when you have rescanned your entire library looks a lot like by artist.

It has been like that since v16 I think, because dateadded is usually the file timestamp (rather than being the time the item was first added to the library). So scan an old file into your library and it didn't show as recenltly added, while using idAlbum it did.  But when everything gets rescanned the results are not helpful.

I have WIP to fix this - store both the file timestamp, the actual date that the item was fist added to the library and when it was modified. Then we can have both "recently added" (based on adding it to the library) and "recent" (as in from a new file) nodes, and one day do proper differential sync for remote apps too.

It would also help if dateadded was available as a smart playlist sort order for albums and songs, then you could at least make your own custom node

Thanks for the info Dave.

So maybe it’s not in the correct order as I added quite a few new albums recently and they don’t appear at the top of the list as I’d expect from your reply. I’ve got an advanced setting to show 150 recent albums but the list doesn’t show the most recent. I’ve added more than 150 BTW, but many are way older than that (added a long time ago).

I did a complete scan of my library a while back but the new additions are post that scan. It doesn’t seem right as the albums are new to Kodi since the original rescan.

I have done a rescan using the ‘read tags even if file hasn’t changes’ (or similar description). Is it possible albumIds change with that option as the current recent list is mainly artists at the end alphabetically, old additions.

Does this make sense?

I think I remember albums are scanned in Artist order, but even then new albums must have a higher albumId. Seems there’s something else in the ordering?
(2020-02-29, 12:32)HomerJau Wrote: [ -> ]I have done a rescan using the ‘read tags even if file hasn’t changes’ (or similar description). Is it possible albumIds change with that option as the current recent list is mainly artists at the end alphabetically, old additions.

Does this make sense?
Yes album IDs change, and yes it makes sense (although it obviously isn't ideal behaviour).

The rescan runs through all the folder paths in the path table in the order they occur. This will be alphabetic when you first scan a music source, but if you have updated the library as you go along then the new ones get appended at the bottom. It also scans recursively through each folder, and so can get to a path that is listed later in the table.

I am sure it is album ID that is giving you the results you are seeing, but if you like turn on debugging and have a look at the SQL it uses. It will be
Code:
SELECT albumview.*, albumartistview.* FROM
(SELECT idAlbum FROM album WHERE strAlbum != '' ORDER BY idAlbum DESC LIMIT %u) AS recentalbums "
JOIN albumview ON albumview.idAlbum = recentalbums.idAlbum "
JOIN albumartistview ON albumview.idAlbum = albumartistview.idAlbum "
ORDER BY albumview.idAlbum desc, albumartistview.iOrder
I thought we had discussed this before garry, see https://forum.kodi.tv/showthread.php?tid=336838 Smile
Thanks Dave. I’ll take a look in the morning (late here now).

Looks like the reason I’m getting this issue is the Scan with Reread tags option.

This is the same issue we discussed ages ago. I just didn’t realise the Recan with Reread was a rebuild of the entire music library. The original issue we discussed was when I’d do a new Kodi install and a new library dB was created.

I can solve my current problem by removing the new Source (with the new albums) and add it again, since all the new are in a new Source.

However, I’m pretty sure I only did the Rescan with ReRead Tags option on the new source (long click on source, from pop up menu). Is it possible that would trigger a rescan on all sources?
What you see is reverse albumid order, how exactly your albums got into that order is another matter but will be scan related.

Bottom line is that I need to get this fixed in v19. Short fix is to revert to using dateadded (and seeing recent files regardless of when they were actually added) but I hope to do much better than that.
Thanks for your continued support Dave. I’m very pleased to hear you may have a fix in v19!