.ass.gz - multi-part file extensions issues

I’m trying to write a publish hook to use with tk-multi-publish-2 that will accept both .ass and .ass.gz files. In my templates I’ve defined a key for the file extension to accept them both which works happily, but I can’t get shotgun to work nicely with the .ass.gz extension in two other areas.

tk-multi-publish2.utils defines get_file_path_components, which is used by the standard collector. One of its functions is to determine the file extension, but I can’t get it to recognise .ass.gz as the extension, instead it returns just .gz, so I’m unable to use .ass.gz in the collector’s file type definitions. I don’t mind working around this by just defining .gz as an extension for this file type, but I’d prefer a cleaner solution if possible.

The bigger issue is that the publisher.util.get_frame_sequence_path method doesn’t recognise file sequences ending in .ass.gz. I presume this is because it only considers file paths where the frame number is in the penultimate term? This is resulting in the misidentification of my publish items as single files rather than sequences, scuppering the later _copy_work_to_publish method in publish_sg_common, as this relies on the sequence_paths property filled by the previously mentioned method. The end result is only one file gets copied.

I’m quite new to shotgun so I might be missing something simple? Is there an example of how to handle file extensions like this? Or do I need to start overriding methods?

Thanks!

3 Likes

Hi @joejf I’m sorry we didn’t get back to you on this, I appreciate you’ve probably moved on now.
But I briefly looked at the methods and I think your correct they wouldn’t allow for the extension .ass.gz because of the two full stops.

In this situation, I think you would have to take over the publish hooks that call these methods, and implement your own version of the methods and call them instead.