update playlists

This commit is contained in:
JMARyA 2024-08-12 03:43:08 +02:00
parent 82c330cc13
commit 87ad77907b
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
5 changed files with 39 additions and 2 deletions

View file

@ -37,7 +37,7 @@ impl Artist {
let artist_path = track_path.parent()?.parent()?;
for ext in ["png", "jpg", "jpeg", "avif"] {
for ext in ["png", "jpg", "jpeg", "avif", "webp"] {
let cover_file = artist_path.join(format!("artist.{ext}"));
if cover_file.exists() {

View file

@ -65,6 +65,7 @@ impl ToAPI for Playlist {
serde_json::json!({
"id": self._id,
"owner": self.owner.id(),
"visibility": serde_json::to_value(&self.visibility).unwrap(),
"title": self.title,
"tracks": self.tracks.iter().map(|x| x.id()).collect::<Vec<_>>()
})