Enhanced Episode Handling, Duration Calculation, and Exception Handling in Video Models and Services #501
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.
These changes provide more robust and flexible handling of episodic video content, refined duration estimates for better user feedback, and improved error handling across file-based services.
• Added episode_numbers method to DiskTitle and VideoBlob to support handling of episodes spanning multiple numbers.
• Updated ScanPlexWorker to handle both the starting and ending episode numbers, enhancing episode lookup in cases where multiple episodes are represented in a single video blob.
• Refactored duration_range method in the Tv model to compute episode and disk title durations more effectively, integrating interquartile range and weighted averages for more accurate time estimates.
• Added DEFAULT_RANGE in Video to provide a baseline for duration calculations.
• Enhanced StatsService to include z-score calculation and additional statistical data (differences), allowing outlier filtering in duration calculations.
• Added exception handling in UploadMkvService to destroy video_blob entries when the associated file is not found, preventing orphaned entries and ensuring system consistency.
• Extended KeyParserService to detect episode ranges within filenames, adding support for patterns like S01E01-E02.
• Updated duration information display in seasons/show.html.erb, showing calculated duration ranges and debug information for enhanced insight into the duration statistics when debug mode is active.