Refactoring to a cleaner architecture
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package domain
|
||||
|
||||
type Album struct {
|
||||
Id string
|
||||
Name string
|
||||
ArtistId string `parent:"artist"`
|
||||
CoverArtPath string // TODO http://stackoverflow.com/questions/13795842/linking-itunes-itc2-files-and-ituneslibrary-xml
|
||||
Year int
|
||||
Compilation bool
|
||||
Rating int
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package domain
|
||||
|
||||
type Artist struct {
|
||||
Id string
|
||||
Name string
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package domain
|
||||
|
||||
type ArtistInfo struct {
|
||||
ArtistId string
|
||||
Artist string
|
||||
}
|
||||
|
||||
type ArtistIndex struct {
|
||||
Id string
|
||||
Artists []ArtistInfo
|
||||
}
|
||||
|
||||
|
||||
type ArtistIndexRepository interface {
|
||||
Put(m *ArtistIndex) error
|
||||
Get(id string) (*ArtistIndex, error)
|
||||
GetAll() ([]ArtistIndex, error)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type MediaFile struct {
|
||||
Id string
|
||||
Path string
|
||||
Title string
|
||||
Album string
|
||||
Artist string
|
||||
AlbumArtist string
|
||||
AlbumId string `parent:"album"`
|
||||
Compilation bool
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package domain
|
||||
|
||||
type MediaFolder struct {
|
||||
Id string
|
||||
Name string
|
||||
Path string
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package domain
|
||||
|
||||
type Property struct {
|
||||
Id string
|
||||
Value string
|
||||
}
|
||||
|
||||
type PropertyRepository interface {
|
||||
Put(id string, value string) error
|
||||
Get(id string) (string, error)
|
||||
DefaultGet(id string, defaultValue string) (string, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user