528aadf59c
Closes the gap #239 describes: §5.7's 30-day window was filtered on grabbed_at, so a torrent stalling past the window before hard-failing at import never surfaced in the needs-a-decision queue. grabs gains failed_at (migration 0030, backfilled from grabbed_at for existing failed rows), the import tick stamps it on hard fail, and every window query in the daemon notifier and the attention endpoint reads it. §5.7 now states the anchor explicitly. §6.2's pack backoff stays on grabbed_at deliberately; noted on the issue. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
63 lines
1.8 KiB
JSON
63 lines
1.8 KiB
JSON
{
|
|
"db_name": "SQLite",
|
|
"query": "\n SELECT s.id AS \"series_id!: i64\", s.title AS \"title!: String\", s.year,\n g.target_id AS \"season_id!: 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.failed_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.title, s.year, se.id\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": "title!: String",
|
|
"ordinal": 1,
|
|
"type_info": "Text",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "series",
|
|
"name": "title"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "year",
|
|
"ordinal": 2,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "series",
|
|
"name": "year"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "season_id!: i64",
|
|
"ordinal": 3,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "grabs",
|
|
"name": "target_id"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 1
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
true,
|
|
false
|
|
]
|
|
},
|
|
"hash": "0c97b43e22b1c83c5a7131ce9a07fa96cc595454d8803b3c4307074ab273eb1d"
|
|
}
|