feat: hide redundant caption for videos when it only adds file extension#782
feat: hide redundant caption for videos when it only adds file extension#782
Conversation
…r videos Co-authored-by: huynhsontung <31434093+huynhsontung@users.noreply.github.com>
Co-authored-by: huynhsontung <31434093+huynhsontung@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the user experience for videos without metadata by eliminating redundant caption information. Previously, when a video file had no metadata, the title would display the file's DisplayName (e.g., "MyVideo") while the caption showed the full filename (e.g., "MyVideo.mp4"), creating unnecessary duplication. The PR changes this behavior to display only the full filename as the title when the caption would be redundant, and hides the caption entirely.
Changes:
- Modified MediaViewModel to use the full filename instead of DisplayName, track when details are loaded, and automatically hide captions that duplicate the title
- Updated LibraryService to respect already-loaded media details when applying cached properties
- Adjusted PlayerPage layout to vertically center the title area in MiniPlayer and Hidden states when the subtitle is hidden
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Screenbox.Core/ViewModels/MediaViewModel.cs | Added DetailsLoaded property tracking, changed constructor to use full filename, added logic to hide redundant captions after loading details, and improved null safety by initializing string properties with string.Empty |
| Screenbox.Core/Services/LibraryService.cs | Added check to prevent overwriting media properties from cache if details were already loaded |
| Screenbox/Pages/PlayerPage.xaml | Added RowSpan and VerticalAlignment setters to vertically center the title area in MiniPlayer and Hidden states |
|
Don't like how it looks when it's by itself on the miniplayer. Should we consider increasing its size in that case? |
|
BTW, I'm working on a branch that adds a TitleBar control and I'm considering separating the |
That would require some extra UI logic and not just a simple visual state change. I want to avoid that.
I think separating them is a good move. PlayerPage visual states are quite overloaded. The more reason we shouldn't invest too much into customizing the current mini title. |
For videos without metadata, the title displays the file's DisplayName (e.g., "MyVideo") while the caption shows the full filename (e.g., "MyVideo.mp4"), creating redundant information.
Result