Implemented more getAlbumList.view types

This commit is contained in:
Deluan
2016-03-04 17:01:14 -05:00
parent 766fdbc60c
commit 1c9d7721ad
4 changed files with 21 additions and 5 deletions
+2
View File
@@ -13,6 +13,8 @@ type Album struct {
Year int
Compilation bool
Starred bool
PlayCount int
PlayDate time.Time
Rating int
Genre string
CreatedAt time.Time
+7 -3
View File
@@ -1,8 +1,8 @@
package domain
import (
"time"
"mime"
"time"
)
type MediaFile struct {
@@ -23,6 +23,9 @@ type MediaFile struct {
BitRate int
Genre string
Compilation bool
PlayCount int
PlayDate time.Time
Rating int
Starred bool
CreatedAt time.Time
UpdatedAt time.Time
@@ -33,10 +36,11 @@ func (mf *MediaFile) ContentType() string {
}
type MediaFiles []MediaFile
func (a MediaFiles) Len() int { return len(a) }
func (a MediaFiles) Len() int { return len(a) }
func (a MediaFiles) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a MediaFiles) Less(i, j int) bool {
return (a[i].DiscNumber * 1000 + a[i].TrackNumber) < (a[j].DiscNumber * 1000 + a[j].TrackNumber)
return (a[i].DiscNumber*1000 + a[i].TrackNumber) < (a[j].DiscNumber*1000 + a[j].TrackNumber)
}
type MediaFileRepository interface {