refactor: media types rework, dynamically load preview renderers - #1498
Open
CyanVoxel wants to merge 24 commits into
Open
refactor: media types rework, dynamically load preview renderers#1498CyanVoxel wants to merge 24 commits into
CyanVoxel wants to merge 24 commits into
Conversation
CyanVoxel
marked this pull request as ready for review
September 3, 2026 07:05
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR completely reworks the media type system to allow for new functionality such as multiple group contexts, group names and multiple aliases, and dynamic media type registration. This PR also changes how preview renderers are loaded, turning them from functions into classes and dynamically loading them on startup. Preview renderers now handle their own media type registration, further reinforcing this modular change.
Since this diff is pretty large, I'll point any potential reviewers to the following areas:
media_types.pyhas completely new code and has been downsized to be just the class logic.file_groups.pyfor theSEARCHcontext, and inside individual preview renderers for theRENDERcontexts. These are largely the same extensions, just grouped and translated to the new system.Media Types
FileTypeobjects / one or more extensions associated with one or more contexts.MediaTypeGroups then group these file types into a named groups along with their contexts. Depending on how a group is accessed with a given context, the members of the group may differ.Preview Renderers
render()methodProgress towards #1460
Tasks Completed