Update lofty version

This commit is contained in:
CDrummond 2025-03-05 19:10:47 +00:00
parent 5e5bd9841a
commit 302609ed1b
4 changed files with 42 additions and 39 deletions

53
Cargo.lock generated
View File

@ -94,12 +94,6 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "base64"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]] [[package]]
name = "bindgen" name = "bindgen"
version = "0.64.0" version = "0.64.0"
@ -137,7 +131,7 @@ dependencies = [
"regex", "regex",
"rustc-hash", "rustc-hash",
"shlex", "shlex",
"syn 2.0.32", "syn 2.0.99",
] ]
[[package]] [[package]]
@ -380,6 +374,12 @@ dependencies = [
"lazy_static", "lazy_static",
] ]
[[package]]
name = "data-encoding"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010"
[[package]] [[package]]
name = "dirs" name = "dirs"
version = "1.0.5" version = "1.0.5"
@ -730,29 +730,28 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]] [[package]]
name = "lofty" name = "lofty"
version = "0.16.1" version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c18ba58211b3c3557970755d7afc3a7438c2d4557bcd684470b2195c0ae66e53" checksum = "781de624f162b1a8cbfbd577103ee9b8e5f62854b053ff48f4e31e68a0a7df6f"
dependencies = [ dependencies = [
"base64 0.21.7",
"byteorder", "byteorder",
"data-encoding",
"flate2", "flate2",
"lofty_attr", "lofty_attr",
"log", "log",
"ogg_pager", "ogg_pager",
"once_cell",
"paste", "paste",
] ]
[[package]] [[package]]
name = "lofty_attr" name = "lofty_attr"
version = "0.9.0" version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "764b60e1ddd07e5665a6a17636a95cd7d8f3b86c73503a69c32979d05f72f3cf" checksum = "ed9983e64b2358522f745c1251924e3ab7252d55637e80f6a0a3de642d6a9efc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.32", "syn 2.0.99",
] ]
[[package]] [[package]]
@ -901,9 +900,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]] [[package]]
name = "ogg_pager" name = "ogg_pager"
version = "0.5.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d218a406e5de88e1c492d0162d569916f7436efe851ba5cc40a4bf4fa97cb40" checksum = "e034c10fb5c1c012c1b327b85df89fb0ef98ae66ec28af30f0d1eed804a40c19"
dependencies = [ dependencies = [
"byteorder", "byteorder",
] ]
@ -961,18 +960,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.66" version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.32" version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -1123,7 +1122,7 @@ version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
dependencies = [ dependencies = [
"base64 0.13.0", "base64",
"blake2b_simd", "blake2b_simd",
"constant_time_eq", "constant_time_eq",
"crossbeam-utils", "crossbeam-utils",
@ -1244,7 +1243,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.32", "syn 2.0.99",
] ]
[[package]] [[package]]
@ -1396,9 +1395,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.32" version = "2.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1441,7 +1440,7 @@ checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.32", "syn 2.0.99",
] ]
[[package]] [[package]]
@ -1551,7 +1550,7 @@ version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9399fa2f927a3d327187cbd201480cee55bee6ac5d3c77dd27f0c6814cff16d5" checksum = "9399fa2f927a3d327187cbd201480cee55bee6ac5d3c77dd27f0c6814cff16d5"
dependencies = [ dependencies = [
"base64 0.13.0", "base64",
"chunked_transfer", "chunked_transfer",
"flate2", "flate2",
"log", "log",
@ -1832,5 +1831,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.32", "syn 2.0.99",
] ]

View File

@ -16,7 +16,7 @@ rusqlite = { version = "0.28.0", features = ["bundled"] }
log = "0.4.14" log = "0.4.14"
env_logger = "0.8.4" env_logger = "0.8.4"
indicatif = "0.16.2" indicatif = "0.16.2"
lofty = "0.16.1" lofty = "0.22.2"
dirs = "1" dirs = "1"
chrono = "0.4.19" chrono = "0.4.19"
regex = "1" regex = "1"

View File

@ -1,17 +1,18 @@
0.3.0 0.3.0
----- -----
1. Add support for (DSD) WavPack - thanks to Bart Lauret 1. Add support for (DSD) WavPack - thanks to Bart Lauret
2. Update version of bliss library. 2. Update version of tag reader library.
3. Use 'ffmpeg' commandline to decode files, and not ffmpeg libraries by 3. Update version of bliss library.
defualt. Pass '--features=libav' to cargo to build against ffmpeg 4. Use 'ffmpeg' commandline to decode files, and not ffmpeg libraries by
default. Pass '--features=libav' to cargo to build against ffmpeg
libraries. Pass '--features=libav,libavstatic' to cargo to build against libraries. Pass '--features=libav,libavstatic' to cargo to build against
ffmpeg libraries, and statically link these in. ffmpeg libraries, and statically link these in.
4. Add ability to specify LMS JSONRPC port. 5. Add ability to specify LMS JSONRPC port.
5. If new files analysed and 'ignore' file exists then update DB's 'ignore' 6. If new files analysed and 'ignore' file exists then update DB's 'ignore'
flags. flags.
6. Add option to write analysis results to files, and use for future scans. 7. Add option to write analysis results to files, and use for future scans.
7. If log level set to 'trace' then set this level for the Bliss library too. 8. If log level set to 'trace' then set this level for the bliss library too.
8. Enable support for '.dsf' files. 9. Enable support for '.dsf' files.
0.2.3 0.2.3
----- -----

View File

@ -7,7 +7,10 @@
**/ **/
use crate::db; use crate::db;
use lofty::{Accessor, AudioFile, ItemKey, ItemValue, Tag, TagExt, TaggedFileExt, TagItem}; use lofty::config::WriteOptions;
use lofty::file::FileType;
use lofty::prelude::{Accessor, AudioFile, ItemKey, TagExt, TaggedFileExt};
use lofty::tag::{ItemValue, Tag, TagItem};
use regex::Regex; use regex::Regex;
use std::path::Path; use std::path::Path;
use substring::Substring; use substring::Substring;
@ -55,7 +58,7 @@ pub fn write_analysis(track: &String, analysis: &Analysis) {
// Store analysis results // Store analysis results
tag.push(TagItem::new(ANALYSIS_TAG, ItemValue::Text(value))); tag.push(TagItem::new(ANALYSIS_TAG, ItemValue::Text(value)));
let _ = tag.save_to_path(Path::new(track)); let _ = tag.save_to_path(Path::new(track), WriteOptions::default());
} }
} }
@ -78,7 +81,7 @@ pub fn read(track: &String, read_analysis: bool) -> db::Metadata {
meta.genre = tag.genre().unwrap_or_default().to_string(); meta.genre = tag.genre().unwrap_or_default().to_string();
// Check whether MP3 has numeric genre, and if so covert to text // Check whether MP3 has numeric genre, and if so covert to text
if file.file_type().eq(&lofty::FileType::Mpeg) { if file.file_type().eq(&FileType::Mpeg) {
match tag.genre() { match tag.genre() {
Some(genre) => { Some(genre) => {
let test = genre.parse::<u8>(); let test = genre.parse::<u8>();