add latest albums

This commit is contained in:
JMARyA 2024-08-13 01:26:55 +02:00
parent c93f0ea403
commit a5d3c14f0c
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 49 additions and 4 deletions

View file

@ -8,6 +8,8 @@ use serde_json::json;
use track::Track;
use walkdir::WalkDir;
use crate::cache::RouteCache;
pub mod album;
pub mod artist;
pub mod metadata;
@ -164,7 +166,9 @@ impl Libary {
Track::get(track_id).await
}
pub async fn rescan(&self) {
pub async fn rescan(&self, cache: &RouteCache) {
cache.invalidate("albums", "latest").await;
log::info!("Rescanning library");
for entry in WalkDir::new(self.root_dir.clone())
.follow_links(true)