0.2.59 - Settings save fixes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user