🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
fix(scanner): map ORIGYEAR tag for VorbisComment and MP4 formats
obskyr7834674381d8
diff --git a/adapters/gotaglib/gotaglib_test.go b/adapters/gotaglib/gotaglib_test.goindex 8fdf5b406..6756fb690 100644--- a/adapters/gotaglib/gotaglib_test.go+++ b/adapters/gotaglib/gotaglib_test.go@@ -127,6 +127,17 @@ var _ = Describe("Extractor", func() {Expect(m.Tags).To(HaveKeyWithValue("albumartist", []string{"Album Artist"}))Expect(m.Tags).To(HaveKeyWithValue("genre", []string{"Rock"}))Expect(m.Tags).To(HaveKeyWithValue("date", []string{"2014"}))+ // Still as of TagLib v2.2.1, TagLib only maps values in ID3, MP4, and ASF tags+ // to `originaldate`.+ if strings.HasSuffix(file, ".mp3") || strings.HasSuffix(file, ".wav") || strings.HasSuffix(file, ".aiff") || strings.HasSuffix(file, ".m4a") || strings.HasSuffix(file, ".wma") {+ Expect(m.Tags).To(HaveKeyWithValue("originaldate", []string{"1996-11-21"}))+ }+ // MP3Tag sets `ORIGYEAR` in several formats for which it has no built-in mapping+ // for original release dates.+ Expect(m.Tags).To(Or(+ HaveKeyWithValue("origyear", []string{"1998-07-28"}),+ HaveKeyWithValue("----:com.apple.itunes:origyear", []string{"1998-07-28"}),+ ))Expect(m.Tags).To(HaveKeyWithValue("bpm", []string{"123"}))Expect(m.Tags).To(Or(diff --git a/resources/mappings.yaml b/resources/mappings.yamlindex 19ba0b090..16dddd504 100644--- a/resources/mappings.yaml+++ b/resources/mappings.yaml@@ -116,7 +116,7 @@ main:aliases: [ comm:description, comment, ©cmt, description, icmt ]maxLength: 4096originaldate:- aliases: [ tdor, originaldate, ----:com.apple.itunes:originaldate, wm/originalreleasetime, tory, originalyear, ----:com.apple.itunes:originalyear, wm/originalreleaseyear ]+ aliases: [ tdor, originaldate, ----:com.apple.itunes:originaldate, wm/originalreleasetime, tory, originalyear, ----:com.apple.itunes:originalyear, wm/originalreleaseyear, origyear, ----:com.apple.itunes:origyear ]type: daterecordingdate:aliases: [ tdrc, date, recordingdate, icrd, record date ]diff --git a/tests/fixtures/01 Invisible (RED) Edit Version.m4a b/tests/fixtures/01 Invisible (RED) Edit Version.m4aindex 005792eb5..76b61a2d4 100644Binary files a/tests/fixtures/01 Invisible (RED) Edit Version.m4a and b/tests/fixtures/01 Invisible (RED) Edit Version.m4a differdiff --git a/tests/fixtures/test.aiff b/tests/fixtures/test.aiffindex 1435115d9..d179f0714 100644Binary files a/tests/fixtures/test.aiff and b/tests/fixtures/test.aiff differdiff --git a/tests/fixtures/test.flac b/tests/fixtures/test.flacindex 6c1270fd5..50430f539 100644Binary files a/tests/fixtures/test.flac and b/tests/fixtures/test.flac differdiff --git a/tests/fixtures/test.m4a b/tests/fixtures/test.m4aindex c469dd9e4..e9b54d44d 100644Binary files a/tests/fixtures/test.m4a and b/tests/fixtures/test.m4a differdiff --git a/tests/fixtures/test.mp3 b/tests/fixtures/test.mp3index 7333249ad..18cb90674 100644Binary files a/tests/fixtures/test.mp3 and b/tests/fixtures/test.mp3 differdiff --git a/tests/fixtures/test.ogg b/tests/fixtures/test.oggindex 507da9050..2b1deea98 100644Binary files a/tests/fixtures/test.ogg and b/tests/fixtures/test.ogg differdiff --git a/tests/fixtures/test.opus b/tests/fixtures/test.opusindex 5052c0e6e..044947c70 100644Binary files a/tests/fixtures/test.opus and b/tests/fixtures/test.opus differdiff --git a/tests/fixtures/test.wav b/tests/fixtures/test.wavindex 155d88bdb..b8c1f9a65 100644Binary files a/tests/fixtures/test.wav and b/tests/fixtures/test.wav differdiff --git a/tests/fixtures/test.wma b/tests/fixtures/test.wmaindex 2edb7260e..2e7341cf5 100644Binary files a/tests/fixtures/test.wma and b/tests/fixtures/test.wma differdiff --git a/tests/fixtures/test.wv b/tests/fixtures/test.wvindex 3722d28a2..7f4118bdb 100644Binary files a/tests/fixtures/test.wv and b/tests/fixtures/test.wv differ