You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my derivatives are there, however their paths on the storage (S3) seems to be using the default locations, instead of going through the code I have in my custom generate_location(io, name: nil, record: nil, derivative: nil, metadata: {}, **options) method as part of the pretty_location plugin.
In my generate_location implementation I'm nesting files underneath a few directories, something like
This is working for the main file when I upload it through Shrine, but not for any of the derivatives I'm pulling in via the transloadit_saver and merge_derivatives methods.
Basically, the uploaded file is being correctly stored at the S3 path:
Yes, Shrine won't use its own #generate_location method, as it doesn't have all the information this method might expect.
You can pass the :path parameter to the #transloadit_export_step method you're calling in your Attacher.transloadit_processor block, which will get forwarded to the underlying step, e.g:
import=file.transloadit_import_stepencode=transloadit_step"encode","/video/encode",use: import# pass derivative name, filename metadata for extension, and attacher contextencode_location=store.generate_location(nil,derivative: :encoded,metadata: {"filename"=>"name.mp4"}, **context)export=store.transloadit_export_stepuse: encode,path: encode_locationassembly=transloadit.assembly(steps: [import,encode,export])assembly.create!
I've got my Transloadit
transloadit_processor
andtransloadit_saver
methods hooked up as shown in the docs here:https://github.com/shrinerb/shrine-transloadit#usage
after calling
my derivatives are there, however their paths on the storage (S3) seems to be using the default locations, instead of going through the code I have in my custom
generate_location(io, name: nil, record: nil, derivative: nil, metadata: {}, **options)
method as part of thepretty_location
plugin.In my
generate_location
implementation I'm nesting files underneath a few directories, something likeThis is working for the main file when I upload it through Shrine, but not for any of the derivatives I'm pulling in via the
transloadit_saver
andmerge_derivatives
methods.Basically, the uploaded file is being correctly stored at the S3 path:
but the derivatives coming in via
shrine-transloadit
are not, instead shrine is sticking them at the root of the storage in a path like:Is there a way to make these transloadit derivatives go through the same
pretty_location
logic so I can store them alongside the original?Thanks!
The text was updated successfully, but these errors were encountered: