File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ def generate_metadata_from_file_name(file_name: PathLike | str, arch: str) -> di
159159 @staticmethod
160160 def lookup_media_type_for_file_name (file_name : str ) -> str :
161161 """
162- Looks up the media type based on file extension.
162+ Looks up the media type based on file name or extension.
163163
164164 :param file_name: File path and name of the target layer
165165
@@ -170,9 +170,9 @@ def lookup_media_type_for_file_name(file_name: str) -> str:
170170 if not isinstance (file_name , PathLike ):
171171 file_name = Path (file_name )
172172
173- for suffix in GL_MEDIA_TYPES :
174- if file_name .match (f"*.{ suffix } " ):
175- return GL_MEDIA_TYPE_LOOKUP [suffix ]
173+ for lookup_name in GL_MEDIA_TYPES :
174+ if file_name .match (f"*.{ lookup_name } " ) or str ( file_name ) == lookup_name :
175+ return GL_MEDIA_TYPE_LOOKUP [lookup_name ]
176176
177177 raise ValueError (
178178 f"Media type for { file_name } is not defined. You may want to add the definition to parse_features_lib"
You can’t perform that action at this time.
0 commit comments