-
Notifications
You must be signed in to change notification settings - Fork 0
Auto-detect disc type (movie vs TV series) #36
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
Conversation
- add IDiscTypeDetector and DiscTypeDetector for content-type detection - move detection into DiscScanner so scan builds DiscInfo with detection results - store DetectedContentType and DetectionConfidence on DiscInfo - use detection result in DiscRipper (with 🎬/📺 emoji) when auto-detecting - add AutoDetect flag and --mode auto|movie|tv handling in RipOptions - register detector in DI container - keep default temp under output and update help text accordingly Detection currently targets movie vs TV heuristics; further TV refinements next.
- enhance TV series detection heuristics with refined thresholds - detect TV when most titles are 20-55 min with low variation (CV < 0.15/0.25) - detect movie when one long title + many shorts or two long titles - improved coefficient of variation analysis for episode consistency - fix emoji: use 📺 for TV instead of 📻 (radio) - add comprehensive test coverage: - DiscTypeDetectorTests with movie/TV/uncertain scenarios - RipOptionsTests for auto-detect, --mode auto, and --tv flag - fix invalid mode error message test expectation - all tests passing (104/104) - update documentation: - README: show --mode optional with auto default - EXAMPLES: demonstrate auto-detect usage - help text already reflected optional --mode Verified detection on real discs: - Movie disc: 85% confidence ✓ - TV disc: 92% confidence ✓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements automatic detection of disc content type (movie vs TV series) based on structural analysis of disc titles and durations. The feature enables users to rip content without specifying --mode explicitly, as the application now intelligently detects whether the disc contains a movie or TV series by default.
Changes:
- Added
DiscTypeDetectorwith heuristic-based detection using title count, duration patterns, and coefficient of variation analysis - Extended
DiscInfowithDetectedContentTypeandDetectionConfidenceproperties - Modified
RipOptionsto support auto-detection mode with--mode auto|detectand defaultAutoDetect=true
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
src/RipSharp/IDiscTypeDetector.cs |
New interface for content type detection with confidence scoring |
src/RipSharp/DiscTypeDetector.cs |
Core detection implementation using statistical analysis of title durations |
src/RipSharp/DiscInfo.cs |
Added properties for detected content type and confidence |
src/RipSharp/DiscScanner.cs |
Integrated detector into scan pipeline |
src/RipSharp/DiscRipper.cs |
Uses detection results and displays emoji indicators with confidence |
src/RipSharp/RipOptions.cs |
Added AutoDetect flag, updated mode parsing to support auto/detect |
src/RipSharp/Program.cs |
Registered IDiscTypeDetector in DI container |
src/RipSharp.Tests/DiscTypeDetectorTests.cs |
Added 4 tests covering movie/TV/uncertain scenarios |
src/RipSharp.Tests/RipOptionsTests.cs |
Added 3 tests for auto-detect behavior |
README.md |
Updated documentation to show --mode as optional |
EXAMPLES.md |
Added auto-detect examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- create IUserPrompt interface for testable user interaction - implement ConsoleUserPrompt using Spectre.Console SelectionPrompt - inject IUserPrompt into DiscRipper via DI - prompt user when detection confidence is below 70% - show detection hint with confidence percentage - clean menu selection (Movie/TV Series) via Spectre.Console - register ConsoleUserPrompt in DI container Improves UX for edge cases where heuristics are uncertain by allowing user to confirm or override detection results.
- Add tests for high/low confidence movie detection - Add test for high confidence TV detection - Verify 70% threshold behavior - Ensure prompting triggers appropriately
- Add null check for --mode argument value - Fix thread-safety by returning tuple instead of mutable state - Add division by zero checks in CV calculations - Remove unused assignment (durations variable) - Add comment documenting options mutation - Add tests for zero-duration titles - Add test for two-episode TV disc detection - Add test for --mode detect alias - Add test for missing --mode value - Add AutoDetect assertions to existing tests - All 111 tests passing Addresses all code review comments from copilot-pull-request-reviewer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #35
Summary
Implements automatic detection of disc content type (movie vs TV series) based on title structure analysis. Users no longer need to specify
--modeexplicitly - the application intelligently detects the content type by default.Changes
Core Detection
DetectedContentTypeandDetectionConfidencepropertiesUser Experience
AutoDetectflag (default: true)--mode auto|movie|tvnow supportsauto(anddetect)--mode movie|tvdisables auto-detect--tvflag also disables auto-detect--modeoptional with auto defaultTesting
Documentation
--modeoptional, auto-detect default--modewith detailed descriptionsVerified
Tested on real discs:
Migration
No breaking changes - existing
--mode movie|tvusage continues to work. Auto-detect is opt-in by default but can be overridden.