Refactor repair.py : Improved Logging and Added Async Search Status Monitoring#60
Merged
westsurname merged 11 commits intowestsurname:mainfrom Jun 24, 2025
kw6423:feature/repair-logging-refactor
Merged
Refactor repair.py : Improved Logging and Added Async Search Status Monitoring#60westsurname merged 11 commits intowestsurname:mainfrom kw6423:feature/repair-logging-refactor
westsurname merged 11 commits intowestsurname:mainfrom
kw6423:feature/repair-logging-refactor
Conversation
westsurname
reviewed
Jun 18, 2025
…g. Add automatic search status check in Arr.
Co-authored-by: westsurname <155189104+westsurname@users.noreply.github.com>
Changed to camelCase Other Minor changes Season Packs Optimized section Added empty prints for style Fixed dry run not applied checkAutomaticSearchStatus Removed discordUpdate on search succesful as it's misleading since it doesn't really tell if media was grabbed. Add 0 reports downloaded in message detection, if True send ErrorUpdate to discord.
…her minor changes
… were deleted in media folder but were still in mount
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
westsurname
reviewed
Jun 20, 2025
Co-authored-by: westsurname <155189104+westsurname@users.noreply.github.com>
…ion for season id/movie id, changed parentFolders to use realpath
…ature/repair-logging-refactor
westsurname
approved these changes
Jun 24, 2025
| if not args.dry_run and (args.no_confirm or input("Do you want to initiate a search for a season-pack? (y/n): ").lower() == 'y'): | ||
| results = arr.automaticSearch(media, childId) | ||
| runAsyncInThread(checkAutomaticSearchStatus(arr, results['id'], media.title, childId)) | ||
| elif args.mode == 'symlink' and childId in media.fullyAvailableChildrenIds and len(parentFolders) > 1: |
Owner
There was a problem hiding this comment.
Just as an fyi, sometimes I keep ifs nested for separation of interest purposes
| return | ||
| elif searchSuccessful is False: | ||
| errorMsg = f"Search for {mediaTitle} {seasonNumber} failed: {message}" | ||
| if status == "failed" or "0 reports downloaded." in message: |
Owner
There was a problem hiding this comment.
The 0 reports downloaded discord messaging might become an issue long term, especially for season upgrade cases. Let's keep an eye on it after the merge before release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Refactor
repair.py: Improved Logging and Async Search Status Monitoring📌 Summary
This PR focuses on enhancing the logging experience within
repair.pyand integrating non-blocking async monitoring of Radarr/Sonarr search tasks.Key goals:
✅ What's Changed
🔹 Logging Enhancements
print()wrapper:level=log levels (e.g.INFO,ERROR)print_section(title)helper for clearly labeled output sections[mode]-prefixed Discord messages into wrapper functions:discordUpdate(title, message)discordError(title, message)[args.mode]to match existing message format in a reusable way🔹 Async Search Monitoring
check_automatic_search_status():/command/{id}APIrun_async_in_thread()to execute the coroutine in a separate thread without blocking the repair loop🔹 Minor Cleanups
🗂 Affected Files
repair.pyshared/arr.py📝 Notes
📣 Example Output