Closed dyreschlock closed 1 year ago
This will be a 3-step process. The first 2 steps can be run from a standalone app, and probably also triggers from page loads. The last step happens during page loads.
Actually, once everything has been set in the database, we probably don't need the standalone app anymore as those images and IDs could be created and fetched during the first page load.
Images from the gallery and cover images now use the Image object in the database. The bodyText image links yet do not.
All images that are displayed through the post body, gallery, and as a cover image have objects in the database and when those links are rendered it is looking at these objects. If the object has a google id, it'll use that for its image link. If the object doesn't have a google id, then it'll default to normal links.
The only thing that remains is (1) getting the google id for every image in the database, and (2) making sure those image in drive are set to visible.
This quick start guide from Google worked. I'm able to establish a connection now: https://developers.google.com/drive/api/quickstart/java
Seems like setting the root directory to 'visible' makes everything within visible too!
It would probably be better to do this on an individual file basis, but I think it's good enough :D
As I've been making the website more static to be easily hosted ( #46 ), images are a bit of problem. Overall, I have 5gb worth of images for my site, and github has a limit of 5gb for its repositories. But, besides that, these images are already being hosted through Google Drive, so I should be using that storage rather than github.
Google Drive has a unique ID for each file, so it's not a simple process of using the filepath to find the photo.
The Google Image link should be something like this: https://drive.google.com/uc?id=DRIVE_FILE_ID https://drive.google.com/file/d/13XE4Ah1aK5kSGniMbeard9DJ1iuroR_K/view