Introduced types for the collections
This commit is contained in:
+3
-1
@@ -15,9 +15,11 @@ type Album struct {
|
||||
Genre string
|
||||
}
|
||||
|
||||
type Albums []Album
|
||||
|
||||
type AlbumRepository interface {
|
||||
BaseRepository
|
||||
Put(m *Album) error
|
||||
Get(id string) (*Album, error)
|
||||
FindByArtist(artistId string) ([]Album, error)
|
||||
FindByArtist(artistId string) (Albums, error)
|
||||
}
|
||||
|
||||
+3
-1
@@ -10,9 +10,11 @@ type ArtistIndex struct {
|
||||
Artists []ArtistInfo
|
||||
}
|
||||
|
||||
type ArtistIndexes []ArtistIndex
|
||||
|
||||
type ArtistIndexRepository interface {
|
||||
BaseRepository
|
||||
Put(m *ArtistIndex) error
|
||||
Get(id string) (*ArtistIndex, error)
|
||||
GetAll() ([]ArtistIndex, error)
|
||||
GetAll() (ArtistIndexes, error)
|
||||
}
|
||||
|
||||
+3
-1
@@ -32,9 +32,11 @@ func (mf *MediaFile) ContentType() string {
|
||||
return mime.TypeByExtension("." + mf.Suffix)
|
||||
}
|
||||
|
||||
type MediaFiles []MediaFile
|
||||
|
||||
type MediaFileRepository interface {
|
||||
BaseRepository
|
||||
Put(m *MediaFile) error
|
||||
Get(id string) (*MediaFile, error)
|
||||
FindByAlbum(albumId string) ([]MediaFile, error)
|
||||
FindByAlbum(albumId string) (MediaFiles, error)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ type MediaFolder struct {
|
||||
Path string
|
||||
}
|
||||
|
||||
type MediaFolders []MediaFolder
|
||||
|
||||
type MediaFolderRepository interface {
|
||||
GetAll() ([]MediaFolder, error)
|
||||
GetAll() (MediaFolders, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user