navidrome/model/datastore.go
Jiho Andrew Lee 19385dc28b Merge upstream/master into feat-podcast-ux-improvements/5420
Resolve conflicts with the stateless-repositories refactor (#6149):
- port podcast repositories, model interfaces, mocks, service and handlers to per-call ctx
- podcast channel repo now implements generic rest.Repository/Persistable
- register podcast repos in SQLStore and MockDataStore
- merge OpenSubsonic extensions (apiKeyAuthentication + podcast extensions)
- renumber podcast migrations after upstream's latest (20260930...)
2026-09-30 15:23:00 +09:00

55 lines
1.7 KiB
Go

package model
import (
"context"
"github.com/Masterminds/squirrel"
)
type QueryOptions struct {
Sort string
Order string
Max int
Offset int
Filters squirrel.Sqlizer
Seed string // for random sorting
}
type DataStore interface {
Library() LibraryRepository
Folder() FolderRepository
Album() AlbumRepository
Artist() ArtistRepository
MediaFile() MediaFileRepository
Genre() GenreRepository
Tag() TagRepository
Playlist() PlaylistRepository
PlayQueue() PlayQueueRepository
Transcoding() TranscodingRepository
Player() PlayerRepository
Radio() RadioRepository
Share() ShareRepository
Property() PropertyRepository
User() UserRepository
UserProps() UserPropsRepository
ScrobbleBuffer() ScrobbleBufferRepository
Scrobble() ScrobbleRepository
Plugin() PluginRepository
Artwork() ArtworkRepository
ArtworkQueue() ArtworkQueueRepository
PodcastChannel() PodcastChannelRepository
PodcastEpisode() PodcastEpisodeRepository
PodcastTranscript() PodcastTranscriptRepository
PodcastPerson() PodcastPersonRepository
PodcastPodroll() PodcastPodrollRepository
PodcastLiveItem() PodcastLiveItemRepository
PodcastFunding() PodcastFundingRepository
PodcastImage() PodcastImageRepository
WithTx(block func(tx DataStore) error, scope ...string) error
WithTxImmediate(block func(tx DataStore) error, scope ...string) error
// WithTxRetry runs block in a transaction, rerunning it while SQLite reports the database busy.
// For background work only (it can take minutes), and block must be safe to rerun after a rollback.
WithTxRetry(ctx context.Context, block func(ctx context.Context, tx DataStore) error, scope ...string) error
GC(ctx context.Context, libraryIDs ...int) error
}