0.2.59 - Settings save fixes

This commit is contained in:
ponzischeme89
2026-08-12 15:39:08 +12:00
parent 613f203cf9
commit 4fb68f4bbc
14 changed files with 227 additions and 25 deletions
+21
View File
@@ -357,6 +357,27 @@ func TestHeroMovieCandidatesSkipUnpressableRows(t *testing.T) {
}
}
// A film somebody has finished is not an answer to "watch this tonight", however new or
// well reviewed it is. A series is left alone: watched there means up to date, which is
// exactly who a returning season is news for.
func TestHeroMovieCandidatesSkipWatchedFilms(t *testing.T) {
watched, _ := json.Marshal(map[string]any{
"Id": "seen", "Name": "Seen", "Type": "Movie",
"UserData": map[string]any{"Played": true},
})
partway, _ := json.Marshal(map[string]any{
"Id": "partway", "Name": "Partway", "Type": "Movie",
"UserData": map[string]any{"Played": false, "PlaybackPositionTicks": 6_000_000_000},
})
rows := []recommend.Row{{ID: "latest", Kind: "latest", Items: []json.RawMessage{
watched, partway, heroItem("unseen", "Unseen", "Movie"),
}}}
candidates, _ := heroMovieCandidates(rows)
if ids := strings.Join(heroIDs(candidates), ","); ids != "partway,unseen" {
t.Fatalf("expected the unfinished and unseen films only, got %s", ids)
}
}
// Emby writes dates in more than one shape, and one it will not parse is unknown rather
// than fatal.
func TestParseEmbyDate(t *testing.T) {