fix(api): a vanished grab takes no headline
Superseding an import failure with any non-failed grab let a 'vanished' one take the headline: the torrent has left Transmission, so the season would show neither the failure nor any progress while the gap is still there.
This commit is contained in:
@@ -1705,7 +1705,11 @@ async fn season_import_failures(
|
||||
SELECT 1 FROM grabs newer
|
||||
WHERE newer.target_kind = 'season'
|
||||
AND newer.target_id = g.target_id
|
||||
AND newer.state != 'failed'
|
||||
-- 'vanished' is not a live attempt either: the
|
||||
-- torrent left Transmission, so letting it take the
|
||||
-- headline would leave the season saying nothing at
|
||||
-- all about a gap that still exists.
|
||||
AND newer.state NOT IN ('failed', 'vanished')
|
||||
AND (newer.grabbed_at > coalesce(g.failed_at, g.grabbed_at)
|
||||
OR (newer.grabbed_at = coalesce(g.failed_at, g.grabbed_at)
|
||||
AND newer.id > g.id))
|
||||
|
||||
Reference in New Issue
Block a user