diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-17 14:59:07 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-17 14:59:07 +0300 |
| commit | 3d2009bff0edddb413819ea542678738fb63cc0c (patch) | |
| tree | 53a8679920b0a3b1bc7598979c67492b51ea5fe6 /internal/model | |
| parent | dd3a961436868c32585b201b2da2dd5be23d609c (diff) | |
Add finished flag to playback progress
Diffstat (limited to 'internal/model')
| -rw-r--r-- | internal/model/media.go | 1 | ||||
| -rw-r--r-- | internal/model/media_test.go | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/internal/model/media.go b/internal/model/media.go index 48ab487..39ae4fd 100644 --- a/internal/model/media.go +++ b/internal/model/media.go @@ -121,6 +121,7 @@ type PlaybackProgress struct { UserID int64 `json:"user_id"` MediaID int64 `json:"media_id"` PositionSeconds float64 `json:"position_seconds"` + Finished bool `json:"finished"` UpdatedAt time.Time `json:"updated_at"` } diff --git a/internal/model/media_test.go b/internal/model/media_test.go index 49d877c..1692698 100644 --- a/internal/model/media_test.go +++ b/internal/model/media_test.go @@ -15,7 +15,7 @@ func TestStructsInstantiate(t *testing.T) { max := 1 _ = Share{Token: "t", MediaID: 1, CreatedBy: 1, CreatedAt: now, ExpiresAt: now, MaxUses: &max} _ = Note{ID: 1, MediaID: 1, UserID: 1, Content: "c", CreatedAt: now, UpdatedAt: now} - _ = PlaybackProgress{UserID: 1, MediaID: 1, PositionSeconds: 1, UpdatedAt: now} + _ = PlaybackProgress{UserID: 1, MediaID: 1, PositionSeconds: 1, Finished: true, UpdatedAt: now} _ = PlaybackAccumulator{SessionID: "s", MediaID: 1, UpdatedAt: now} _ = Favorite{UserID: 1, MediaID: 1, CreatedAt: now} _ = MediaTag{MediaID: 1, TagID: 1} |
