Merge f625c57d20
into release
This commit is contained in:
commit
044f2de249
6 changed files with 38 additions and 22 deletions
44
Cargo.lock
generated
44
Cargo.lock
generated
|
@ -257,7 +257,7 @@ dependencies = [
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"socket2 0.5.3",
|
"socket2 0.5.3",
|
||||||
"time 0.3.28",
|
"time 0.3.36",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
|
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"time 0.3.28",
|
"time 0.3.36",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -684,9 +684,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deranged"
|
name = "deranged"
|
||||||
version = "0.3.8"
|
version = "0.3.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946"
|
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
|
||||||
|
dependencies = [
|
||||||
|
"powerfmt",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_more"
|
name = "derive_more"
|
||||||
|
@ -710,7 +713,7 @@ dependencies = [
|
||||||
"diesel_derives",
|
"diesel_derives",
|
||||||
"libsqlite3-sys",
|
"libsqlite3-sys",
|
||||||
"r2d2",
|
"r2d2",
|
||||||
"time 0.3.28",
|
"time 0.3.36",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1361,6 +1364,12 @@ dependencies = [
|
||||||
"winapi-build",
|
"winapi-build",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-conv"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-integer"
|
name = "num-integer"
|
||||||
version = "0.1.45"
|
version = "0.1.45"
|
||||||
|
@ -1593,6 +1602,12 @@ dependencies = [
|
||||||
"winres",
|
"winres",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "powerfmt"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ppv-lite86"
|
name = "ppv-lite86"
|
||||||
version = "0.2.17"
|
version = "0.2.17"
|
||||||
|
@ -2029,7 +2044,7 @@ checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
"time 0.3.28",
|
"time 0.3.36",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2205,24 +2220,26 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.3.28"
|
version = "0.3.36"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48"
|
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"deranged",
|
"deranged",
|
||||||
"itoa",
|
"itoa",
|
||||||
"libc",
|
"libc",
|
||||||
|
"num-conv",
|
||||||
"num_threads",
|
"num_threads",
|
||||||
|
"powerfmt",
|
||||||
"serde",
|
"serde",
|
||||||
"time-core",
|
"time-core",
|
||||||
"time-macros 0.2.14",
|
"time-macros 0.2.18",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-core"
|
name = "time-core"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
|
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-macros"
|
name = "time-macros"
|
||||||
|
@ -2236,10 +2253,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-macros"
|
name = "time-macros"
|
||||||
version = "0.2.14"
|
version = "0.2.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572"
|
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"num-conv",
|
||||||
"time-core",
|
"time-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ mod update;
|
||||||
|
|
||||||
pub use self::query::*;
|
pub use self::query::*;
|
||||||
pub use self::types::*;
|
pub use self::types::*;
|
||||||
pub use self::update::*;
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Index {
|
pub struct Index {
|
||||||
|
|
|
@ -86,14 +86,13 @@ impl From<id3::Tag> for SongTags {
|
||||||
pub fn read(path: &Path) -> Option<SongTags> {
|
pub fn read(path: &Path) -> Option<SongTags> {
|
||||||
let data = match utils::get_audio_format(path) {
|
let data = match utils::get_audio_format(path) {
|
||||||
Some(AudioFormat::AIFF) => read_aiff(path),
|
Some(AudioFormat::AIFF) => read_aiff(path),
|
||||||
Some(AudioFormat::APE) => read_ape(path),
|
|
||||||
Some(AudioFormat::FLAC) => read_flac(path),
|
Some(AudioFormat::FLAC) => read_flac(path),
|
||||||
Some(AudioFormat::MP3) => read_mp3(path),
|
Some(AudioFormat::MP3) => read_mp3(path),
|
||||||
Some(AudioFormat::MP4) => read_mp4(path),
|
|
||||||
Some(AudioFormat::MPC) => read_ape(path),
|
|
||||||
Some(AudioFormat::OGG) => read_vorbis(path),
|
Some(AudioFormat::OGG) => read_vorbis(path),
|
||||||
Some(AudioFormat::OPUS) => read_opus(path),
|
Some(AudioFormat::OPUS) => read_opus(path),
|
||||||
Some(AudioFormat::WAVE) => read_wave(path),
|
Some(AudioFormat::WAVE) => read_wave(path),
|
||||||
|
Some(AudioFormat::APE) | Some(AudioFormat::MPC) => read_ape(path),
|
||||||
|
Some(AudioFormat::MP4) | Some(AudioFormat::M4B) => read_mp4(path),
|
||||||
None => return None,
|
None => return None,
|
||||||
};
|
};
|
||||||
match data {
|
match data {
|
||||||
|
|
|
@ -98,8 +98,7 @@ impl Manager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut new_songs: Vec<NewPlaylistSong> = Vec::new();
|
let mut new_songs: Vec<NewPlaylistSong> = Vec::with_capacity(content.len());
|
||||||
new_songs.reserve(content.len());
|
|
||||||
|
|
||||||
for (i, path) in content.iter().enumerate() {
|
for (i, path) in content.iter().enumerate() {
|
||||||
let virtual_path = Path::new(&path);
|
let virtual_path = Path::new(&path);
|
||||||
|
|
|
@ -149,14 +149,13 @@ fn generate_thumbnail(image_path: &Path, options: &Options) -> Result<DynamicIma
|
||||||
fn read(image_path: &Path) -> Result<DynamicImage, Error> {
|
fn read(image_path: &Path) -> Result<DynamicImage, Error> {
|
||||||
match get_audio_format(image_path) {
|
match get_audio_format(image_path) {
|
||||||
Some(AudioFormat::AIFF) => read_aiff(image_path),
|
Some(AudioFormat::AIFF) => read_aiff(image_path),
|
||||||
Some(AudioFormat::APE) => read_ape(image_path),
|
|
||||||
Some(AudioFormat::FLAC) => read_flac(image_path),
|
Some(AudioFormat::FLAC) => read_flac(image_path),
|
||||||
Some(AudioFormat::MP3) => read_mp3(image_path),
|
Some(AudioFormat::MP3) => read_mp3(image_path),
|
||||||
Some(AudioFormat::MP4) => read_mp4(image_path),
|
|
||||||
Some(AudioFormat::MPC) => read_ape(image_path),
|
|
||||||
Some(AudioFormat::OGG) => read_vorbis(image_path),
|
Some(AudioFormat::OGG) => read_vorbis(image_path),
|
||||||
Some(AudioFormat::OPUS) => read_opus(image_path),
|
Some(AudioFormat::OPUS) => read_opus(image_path),
|
||||||
Some(AudioFormat::WAVE) => read_wave(image_path),
|
Some(AudioFormat::WAVE) => read_wave(image_path),
|
||||||
|
Some(AudioFormat::APE) | Some(AudioFormat::MPC) => read_ape(image_path),
|
||||||
|
Some(AudioFormat::MP4) | Some(AudioFormat::M4B) => read_mp4(image_path),
|
||||||
None => image::open(image_path).map_err(|e| Error::Image(image_path.to_owned(), e)),
|
None => image::open(image_path).map_err(|e| Error::Image(image_path.to_owned(), e)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ pub enum AudioFormat {
|
||||||
OGG,
|
OGG,
|
||||||
OPUS,
|
OPUS,
|
||||||
WAVE,
|
WAVE,
|
||||||
|
M4B,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_audio_format(path: &Path) -> Option<AudioFormat> {
|
pub fn get_audio_format(path: &Path) -> Option<AudioFormat> {
|
||||||
|
@ -46,6 +47,7 @@ pub fn get_audio_format(path: &Path) -> Option<AudioFormat> {
|
||||||
"ogg" => Some(AudioFormat::OGG),
|
"ogg" => Some(AudioFormat::OGG),
|
||||||
"opus" => Some(AudioFormat::OPUS),
|
"opus" => Some(AudioFormat::OPUS),
|
||||||
"wav" => Some(AudioFormat::WAVE),
|
"wav" => Some(AudioFormat::WAVE),
|
||||||
|
"m4b" => Some(AudioFormat::M4B),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue