mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-28 09:22:18 +03:00
Polishing
This commit is contained in:
parent
85882f6a40
commit
b25cfd96eb
@ -8,7 +8,7 @@ type BaseRepository interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrNotFound = errors.New("Data not found")
|
ErrNotFound = errors.New("data not found")
|
||||||
)
|
)
|
||||||
|
|
||||||
type QueryOptions struct {
|
type QueryOptions struct {
|
||||||
|
@ -42,7 +42,7 @@ func (b *browser) Indexes(ifModifiedSince time.Time) (domain.ArtistIndexes, time
|
|||||||
lastModified := utils.ToTime(ms)
|
lastModified := utils.ToTime(ms)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, time.Time{}, errors.New(fmt.Sprintf("Error retrieving LastScan property: %v", err))
|
return nil, time.Time{}, errors.New(fmt.Sprintf("error retrieving LastScan property: %v", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
if lastModified.After(ifModifiedSince) {
|
if lastModified.After(ifModifiedSince) {
|
||||||
|
@ -42,7 +42,7 @@ type Entry struct {
|
|||||||
type Entries []Entry
|
type Entries []Entry
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrDataNotFound = errors.New("Data Not Found")
|
ErrDataNotFound = errors.New("data not found")
|
||||||
)
|
)
|
||||||
|
|
||||||
func FromAlbum(al *domain.Album) Entry {
|
func FromAlbum(al *domain.Album) Entry {
|
||||||
|
@ -19,7 +19,7 @@ func NewAlbumRepository() domain.AlbumRepository {
|
|||||||
|
|
||||||
func (r *albumRepository) Put(m *domain.Album) error {
|
func (r *albumRepository) Put(m *domain.Album) error {
|
||||||
if m.Id == "" {
|
if m.Id == "" {
|
||||||
return errors.New("Album Id is not set")
|
return errors.New("album Id is not set")
|
||||||
}
|
}
|
||||||
return r.saveOrUpdate(m.Id, m)
|
return r.saveOrUpdate(m.Id, m)
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ func NewArtistRepository() domain.ArtistRepository {
|
|||||||
|
|
||||||
func (r *artistRepository) Put(m *domain.Artist) error {
|
func (r *artistRepository) Put(m *domain.Artist) error {
|
||||||
if m.Id == "" {
|
if m.Id == "" {
|
||||||
return errors.New("Artist Id is not set")
|
return errors.New("artist Id is not set")
|
||||||
}
|
}
|
||||||
return r.saveOrUpdate(m.Id, m)
|
return r.saveOrUpdate(m.Id, m)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ func NewArtistIndexRepository() domain.ArtistIndexRepository {
|
|||||||
|
|
||||||
func (r *artistIndexRepository) Put(m *domain.ArtistIndex) error {
|
func (r *artistIndexRepository) Put(m *domain.ArtistIndex) error {
|
||||||
if m.Id == "" {
|
if m.Id == "" {
|
||||||
return errors.New("Index Id is not set")
|
return errors.New("index Id is not set")
|
||||||
}
|
}
|
||||||
sort.Sort(m.Artists)
|
sort.Sort(m.Artists)
|
||||||
return r.saveOrUpdate(m.Id, m)
|
return r.saveOrUpdate(m.Id, m)
|
||||||
|
@ -19,7 +19,7 @@ func NewMediaFileRepository() domain.MediaFileRepository {
|
|||||||
|
|
||||||
func (r *mediaFileRepository) Put(m *domain.MediaFile) error {
|
func (r *mediaFileRepository) Put(m *domain.MediaFile) error {
|
||||||
if m.Id == "" {
|
if m.Id == "" {
|
||||||
return errors.New("MediaFile Id is not set")
|
return errors.New("mediaFile Id is not set")
|
||||||
}
|
}
|
||||||
return r.saveOrUpdate(m.Id, m)
|
return r.saveOrUpdate(m.Id, m)
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ func NewPlaylistRepository() domain.PlaylistRepository {
|
|||||||
|
|
||||||
func (r *playlistRepository) Put(m *domain.Playlist) error {
|
func (r *playlistRepository) Put(m *domain.Playlist) error {
|
||||||
if m.Id == "" {
|
if m.Id == "" {
|
||||||
return errors.New("Playlist Id is not set")
|
return errors.New("playlist Id is not set")
|
||||||
}
|
}
|
||||||
return r.saveOrUpdate(m.Id, m)
|
return r.saveOrUpdate(m.Id, m)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user