clean up indexings

This commit is contained in:
sentriz
2019-06-27 18:06:33 +01:00
parent c6d4ea5b90
commit 79eeca77ae
6 changed files with 28 additions and 15 deletions

View File

@@ -16,6 +16,13 @@ type Artist struct {
AlbumCount int `sql:"-"`
}
func (a *Artist) IndexName() string {
if len(a.NameUDec) > 0 {
return a.NameUDec
}
return a.Name
}
type Track struct {
IDBase
CrudBase
@@ -92,3 +99,10 @@ type Album struct {
ReceivedPaths bool `gorm:"-"`
ReceivedTags bool `gorm:"-"`
}
func (a *Album) IndexRightPath() string {
if len(a.RightPathUDec) > 0 {
return a.RightPathUDec
}
return a.RightPath
}