ac0e80c044
The season branch of the attention queue listed a season on one failed grab of any age, so `GET /api/queues/attention` returned Rick and Morty with every season it has and buried the one that needed attention. Two changes, both stated in DESIGN.md §5.7: - The season branch now enforces the same bar the episode branch does: two grabs that hard-failed on *different* releases. - A failed grab counts toward the queue for 30 days (`arr_db::ATTENTION_WINDOW`). Nothing clears a `grabs` row, so without a window the queue only grows and can never be emptied. #181 gave the pack guard a backoff curve for the same reason; this is the queue's version of §6.2's "it never gives up entirely, it goes quiet". A season the operator dealt with stops failing and drops out; one still breaking keeps failing (the pack guard retries at worst weekly) and stays. The window applies to all three hard-fail lanes — movie, episode and season — because DESIGN.md states one rule for the queue, and to the daemon's needs-a-decision notifier as well as the API, since both read the same queue and a season-per-failure notification is the same noise on a different channel. No schema change: `grabs.grabbed_at` already carries the timestamp. Gate: `just ci` green (486 tests).
99 lines
2.6 KiB
JSON
99 lines
2.6 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 \"episode_id!: i64\",\n se.number AS \"season_number!: i64\", e.number AS \"episode_number!: i64\"\n FROM grabs g\n JOIN episodes e ON g.target_kind = 'episode' AND e.id = g.target_id\n JOIN seasons se ON se.id = e.season_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 GROUP BY s.id, s.tmdb_id, s.title, s.year, e.id, se.number, e.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": "episode_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"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "episode_number!: i64",
|
|
"ordinal": 6,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "episodes",
|
|
"name": "number"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 1
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
true,
|
|
false,
|
|
false,
|
|
false
|
|
]
|
|
},
|
|
"hash": "a8beee4a6c6f00a299cb6c6ec1bb2a4ef2613b8b57366fc7f2fbc56be29ce72c"
|
|
}
|