add latest albums
This commit is contained in:
parent
c93f0ea403
commit
a5d3c14f0c
4 changed files with 49 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue