feat!: playlists

This commit is contained in:
2024-12-01 03:48:51 +01:00
parent 634c147ee9
commit a652ae330f
11 changed files with 456 additions and 57 deletions

View File

@@ -1,8 +1,8 @@
use std::{fs, path::Path};
use image::EncodableLayout;
use webp::Encoder;
use axum::Router;
use image::EncodableLayout;
use std::{fs, path::Path};
use tower_http::services::ServeDir;
use webp::Encoder;
use crate::music::metadata::CoverData;
@@ -40,7 +40,11 @@ pub fn get_all_cover_hashes() -> Vec<String> {
hashes
}
pub fn write_cover(hash: &str, cover: &CoverData, base_path: &str) -> Result<(), Box<dyn std::error::Error>> {
pub fn write_cover(
hash: &str,
cover: &CoverData,
base_path: &str,
) -> Result<(), Box<dyn std::error::Error>> {
if cover.mime_type != "image/jpeg"
&& cover.mime_type != "image/png"
&& cover.mime_type != "image/webp"