mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Parse more date formats
This commit is contained in:
parent
78ecda5239
commit
2d0031f709
2 changed files with 3 additions and 2 deletions
|
@ -105,7 +105,7 @@ func (m *baseMetadata) parseInt(tagName string) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
var dateRegex = regexp.MustCompile(`^([12]\d\d\d)`)
|
||||
var dateRegex = regexp.MustCompile(`([12]\d\d\d)`)
|
||||
|
||||
func (m *baseMetadata) parseYear(tagName string) int {
|
||||
if v, ok := m.tags[tagName]; ok {
|
||||
|
|
|
@ -15,7 +15,8 @@ var _ = Describe("ffmpegMetadata", func() {
|
|||
"1980.07.25": 1980,
|
||||
"2004-00-00": 2004,
|
||||
"2013-May-12": 2013,
|
||||
"May 12, 2016": 0,
|
||||
"May 12, 2016": 2016,
|
||||
"01/10/1990": 1990,
|
||||
}
|
||||
for tag, expected := range examples {
|
||||
md := &baseMetadata{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue