iftechfoundation / ifarchive-admintool

Admin script for IF Archive work
1 stars 1 forks source link

Send original filename to `ifarchive-commit` #45

Closed dfabulich closed 6 months ago

dfabulich commented 6 months ago

Apropos https://github.com/iftechfoundation/ifdb-suggestion-tracker/issues/448

https://ifarchive.org/misc/org-procedures.html explains that when users upload HTML to ifarchive.org, the archive team clicks a button to zip it up. This changes the filetype of the file as it was uploaded to IFDB.

Later, when the archive team clicks the "Notify IFDB" button, which pings ifarchive-commit, the pending link will be updated to point to the ZIP file, but we won't update the file type of the link on IFDB. This requires manual work for the archive team to fix the file type and make the link work.

In order for IFDB to do the fixup automagically, we'd need to know the original filename of the file, so IFDB's Play Online button can link to it directly via unbox.

Perhaps pass it in an original_filename URL parameter?

erkyrath commented 6 months ago

Right. The ifarchive-commit request now looks like

https://ifdb.org/ifarchive-commit?ifdbid=1235531&path=if-archive/books/the-book&key=YYYY&tuid=abc123&original_filename=stuff.txt.orig

There's one thing to watch out for, though. If a file is uploaded more than once, we'll have multiple upload records. Since the primary key for this is the file MD5, we can't tell the records apart.

Therefore, it's possible that the request will come in with multiple tuid or original_filename keys. Or none, conceivably.

(There will be exactly one ifdbid key, though.)