Bare with me I’m just getting back into programming after a 20 year hiatus.
What I’m looking to do is just create a function to run against a gallery (and eventually batch on galleries). If the gallery is a folder zip it, name the zip the same as the folder. Generate a file for the files table, then update the gallery to use the zip file instead of the folder.
Unless I’m missing something I should just be able:
Python generate zip → Create files row for this zip → GQL mutation to strip gallery.folder_id for the gallery in question → mutation generate galleries_files with the new files entry id → do some validation → delete the old folder.
First question: Am I missing something or does that all sound right?
Second question: Is there a particular API/GQL/Function I should be looking at to generate the new item in the files and galleries_files tables? While I’m planning on using Python, I was hoping to avoid directly manipulating the SQlite DB directly with it.