Open evanwill opened 4 years ago
Also an issue with ".jpg" showing up in the filenames. Need to think through this. Might want identifier ... or might want to make SA have correspondence between filename (minus extenstion) and objectid ...
Looking back, all the current standalone use filename
for the object download only, and assume that the small and thumb are based on objectid
.
I think this goes back to early versions of the project, it assumed that there was small.jpg and thumb.jpg for every object which simplifies all the visualization pages, but then the filename would provide the object download without having to use logic to figure out what type of file it was, which simplifies the item page. This is kind of nice too for accommodating random file type downloads, since they could be anything, rather than the limited types the logic could guess.
It make sense to me to require filename
correspond to objectid
or vice versa.
@dcnb @owikle thoughts and more questions:
I am thinking we should require all object files to be named matching objectid
. Wax also requires this. It makes everything simpler and more sensible.
I think we should provide a rake task to do bulk file renaming, since that is pretty handy thing to have. I use a python version all the time where you use a csv with columns like current_filename,new_filename
. It could give warnings for bad filename conventions, etc. Like all the rake tasks, it is basically optional, you could do the renaming how ever you want, but is there if necessary.
If we follow that, do we need filename
column?
Do we just expect that format
is accurate enough to use logic to guess the file extensions?
How do we support compound objects?
My current standalones with compound objects use filename
to represent the main image, and compound
is multivalued field of other filenames. Wax uses a folder named the objectid, with multiple images inside.
I just ran up against this filename vs. objectid issue while trying to get the UI Extension collection up and running and created this WIP rake task to rename the object files to match their objectid
: https://github.com/CollectionBuilder/collectionbuilder-sa_draft/blob/multicollection-search/Rakefile#L228-L379
This PR uses objectid
for object filenames and adds a rake task to do the renaming : https://github.com/CollectionBuilder/collectionbuilder-sa_draft/pull/48
use filename to grab images (not objectid)