diff --git a/persistence/album_repository.go b/persistence/album_repository.go index 2b3b28945..124a4995f 100644 --- a/persistence/album_repository.go +++ b/persistence/album_repository.go @@ -366,23 +366,5 @@ func (r *albumRepository) NewInstance() interface{} { return &model.Album{} } -func (r albumRepository) Delete(id string) error { - return r.delete(Eq{"album.id": id}) -} - -func (r albumRepository) Save(entity interface{}) (string, error) { - album := entity.(*model.Album) - id, err := r.put(album.ID, album) - return id, err -} - -func (r albumRepository) Update(id string, entity interface{}, cols ...string) error { - album := entity.(*model.Album) - album.ID = id - _, err := r.put(id, album, cols...) - return err -} - var _ model.AlbumRepository = (*albumRepository)(nil) var _ model.ResourceRepository = (*albumRepository)(nil) -var _ rest.Persistable = (*albumRepository)(nil) diff --git a/persistence/artist_repository.go b/persistence/artist_repository.go index 38711dd7d..49ccbd241 100644 --- a/persistence/artist_repository.go +++ b/persistence/artist_repository.go @@ -275,22 +275,5 @@ func (r *artistRepository) NewInstance() interface{} { return &model.Artist{} } -func (r artistRepository) Delete(id string) error { - return r.delete(Eq{"artist.id": id}) -} - -func (r artistRepository) Save(entity interface{}) (string, error) { - artist := entity.(*model.Artist) - err := r.Put(artist) - return artist.ID, err -} - -func (r artistRepository) Update(id string, entity interface{}, cols ...string) error { - artist := entity.(*model.Artist) - artist.ID = id - return r.Put(artist) -} - var _ model.ArtistRepository = (*artistRepository)(nil) var _ model.ResourceRepository = (*artistRepository)(nil) -var _ rest.Persistable = (*artistRepository)(nil) diff --git a/persistence/mediafile_repository.go b/persistence/mediafile_repository.go index 3fdf4ae8f..902cfb720 100644 --- a/persistence/mediafile_repository.go +++ b/persistence/mediafile_repository.go @@ -203,18 +203,5 @@ func (r *mediaFileRepository) NewInstance() interface{} { return &model.MediaFile{} } -func (r *mediaFileRepository) Save(entity interface{}) (string, error) { - mf := entity.(*model.MediaFile) - err := r.Put(mf) - return mf.ID, err -} - -func (r *mediaFileRepository) Update(id string, entity interface{}, cols ...string) error { - mf := entity.(*model.MediaFile) - mf.ID = id - return r.Put(mf) -} - var _ model.MediaFileRepository = (*mediaFileRepository)(nil) var _ model.ResourceRepository = (*mediaFileRepository)(nil) -var _ rest.Persistable = (*mediaFileRepository)(nil) diff --git a/server/nativeapi/native_api.go b/server/nativeapi/native_api.go index d530f3849..81873d5bc 100644 --- a/server/nativeapi/native_api.go +++ b/server/nativeapi/native_api.go @@ -34,10 +34,10 @@ func (n *Router) routes() http.Handler { r.Use(server.Authenticator(n.ds)) r.Use(server.JWTRefresher) n.R(r, "/user", model.User{}, true) - n.R(r, "/song", model.MediaFile{}, true) - n.R(r, "/album", model.Album{}, true) - n.R(r, "/artist", model.Artist{}, true) - n.R(r, "/genre", model.Genre{}, true) + n.R(r, "/song", model.MediaFile{}, false) + n.R(r, "/album", model.Album{}, false) + n.R(r, "/artist", model.Artist{}, false) + n.R(r, "/genre", model.Genre{}, false) n.R(r, "/player", model.Player{}, true) n.R(r, "/playlist", model.Playlist{}, true) n.R(r, "/transcoding", model.Transcoding{}, conf.Server.EnableTranscodingConfig)