Added genres to list
This commit is contained in:
parent
64ed905c81
commit
eb8af6c5f0
|
@ -77,6 +77,7 @@ type albumEntry struct {
|
|||
MainTitle string `json:"pagetitle"`
|
||||
Titles []string `json:"titles"`
|
||||
CatalogNumber string `json:"catalognumber,omitempty"`
|
||||
Genre []string `json:"genre,omitempty"`
|
||||
TrackCount int `json:"trackcount,omitempty"`
|
||||
Duration int `json:"duration,omitempty"`
|
||||
ReleaseDate JSONTime `json:"date,omitempty"`
|
||||
|
@ -333,6 +334,14 @@ func processIndexDirectory(filePath, indexPath, kind string, wg *sync.WaitGroup)
|
|||
}
|
||||
}
|
||||
|
||||
if val, ok = tpl.Parameters["genre"]; ok {
|
||||
if stringVal = getStringValue(entry.MainTitle, val); len(stringVal) > 0 {
|
||||
for _, genre := range strings.Split(strings.Join(stringVal, " "), ",") {
|
||||
entry.Genre = append(entry.Genre, strings.ToLower(strings.TrimSpace(genre)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if val, ok = tpl.Parameters["group"]; ok {
|
||||
entry.Artists = append(entry.Artists, getArtistEntries("group", val)...)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue