Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of Sync Optimization for Movies, Series and Episodes #2359

Merged
merged 12 commits into from
Jan 24, 2024

Conversation

JaiZed
Copy link
Collaborator

@JaiZed JaiZed commented Jan 14, 2024

Implemented algorithm, that (when the switches are on) will only check movies, series or episodes that are monitored, or whose monitored state does not agree between Bazarr and Radarr / Sonarr.
This can lead to a dramatic improvement in time spent synchronizing with Radarr and Sonarr if the user stops monitoring media that they are satisfied with in Radarr / Sonarr.

These settings are exposed in the UI under Settings -> Scheduler -> Sonarr/Radarr Sync.

  • Sync Only Monitored Movies
  • Sync Only Monitored Series
  • Sync Only Monitored Episodes

JaiZed added 10 commits January 14, 2024 12:11
Added Sync Only settings for movies, series and episodes.
This prevents a horrible, multiline, stack trace message from knowit and replaces it with a single clear log message.
Added Sync Only settings for movies, series and episodes.
Used CollapseBox to hide messages if switches are off, so that user is not confused or overwhelmed.
Occasionally, Radarr will add an extra separator to the end of the path, which causes some of our comparisons to fail. Use os.path.normpath() to handle this.
Also fixed cringeworthy code duplication of large code block which made it hard to see what the difference was and why.
Also removed code to detect separator.
Implemented algorithm. that (when the switch is on) will only check movies that are monitored, or whose monitored state does not agree between Bazarr and Radarr.
Added statistics to indicate effectiveness of algorithm and logging to help with any potential further debugging.
Updated comments to add reasoning behind code.
Added trace() method to wrap logging.debug() calls with a feature prefix to make it easy to filter out these messages when Bazarr is in logging DEBUG mode.
Added counter to trace() statements to make sure no movie was missed
Implemented algorithm. that (when the switch is on) will only check series that are monitored, or whose monitored state does not agree between Bazarr and Sonarr.
Added statistics to indicate effectiveness of algorithm and logging to help with any potential further debugging.
Added trace() method to wrap logging.debug() calls with a feature prefix to make it easy to filter out these messages when Bazarr is in logging DEBUG mode.
Implemented algorithm. that (when the switch is on) will only check episodes that are monitored, or whose monitored state does not agree between Bazarr and Sonarr.
Added statistics to indicate effectiveness of algorithm and logging to help with any potential further debugging.
Added trace() method to wrap logging.debug() calls with a feature prefix to make it easy to filter out these messages when Bazarr is in logging DEBUG mode.
Copy link
Owner

@morpheus65535 morpheus65535 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some code improvements (standardization) or comments. Thanks!

bazarr/radarr/sync/movies.py Outdated Show resolved Hide resolved
bazarr/radarr/sync/movies.py Show resolved Hide resolved
bazarr/sonarr/sync/series.py Show resolved Hide resolved
Replace hard-coded magic number 20480 with MINIMUM_VIDEO_SIZE.
Changed "== None" comparison to "is None".
@morpheus65535 morpheus65535 merged commit 990448b into morpheus65535:development Jan 24, 2024
2 checks passed
@JaiZed JaiZed deleted the sync-optimization branch January 29, 2024 05:21
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