fix date added sorting

This commit is contained in:
Core 2022-09-10 20:59:57 +01:00
parent e1b1dc3fec
commit 5099d41260

View file

@ -2388,10 +2388,8 @@ const app = new Vue({
aa = a.attributes.genreNames[0]; aa = a.attributes.genreNames[0];
bb = b.attributes.genreNames[0]; bb = b.attributes.genreNames[0];
} else if (prefs.sort == "dateAdded") { } else if (prefs.sort == "dateAdded") {
let albumida = a.relationships?.albums?.data[0]?.id; aa = a.relationships?.albums?.data[0]?.attributes?.dateAdded;
let albumidb = b.relationships?.albums?.data[0]?.id; bb = b.relationships?.albums?.data[0]?.attributes?.dateAdded;
aa = startTime - new Date(albumAdded[albumida] ?? "1970-01-01T00:01:01Z").getTime();
bb = startTime - new Date(albumAdded[albumidb] ?? "1970-01-01T00:01:01Z").getTime();
} }
if (aa == null) { if (aa == null) {
aa = ""; aa = "";