feat: add transactional InTx to playback and watchlist repos

This commit is contained in:
2026-05-28 12:17:19 +02:00
committed by Milas Holsting
parent 86586ed344
commit d528f6b372
6 changed files with 115 additions and 62 deletions

View File

@@ -89,6 +89,7 @@ type EpisodeData struct {
}
type PlaybackRepository interface {
InTx(ctx context.Context, fn func(ctx context.Context, repo PlaybackRepository) error) error
GetWatchListEntry(ctx context.Context, params db.GetWatchListEntryParams) (db.WatchListEntry, error)
GetContinueWatchingEntry(ctx context.Context, params db.GetContinueWatchingEntryParams) (db.ContinueWatchingEntry, error)
SaveWatchProgress(ctx context.Context, params db.SaveWatchProgressParams) error

View File

@@ -21,6 +21,7 @@ type WatchlistService interface {
}
type WatchlistRepository interface {
InTx(ctx context.Context, fn func(ctx context.Context, repo WatchlistRepository) error) error
UpsertAnime(ctx context.Context, arg db.UpsertAnimeParams) (db.Anime, error)
GetAnime(ctx context.Context, id int64) (db.Anime, error)
UpsertWatchListEntry(ctx context.Context, arg db.UpsertWatchListEntryParams) (db.WatchListEntry, error)