Use TDOR frame for ID3v2 to populate year

This commit is contained in:
Antoine Gersant 2022-11-24 20:22:35 -08:00
parent eaec68dff0
commit a8660793f8
4 changed files with 5 additions and 4 deletions

View file

@ -14,9 +14,10 @@
- Fixed a bug where all music sources would be deleted when trying to add sources with duplicate names - Fixed a bug where all music sources would be deleted when trying to add sources with duplicate names
- Additional metadata fields are now indexed: lyricist, composer, genre and label (thanks @pmphfm) - Additional metadata fields are now indexed: lyricist, composer, genre and label (thanks @pmphfm)
- Endpoints returning thumbnail images or audio files no longer use HTTP `content-encoding` - Endpoints returning thumbnail images or audio files no longer use HTTP `content-encoding`
- When indexing files with ID3v2 tags, the "Original Date Released" frame can now be used to populate the year associated with a song
- The `/thumbnail` endpoint now supports an optional parameter for small/large/native image sizing. (thanks @Saecki) - The `/thumbnail` endpoint now supports an optional parameter for small/large/native image sizing. (thanks @Saecki)
- Log file now contain more details about the cause of failed HTTP requests (3xx, 4xx, 5xx) - Log file now contain more details about the cause of failed HTTP requests (3xx, 4xx, 5xx)
- Startup errors emit clearer messages - Startup failures now generate clearer error messages
### Web client ### Web client

3
Cargo.lock generated
View file

@ -956,8 +956,7 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]] [[package]]
name = "id3" name = "id3"
version = "1.4.0" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/polyfloyd/rust-id3.git?rev=f3b5e3a#f3b5e3ac324c07c2cd5364469734ffb7a0228f77"
checksum = "cb0342a234e9df58f34a65b31580937414568ac60410674930939977112208f6"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"byteorder", "byteorder",

View file

@ -22,7 +22,7 @@ diesel_migrations = { version = "2.0", features = ["sqlite"] }
futures-util = { version = "0.3" } futures-util = { version = "0.3" }
getopts = "0.2.21" getopts = "0.2.21"
http = "0.2.8" http = "0.2.8"
id3 = "1.4.0" id3 = { git = "https://github.com/polyfloyd/rust-id3.git", rev = "f3b5e3a" } # TODO update after 1.5.0 is released
lewton = "0.10.2" lewton = "0.10.2"
libsqlite3-sys = { version = "0.25", features = ["bundled", "bundled-windows"], optional = true } libsqlite3-sys = { version = "0.25", features = ["bundled", "bundled-windows"], optional = true }
log = "0.4.17" log = "0.4.17"

View file

@ -58,6 +58,7 @@ impl From<id3::Tag> for SongTags {
.year() .year()
.map(|y| y as i32) .map(|y| y as i32)
.or_else(|| tag.date_released().map(|d| d.year)) .or_else(|| tag.date_released().map(|d| d.year))
.or_else(|| tag.original_date_released().map(|d| d.year))
.or_else(|| tag.date_recorded().map(|d| d.year)); .or_else(|| tag.date_recorded().map(|d| d.year));
let has_artwork = tag.pictures().count() > 0; let has_artwork = tag.pictures().count() > 0;
let lyricist = tag.get_text("TEXT"); let lyricist = tag.get_text("TEXT");