What
downloaded is set the moment Prowlarr accepts the grab, not when the files actually arrive.
In start_download, as soon as the POST to /api/v1/search returns OK:
for b in same_books:
b.downloaded = True
Prowlarr accepting a grab only means it handed the release to a download client. From there it can seed at 0 KB/s forever, fail to extract, get removed, or be a mislabelled release — and ABR keeps showing the book as downloaded. onSuccessfulDownload fires at the same moment, so the notification is wrong too.
Why it matters
- The wishlist shows books as done that never landed.
- The ABS scan is triggered against files that don't exist yet.
- There is no path to a retry, because nothing knows the grab failed.
Suggestion
Split the two states. Something like grabbed_at (Prowlarr accepted) and downloaded (files confirmed on disk), with onSuccessfulDownload moving to the second.
That needs a source of truth for completion. #51 needs the same thing, and the branch I put up there already records a pending row per grab with the release title and confirms completion off the download folder — so if that design is wanted, this becomes mostly a matter of moving the flag rather than new machinery. A stalled-grab check ("no files after N hours → mark failed, optionally re-grab the next ranked source") would then be a natural follow-up, which is what @j007bond007 asked for in #51.
Happy to implement whichever shape you prefer, but this one is worth agreeing on first since it changes the meaning of an existing field and the timing of an existing notification.
What
downloadedis set the moment Prowlarr accepts the grab, not when the files actually arrive.In
start_download, as soon as the POST to/api/v1/searchreturns OK:Prowlarr accepting a grab only means it handed the release to a download client. From there it can seed at 0 KB/s forever, fail to extract, get removed, or be a mislabelled release — and ABR keeps showing the book as downloaded.
onSuccessfulDownloadfires at the same moment, so the notification is wrong too.Why it matters
Suggestion
Split the two states. Something like
grabbed_at(Prowlarr accepted) anddownloaded(files confirmed on disk), withonSuccessfulDownloadmoving to the second.That needs a source of truth for completion. #51 needs the same thing, and the branch I put up there already records a pending row per grab with the release title and confirms completion off the download folder — so if that design is wanted, this becomes mostly a matter of moving the flag rather than new machinery. A stalled-grab check ("no files after N hours → mark failed, optionally re-grab the next ranked source") would then be a natural follow-up, which is what @j007bond007 asked for in #51.
Happy to implement whichever shape you prefer, but this one is worth agreeing on first since it changes the meaning of an existing field and the timing of an existing notification.