Skip to content

fix: add missing check DELETE_IF_ONLY_ON_EMULERR for valid record#49

Merged
Jorman merged 3 commits intoJorman:masterfrom
Rapsssito:patch-1
Mar 16, 2026
Merged

fix: add missing check DELETE_IF_ONLY_ON_EMULERR for valid record#49
Jorman merged 3 commits intoJorman:masterfrom
Rapsssito:patch-1

Conversation

@Rapsssito
Copy link
Copy Markdown
Contributor

@Rapsssito Rapsssito commented Mar 15, 2026

Add missing condition to check DELETE_IF_ONLY_ON_EMULERR when no (valid) record is found in *Arr. The script was removing stuff I had imported manually.

Add missing condition to check DELETE_IF_ONLY_ON_EMULERR when no record is found in *Arr.
@Jorman
Copy link
Copy Markdown
Owner

Jorman commented Mar 15, 2026

Ouch! You right!
I miss this and never saw this error, because I don't set it at true!
Thanks!
But I suggest a little modification:

# If records exist but none meet the criteria, the download is considered
# present only on eMulerr (not tracked by Sonarr/Radarr).
# We still need to `continue` in both cases to avoid using a None
# valid_record further down, which would crash.
if valid_record is None:
    if Config.DELETE_IF_ONLY_ON_EMULERR:
        logger.info(
            f"Records present for '{download.name}' (hash: {download.hash}), but no one meets the criteria. "
            "Download considered present only on eMulerr. Marking for removal."
        )
        emulerr_downloads_to_remove.append(download)
    else:
        logger.info(
            f"Records present for '{download.name}' (hash: {download.hash}), but no one meets the criteria. "
            "DELETE_IF_ONLY_ON_EMULERR is disabled, skipping removal."
        )
    continue

With this modification I can accept the pull request

J

@Rapsssito
Copy link
Copy Markdown
Contributor Author

Done!

@Jorman Jorman merged commit c9c3c9f into Jorman:master Mar 16, 2026
@Jorman
Copy link
Copy Markdown
Owner

Jorman commented Mar 16, 2026

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants