-
-
Notifications
You must be signed in to change notification settings - Fork 448
Add additional media file extensions for Preview #3682
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
This comment has been minimized.
This comment has been minimized.
📝 WalkthroughWalkthroughThe static array of recognized media file extensions in Changes
Assessment against linked issues
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (5)
Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs (5)
352-356
: Use a HashSet for faster extension lookups
Replacing the array with aHashSet<string>
(usingStringComparer.OrdinalIgnoreCase
) yields O(1) containment checks and will scale better as you add more extensions.-private static readonly string[] MediaExtensions = -{ - ".jpg", ".png", ".avi", ".mkv", ".bmp", ".gif", ".wmv", ".mp3", ".flac", ".mp4", - ".m4a", ".m4v", ".heic", ".mov", ".flv", ".webm" -}; +private static readonly HashSet<string> MediaExtensions = new(StringComparer.OrdinalIgnoreCase) +{ + ".jpg", ".png", ".avi", ".mkv", ".bmp", ".gif", ".wmv", ".mp3", ".flac", ".mp4", + ".m4a", ".m4v", ".heic", ".mov", ".flv", ".webm" +};
352-356
: Add unit tests for new media types
There are currently no tests verifying thatIsMedia
recognizes.m4a
,.m4v
,.heic
,.mov
,.flv
, and.webm
. Please add coverage to prevent regressions.Let me know if you’d like a test scaffold.
352-356
: Consider externalizing the extension list
A hard-coded array makes updates and user customization harder. In the future, moving these values into plugin settings or a JSON config would be more flexible.
352-356
: Sort extensions alphabetically for maintainability
Alphabetical order improves readability when the list grows.- ".jpg", ".png", ".avi", /*...*/, ".flv", ".webm" + ".avi", ".bmp", ".flac", /*...*/, ".mkv", ".webm"
352-356
: Verify coverage of other common formats
Formats like.wav
,.ogg
, or.webp
aren’t included. If preview support is desired for those, consider adding them now.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: build
- GitHub Check: Check Spelling
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
🥷 Code experts: Jack251970 Jack251970 has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
Add additional media file extensions for Preview
Add additional media file extensions for Preview
What's the PR
Comment