fix: recently added items sort order in the homepage

.ie. stop relying on folder last mod date, and use the latest file from the folder

+ bump watchdog to v4
+ add WIP docs (stashed in .github/code.docs for now)
This commit is contained in:
mungai-njoroge
2024-02-16 21:30:42 +03:00
parent ec5889515b
commit 4f48c33009
20 changed files with 331 additions and 60 deletions
+4 -3
View File
@@ -4,6 +4,7 @@ import random
from app.db.sqlite.albumcolors import SQLiteAlbumMethods as aldb
from app.models import Album, Track
from app.utils.customlist import CustomList
from app.utils.remove_duplicates import remove_duplicates
from ..utils.hashing import create_hash
@@ -14,7 +15,7 @@ ALBUM_LOAD_KEY = ""
class AlbumStore:
albums: list[Album] = []
albums: list[Album] = CustomList()
@staticmethod
def create_album(track: Track):
@@ -35,7 +36,7 @@ class AlbumStore:
global ALBUM_LOAD_KEY
ALBUM_LOAD_KEY = instance_key
cls.albums = []
cls.albums = CustomList()
print("Loading albums... ", end="")
tracks = remove_duplicates(TrackStore.tracks)
@@ -172,4 +173,4 @@ class AlbumStore:
"""
Removes an album from the store.
"""
cls.albums = [a for a in cls.albums if a.albumhash != albumhash]
cls.albums = CustomList(a for a in cls.albums if a.albumhash != albumhash)