diff --git a/server.go b/server.go index 2891274b1..0867e2ce9 100644 --- a/server.go +++ b/server.go @@ -418,6 +418,7 @@ func processIndexDirectory(filePath, indexPath, kind string, wg *sync.WaitGroup) createDisc := func() { if len(disc.Tracks) > 0 { disc.TrackCount = len(disc.Tracks) + entry.Duration += disc.Duration entry.Discs = append(entry.Discs, disc) } } @@ -790,9 +791,19 @@ func main() { writer.Write([]byte(fmt.Sprintf("DTITLE=%s / %s\n", group, entry.MainTitle))) } if !entry.ReleaseDate.IsZero() { - writer.Write([]byte(fmt.Sprintf("DYEAR=%d\nDGENRE=Soundtrack\n", entry.ReleaseDate.Year()))) + writer.Write([]byte(fmt.Sprintf("DYEAR=%d\n", entry.ReleaseDate.Year()))) } + var genres []string + if entry.Type == "arrangement" { + genres = append(genres, entry.Type) + } + genres = append(genres, entry.Genre...) + if len(genres) == 0 { + genres = append(genres, "soundtrack") + } + writer.Write([]byte(fmt.Sprintf("DGENRE=%s\n", strings.Join(genres, ", ")))) + for i, t := range entry.Discs[discIndex].Tracks { writer.Write([]byte(fmt.Sprintf("TTITLE%d=%s\n", i, t.MainTitle))) } diff --git a/utilities/toc.go b/utilities/toc.go index 0bd5f6fa2..e3f4b0f97 100644 --- a/utilities/toc.go +++ b/utilities/toc.go @@ -41,9 +41,6 @@ func NewTOCFromCDDBString(toc string) (r TOC) { t = t[1 : len(t)-1] //cut r = append(TOC{t[len(t)-1]}, t[0:len(t)-1]...) //put last sample at the front - for i := 0; i < len(t); i++ { - r[i] += TocPregap - } return }