-
Notifications
You must be signed in to change notification settings - Fork 0
Organize code into logical folders and namespaces #40
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
- Created folder structure: Core, Abstractions, Services, Metadata, MakeMkv, Models, Utilities - Updated all namespace declarations to match folder structure - Renamed Metadata class to MetadataInfo to avoid namespace conflict - Added GlobalUsings.cs to both main and test projects for cleaner imports - All 112 tests pass successfully - No functional changes, purely organizational refactoring
- MetadataInfo → ContentMetadata (metadata about media content) - StreamInfo → MediaStream (audio/video/subtitle stream) - FileAnalysis → MediaFileAnalysis (media file analysis) All 112 tests pass successfully
Mirrored main project structure: - Core/: RipOptionsTests - Metadata/: MetadataServiceTests, provider tests, TitleVariationGenerator tests - MakeMkv/: MakeMkvProtocolTests - Services/: DiscTypeDetectorTests - Utilities/: FileNamingTests, DurationFormatterTests Updated namespaces to match folder structure. All 112 tests pass successfully.
Replaced xUnit Assert.* calls with fluent AwesomeAssertions syntax: - Assert.True/False → .Should().BeTrue/BeFalse() - Assert.Equal → .Should().Equal() - Assert.Contains → .Should().Contain() - Assert.Null → .Should().BeNull() - Assert.True(x >= y) → .Should().BeGreaterThanOrEqualTo() - Assert.True(x <= y) → .Should().BeLessThanOrEqualTo() - Assert.True(x > y) → .Should().BeGreaterThan() - Assert.True(range) → .Should().BeInRange() Added global using for AwesomeAssertions in test GlobalUsings.cs. All 112 tests pass successfully.
Removed Arrange/Act/Assert comments as they were adding clutter without providing significant value. All 112 tests pass successfully.
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 PR reorganizes the RipSharp codebase from a flat structure into a logical folder hierarchy with matching namespaces, improving code organization and maintainability. The refactoring includes model renames for better clarity and test improvements using fluent assertions.
Changes:
- Organized code into logical folders (Core, Abstractions, Services, Metadata, MakeMkv, Models, Utilities) with matching namespaces
- Renamed models for clarity: MetadataInfo → ContentMetadata, StreamInfo → MediaStream, FileAnalysis → MediaFileAnalysis
- Added GlobalUsings.cs files to both projects for cleaner imports, converted test assertions to AwesomeAssertions fluent syntax, and added .editorconfig for consistent code formatting
Reviewed changes
Copilot reviewed 55 out of 56 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/RipSharp/Utilities/FileNaming.cs | Updated namespace to RipSharp.Utilities, changed parameter type from Metadata to ContentMetadata? |
| src/RipSharp/Utilities/DurationFormatter.cs | Updated namespace to RipSharp.Utilities |
| src/RipSharp/Utilities/ConsoleUserPrompt.cs | Updated namespace to RipSharp.Utilities, cleaned up trailing whitespace |
| src/RipSharp/Utilities/ConsoleProgressNotifier.cs | Updated namespace to RipSharp.Utilities |
| src/RipSharp/Utilities/ConsoleColors.cs | Updated namespace to RipSharp.Utilities |
| src/RipSharp/Services/ProcessRunner.cs | Updated namespace to RipSharp.Services |
| src/RipSharp/Services/EncoderService.cs | Updated namespace to RipSharp.Services, renamed StreamInfo to MediaStream and FileAnalysis to MediaFileAnalysis, made local function static |
| src/RipSharp/Services/DiscTypeDetector.cs | Updated namespace to RipSharp.Services, cleaned up trailing whitespace |
| src/RipSharp/Services/DiscScanner.cs | Updated namespace to RipSharp.Services |
| src/RipSharp/Services/DiscRipper.cs | Updated namespace to RipSharp.Services, renamed Metadata to ContentMetadata, organized imports |
| src/RipSharp/Models/TitleInfo.cs | Updated namespace to RipSharp.Models |
| src/RipSharp/Models/MediaStream.cs | Updated namespace to RipSharp.Models, renamed class from StreamInfo to MediaStream |
| src/RipSharp/Models/MediaFileAnalysis.cs | New file with namespace RipSharp.Models, renamed from FileAnalysis |
| src/RipSharp/Models/DiscInfo.cs | Updated namespace to RipSharp.Models, cleaned up trailing whitespace |
| src/RipSharp/Models/ContentMetadata.cs | Updated namespace to RipSharp.Models, renamed class from Metadata to ContentMetadata |
| src/RipSharp/Metadata/*.cs | Updated all metadata-related files to RipSharp.Metadata namespace, renamed Metadata to ContentMetadata |
| src/RipSharp/MakeMkv/*.cs | Updated all MakeMkv-related files to RipSharp.MakeMkv namespace |
| src/RipSharp/GlobalUsings.cs | Added global using directives for all namespaces |
| src/RipSharp/Core/*.cs | Updated all core files to RipSharp.Core namespace, cleaned up formatting |
| src/RipSharp/Abstractions/*.cs | Moved all interface files to Abstractions folder with RipSharp.Abstractions namespace |
| src/RipSharp.Tests/**/*.cs | Updated test file namespaces to mirror main project structure, converted xUnit Assert to AwesomeAssertions fluent syntax |
| src/RipSharp.Tests/GlobalUsings.cs | Added global using directives for test files including AwesomeAssertions |
| .editorconfig | Added comprehensive C# code style and formatting rules |
Comments suppressed due to low confidence (3)
src/RipSharp/Services/DiscRipper.cs:49
- The error message contains "ContentMetadata?" which appears to be a copy-paste error. The question mark from the type annotation should not be part of the error message. It should read "Metadata lookup failed" or "Content metadata lookup failed" instead.
src/RipSharp/Utilities/FileNaming.cs:17 - The parameter type was changed from ContentMetadata to ContentMetadata?, making it nullable, but the method body immediately dereferences it on line 17 without null checking (metadata.Title). This will throw a NullReferenceException if null is passed. Either add null checking in the method body or keep the parameter as non-nullable since the caller already uses the null-forgiving operator.
src/RipSharp/Services/EncoderService.cs:52 - This foreach loop immediately maps its iteration variable to another variable - consider mapping the sequence explicitly using '.Select(...)'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #18
This PR reorganizes the codebase from a flat structure into logical folders with matching namespaces.
Folder Structure
Main Project (src/RipSharp)
Test Project (src/RipSharp.Tests)
Mirrored folder structure:
Key Changes
Code Organization
git mvto preserve historyModel Renaming (Better Clarity)
Test Improvements
Verification