🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Storm IndexRepository complete.
Deluana1d837cb9be7
diff --git a/persistence/ledis/wire_providers.go b/persistence/ledis/wire_providers.goindex a59ed5604..63fb8c768 100644--- a/persistence/ledis/wire_providers.go+++ b/persistence/ledis/wire_providers.go@@ -4,7 +4,6 @@ import "github.com/google/wire"var Set = wire.NewSet(NewCheckSumRepository,- NewArtistIndexRepository,NewMediaFolderRepository,NewNowPlayingRepository,NewPlaylistRepository,diff --git a/persistence/storm/index_repository.go b/persistence/storm/index_repository.gonew file mode 100644index 000000000..730039ad2--- /dev/null+++ b/persistence/storm/index_repository.go@@ -0,0 +1,59 @@+package storm++import (+ "github.com/cloudsonic/sonic-server/domain"+)++type _ArtistIndex struct {+ Id string+ Artists domain.ArtistInfos+}++type artistIndexRepository struct {+ stormRepository+}++func NewArtistIndexRepository() domain.ArtistIndexRepository {+ r := &artistIndexRepository{}+ r.init(&_ArtistIndex{})+ return r+}++func (r *artistIndexRepository) Put(i *domain.ArtistIndex) error {+ ti := _ArtistIndex(*i)+ return Db().Save(&ti)+}++func (r *artistIndexRepository) Get(id string) (*domain.ArtistIndex, error) {+ ta := &_ArtistIndex{}+ err := r.getByID(id, ta)+ if err != nil {+ return nil, err+ }+ a := domain.ArtistIndex(*ta)+ return &a, err+}++func (r *artistIndexRepository) GetAll() (domain.ArtistIndexes, error) {+ var all []_ArtistIndex+ err := r.getAll(&all, &domain.QueryOptions{})+ if err != nil {+ return nil, err+ }+ return r.toArtistIndexes(all)+}++func (r *artistIndexRepository) toArtistIndexes(all []_ArtistIndex) (domain.ArtistIndexes, error) {+ result := make(domain.ArtistIndexes, len(all))+ for i, a := range all {+ result[i] = domain.ArtistIndex(a)+ }+ return result, nil+}++func (r *artistIndexRepository) DeleteAll() error {+ return Db().Drop(&_ArtistIndex{})+}++var _ domain.ArtistIndexRepository = (*artistIndexRepository)(nil)+var _ = domain.ArtistIndex(_ArtistIndex{})diff --git a/persistence/storm/wire_providers.go b/persistence/storm/wire_providers.goindex 2260fb6c9..1df452930 100644--- a/persistence/storm/wire_providers.go+++ b/persistence/storm/wire_providers.go@@ -7,4 +7,5 @@ var Set = wire.NewSet(NewArtistRepository,NewAlbumRepository,NewMediaFileRepository,+ NewArtistIndexRepository,)