diff --git a/model/album.go b/model/album.go index 9fa97c218..79c166424 100644 --- a/model/album.go +++ b/model/album.go @@ -27,7 +27,8 @@ type Album struct { type Albums []Album type AlbumRepository interface { - BaseRepository + CountAll() (int64, error) + Exists(id string) (bool, error) Put(m *Album) error Get(id string) (*Album, error) FindByArtist(artistId string) (Albums, error) diff --git a/model/artist.go b/model/artist.go index 94b68538e..9c4cf5745 100644 --- a/model/artist.go +++ b/model/artist.go @@ -7,7 +7,8 @@ type Artist struct { } type ArtistRepository interface { - BaseRepository + CountAll() (int64, error) + Exists(id string) (bool, error) Put(m *Artist) error Get(id string) (*Artist, error) PurgeInactive(active Artists) error diff --git a/model/base.go b/model/base.go index 749315966..1d5345a90 100644 --- a/model/base.go +++ b/model/base.go @@ -2,11 +2,6 @@ package model import "errors" -type BaseRepository interface { - CountAll() (int64, error) - Exists(id string) (bool, error) -} - var ( ErrNotFound = errors.New("data not found") ) diff --git a/model/index.go b/model/index.go index 74fd4c9bf..4d8f66505 100644 --- a/model/index.go +++ b/model/index.go @@ -24,7 +24,8 @@ func (a ArtistInfos) Less(i, j int) bool { type ArtistIndexes []ArtistIndex type ArtistIndexRepository interface { - BaseRepository + CountAll() (int64, error) + Exists(id string) (bool, error) Put(m *ArtistIndex) error Get(id string) (*ArtistIndex, error) GetAll() (ArtistIndexes, error) diff --git a/model/mediafile.go b/model/mediafile.go index bcace18b0..94ca73b95 100644 --- a/model/mediafile.go +++ b/model/mediafile.go @@ -46,7 +46,8 @@ func (a MediaFiles) Less(i, j int) bool { } type MediaFileRepository interface { - BaseRepository + CountAll() (int64, error) + Exists(id string) (bool, error) Put(m *MediaFile) error Get(id string) (*MediaFile, error) FindByAlbum(albumId string) (MediaFiles, error) diff --git a/model/playlist.go b/model/playlist.go index 2ffa3d1bd..6580e6667 100644 --- a/model/playlist.go +++ b/model/playlist.go @@ -12,7 +12,8 @@ type Playlist struct { } type PlaylistRepository interface { - BaseRepository + CountAll() (int64, error) + Exists(id string) (bool, error) Put(m *Playlist) error Get(id string) (*Playlist, error) GetAll(options ...QueryOptions) (Playlists, error)