Skip to content

Commit

Permalink
Prefer auto-decompressed datatype when picking conversion target
Browse files Browse the repository at this point in the history
Fixes #18709
  • Loading branch information
mvdbeek committed Nov 19, 2024
1 parent da31407 commit f559ced
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/galaxy/datatypes/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,16 @@ def find_conversion_destination_for_dataset_by_extensions(
if datatype and datatype.matches_any(accepted_datatypes):
return True, None, None

for convert_ext in self.get_converters_by_datatype(ext):
converter_extensions = self.get_converters_by_datatype(ext)
uncompressed_instance = getattr(datatype, "uncompressed_datatype_instance", None)
if uncompressed_instance and uncompressed_instance.file_ext in converter_extensions:
# sort uncompressed instance ahead of other possible conversions
converter_extensions = [
uncompressed_instance.file_ext,
*(ext for ext in converter_extensions if ext != uncompressed_instance.file_ext),
]

for convert_ext in converter_extensions:
convert_ext_datatype = self.get_datatype_by_extension(convert_ext)
if convert_ext_datatype is None:
self.log.warning(
Expand Down

0 comments on commit f559ced

Please sign in to comment.