Skip to content
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

Added ability to iterate all mimetypes and get their extensions #81

Merged
merged 2 commits into from
Feb 11, 2024

Conversation

horch004
Copy link

KnownMimeTypes.tt

  • Added ALL_MIMETYPES to the template to generate a list of all mimetypes.

MimeUtilitiy.cs

  • Changed the name of the static field _lazyDict to _lazyDictExtensions.
  • Added a _lazyDictMimeTypes field, like the _lazyDictExtensions, to be able to iterate all mimetypes and get their extensions.
  • Added a public static property refering to the value of _lazyDictMimeTypes.

I have my own utility functions which are using the dictionary to build a list of video and audio extensions by looking at the mimetype.

(In the commit comments there are some writing errors. This description is more correct.)

- Add ALL_MIMETYPES to the template to generate a list of all mimetypes.
MimeUtilitiy.cs
- Changed the name of the stastic _lazyDict to _lazyDictExtensions.
- Added a _lazyDitMimeTypes dictionary like the _lazyDictExtensions to be able to iterate the mimetypes and get their extensions.
- Added a public static property refering to the value of _lazyDictExtensions.
Copy link
Collaborator

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add tests

…added TypeToExtensionsMap property of the MimeUtility class.
@horch004
Copy link
Author

Hi, thanks for reviewing the pull request.
I am not really familiar with testing this way, but I added a test method which does some checkes like the other methods do. Suggestions are welcome.

@horch004
Copy link
Author

Hi, when you decide to accept the pull, it would be no problem to change anything I did to fitt your way of doing things. I am greatfull using your work.

@zone117x zone117x merged commit cf88b56 into zone117x:master Feb 11, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants