mirror of
https://github.com/Dangoware/dango-music-player.git
synced 2025-04-19 01:52:53 -05:00
Updated dependencies, removed unused deps
This commit is contained in:
parent
69c3cd7427
commit
2dd455d81c
4 changed files with 13 additions and 31 deletions
|
@ -13,15 +13,7 @@ categories = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
kushi = { path = "../kushi-queue" }
|
kushi = { path = "../kushi-queue" }
|
||||||
file-format = { version = "0.23.0", features = [
|
file-format = { version = "0.26", features = ["reader"] }
|
||||||
"reader-asf",
|
|
||||||
"reader-ebml",
|
|
||||||
"reader-mp4",
|
|
||||||
"reader-rm",
|
|
||||||
"reader-txt",
|
|
||||||
"reader-xml",
|
|
||||||
"serde",
|
|
||||||
] }
|
|
||||||
lofty = "0.21"
|
lofty = "0.21"
|
||||||
serde = { version = "1.0.195", features = ["derive"] }
|
serde = { version = "1.0.195", features = ["derive"] }
|
||||||
walkdir = "2.4.0"
|
walkdir = "2.4.0"
|
||||||
|
@ -39,16 +31,10 @@ thiserror = "1.0.56"
|
||||||
uuid = { version = "1.6.1", features = ["v4", "serde"] }
|
uuid = { version = "1.6.1", features = ["v4", "serde"] }
|
||||||
serde_json = "1.0.111"
|
serde_json = "1.0.111"
|
||||||
deunicode = "1.4.2"
|
deunicode = "1.4.2"
|
||||||
opener = { version = "0.7.0", features = ["reveal"] }
|
|
||||||
tempfile = "3.10.1"
|
|
||||||
nestify = "0.3.3"
|
nestify = "0.3.3"
|
||||||
moro = "0.4.0"
|
moro = "0.4.0"
|
||||||
moro-local = "0.4.0"
|
|
||||||
futures = "0.3.30"
|
futures = "0.3.30"
|
||||||
text_io = "0.1.12"
|
|
||||||
tokio = { version = "1.40.0", features = ["macros", "rt"] }
|
|
||||||
async-channel = "2.3.1"
|
async-channel = "2.3.1"
|
||||||
ciborium = "0.2.2"
|
ciborium = "0.2.2"
|
||||||
itertools = "0.13.0"
|
itertools = "0.13.0"
|
||||||
directories = "5.0.1"
|
|
||||||
prismriver = { git = "https://github.com/Dangoware/prismriver.git" }
|
prismriver = { git = "https://github.com/Dangoware/prismriver.git" }
|
||||||
|
|
|
@ -188,7 +188,7 @@ impl ExternalLibrary for ITunesLibrary {
|
||||||
},
|
},
|
||||||
rating: track.rating,
|
rating: track.rating,
|
||||||
format: match FileFormat::from_file(PathBuf::from(&loc)) {
|
format: match FileFormat::from_file(PathBuf::from(&loc)) {
|
||||||
Ok(e) => Some(e),
|
Ok(e) => Some(e.media_type().to_string()),
|
||||||
Err(_) => None,
|
Err(_) => None,
|
||||||
},
|
},
|
||||||
duration: dur,
|
duration: dur,
|
||||||
|
|
|
@ -90,7 +90,7 @@ pub enum Field {
|
||||||
Skips(i32),
|
Skips(i32),
|
||||||
Favorited(bool),
|
Favorited(bool),
|
||||||
Rating(u8),
|
Rating(u8),
|
||||||
Format(FileFormat),
|
Format(String),
|
||||||
Duration(Duration),
|
Duration(Duration),
|
||||||
PlayTime(Duration),
|
PlayTime(Duration),
|
||||||
LastPlayed(DateTime<Utc>),
|
LastPlayed(DateTime<Utc>),
|
||||||
|
@ -106,10 +106,7 @@ impl ToString for Field {
|
||||||
Self::Skips(skips) => skips.to_string(),
|
Self::Skips(skips) => skips.to_string(),
|
||||||
Self::Favorited(fav) => fav.to_string(),
|
Self::Favorited(fav) => fav.to_string(),
|
||||||
Self::Rating(rating) => rating.to_string(),
|
Self::Rating(rating) => rating.to_string(),
|
||||||
Self::Format(format) => match format.short_name() {
|
Self::Format(format) => format.clone(),
|
||||||
Some(name) => name.to_string(),
|
|
||||||
None => format.to_string(),
|
|
||||||
},
|
|
||||||
Self::Duration(duration) => duration.as_millis().to_string(),
|
Self::Duration(duration) => duration.as_millis().to_string(),
|
||||||
Self::PlayTime(time) => time.as_millis().to_string(),
|
Self::PlayTime(time) => time.as_millis().to_string(),
|
||||||
Self::LastPlayed(last) => last.to_rfc2822(),
|
Self::LastPlayed(last) => last.to_rfc2822(),
|
||||||
|
@ -167,7 +164,8 @@ pub struct Song {
|
||||||
pub favorited: bool,
|
pub favorited: bool,
|
||||||
pub banned: Option<BannedType>,
|
pub banned: Option<BannedType>,
|
||||||
pub rating: Option<u8>,
|
pub rating: Option<u8>,
|
||||||
pub format: Option<FileFormat>,
|
/// MIME type
|
||||||
|
pub format: Option<String>,
|
||||||
pub duration: Duration,
|
pub duration: Duration,
|
||||||
pub play_time: Duration,
|
pub play_time: Duration,
|
||||||
#[serde(with = "ts_milliseconds_option")]
|
#[serde(with = "ts_milliseconds_option")]
|
||||||
|
@ -207,7 +205,7 @@ impl Song {
|
||||||
"rating" => self.rating.map(Field::Rating),
|
"rating" => self.rating.map(Field::Rating),
|
||||||
"duration" => Some(Field::Duration(self.duration)),
|
"duration" => Some(Field::Duration(self.duration)),
|
||||||
"play_time" => Some(Field::PlayTime(self.play_time)),
|
"play_time" => Some(Field::PlayTime(self.play_time)),
|
||||||
"format" => self.format.map(Field::Format),
|
"format" => self.format.clone().map(|m| Field::Format(m)),
|
||||||
_ => todo!(), // Other field types are not yet supported
|
_ => todo!(), // Other field types are not yet supported
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,7 +307,7 @@ impl Song {
|
||||||
favorited: false,
|
favorited: false,
|
||||||
banned: None,
|
banned: None,
|
||||||
rating: None,
|
rating: None,
|
||||||
format,
|
format: format.map(|f| f.media_type().to_string()),
|
||||||
duration,
|
duration,
|
||||||
play_time: Duration::from_secs(0),
|
play_time: Duration::from_secs(0),
|
||||||
last_played: None,
|
last_played: None,
|
||||||
|
@ -432,7 +430,7 @@ impl Song {
|
||||||
favorited: false,
|
favorited: false,
|
||||||
banned: None,
|
banned: None,
|
||||||
rating: None,
|
rating: None,
|
||||||
format,
|
format: format.map(|f| f.media_type().to_string()),
|
||||||
duration,
|
duration,
|
||||||
play_time: Duration::from_secs(0),
|
play_time: Duration::from_secs(0),
|
||||||
last_played: None,
|
last_played: None,
|
||||||
|
|
|
@ -2,15 +2,13 @@ use std::{collections::BTreeMap, path::PathBuf};
|
||||||
|
|
||||||
use chrono::{DateTime, Utc, serde::ts_milliseconds_option};
|
use chrono::{DateTime, Utc, serde::ts_milliseconds_option};
|
||||||
use crossbeam::channel::Sender;
|
use crossbeam::channel::Sender;
|
||||||
use dmp_core::{music_controller::controller::{ControllerHandle, LibraryCommand, LibraryResponse, PlayerResponse, QueueCommand, QueueResponse}, music_storage::library::{BannedType, Song, Tag, URI}};
|
use dmp_core::{music_controller::controller::{ControllerHandle, LibraryCommand, LibraryResponse, PlayerResponse, QueueCommand, QueueResponse}, music_storage::library::{Song, Tag, URI}};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use kushi::QueueItemType;
|
use kushi::QueueItemType;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use tauri::{ipc::Response, AppHandle, Emitter, State, Wry};
|
use tauri::{AppHandle, Emitter, State, Wry};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::commands;
|
|
||||||
|
|
||||||
pub struct ArtworkRx(pub Sender<Vec<u8>>);
|
pub struct ArtworkRx(pub Sender<Vec<u8>>);
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
@ -120,7 +118,7 @@ impl From<&Song> for _Song {
|
||||||
uuid: value.uuid.clone(),
|
uuid: value.uuid.clone(),
|
||||||
plays: value.plays.clone(),
|
plays: value.plays.clone(),
|
||||||
duration: value.duration.as_secs().to_string(),
|
duration: value.duration.as_secs().to_string(),
|
||||||
format: value.format.map(|format| format.to_string()),
|
format: value.format.clone().map(|format| format.to_string()),
|
||||||
last_played: value.last_played,
|
last_played: value.last_played,
|
||||||
date_added: value.date_added,
|
date_added: value.date_added,
|
||||||
date_modified: value.date_modified,
|
date_modified: value.date_modified,
|
||||||
|
@ -190,4 +188,4 @@ pub async fn get_song(ctrl_handle: State<'_, ControllerHandle>) -> Result<_Song,
|
||||||
let LibraryResponse::Song(song, _) = ctrl_handle.lib_mail.recv().await.unwrap() else { unreachable!("It has been reached") };
|
let LibraryResponse::Song(song, _) = ctrl_handle.lib_mail.recv().await.unwrap() else { unreachable!("It has been reached") };
|
||||||
println!("got song {}", &song.tags.get(&Tag::Title).unwrap_or(&String::new()));
|
println!("got song {}", &song.tags.get(&Tag::Title).unwrap_or(&String::new()));
|
||||||
Ok(_Song::from(&song))
|
Ok(_Song::from(&song))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue