6847d25cf5
The needs-a-decision queue had no liveness condition on the season lane and none at all in the API reader, so a season pack that hard-failed twice, fell back to per-episode grabbing exactly as §6.2 intends, and was then fully acquired kept notifying for 30 days, and `GET /api/queues/attention` listed titles the daemon never notified on. DESIGN.md §5.7 now states the third face of the same rule alongside the count and the window: a movie or an episode is queued while `wanted` and not `available`; a season, holding no intent of its own (§4.1), while at least one of its episodes is. Both readers apply it on all three lanes. `just ci` passed through the gate.
87 lines
2.4 KiB
JSON
87 lines
2.4 KiB
JSON
{
|
|
"db_name": "SQLite",
|
|
"query": "\n SELECT s.id AS \"series_id!: i64\", s.tmdb_id AS \"tmdb_id!: i64\",\n s.title AS \"title!: String\", s.year,\n g.target_id AS \"season_id!: i64\", se.number AS \"season_number!: i64\"\n FROM grabs g\n JOIN seasons se ON g.target_kind = 'season' AND se.id = g.target_id\n JOIN series s ON s.id = se.series_id\n WHERE g.state = 'failed'\n AND g.grabbed_at >= strftime('%Y-%m-%dT%H:%M:%fZ', 'now', ?)\n AND EXISTS (\n SELECT 1 FROM episodes e\n WHERE e.season_id = se.id\n AND e.wanted = 1 AND e.state != 'available'\n )\n GROUP BY s.id, s.tmdb_id, s.title, s.year, se.id, se.number\n HAVING count(DISTINCT g.release_id) >= 2\n ",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"name": "series_id!: i64",
|
|
"ordinal": 0,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "series",
|
|
"name": "id"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "tmdb_id!: i64",
|
|
"ordinal": 1,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "series",
|
|
"name": "tmdb_id"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "title!: String",
|
|
"ordinal": 2,
|
|
"type_info": "Text",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "series",
|
|
"name": "title"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "year",
|
|
"ordinal": 3,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "series",
|
|
"name": "year"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "season_id!: i64",
|
|
"ordinal": 4,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "grabs",
|
|
"name": "target_id"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "season_number!: i64",
|
|
"ordinal": 5,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "seasons",
|
|
"name": "number"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 1
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
true,
|
|
false,
|
|
false
|
|
]
|
|
},
|
|
"hash": "b5b8f0ff18d9554a63b24d9693e4e07dc4d0bdb89dd8eced880e5a36eb596d37"
|
|
}
|