In the [[38-hanami-mastery-app|episode 38]], we used a high-level application diagram to visualize the needs our hanami mastery application will help us to solve.
In this episode, we'll go to the next level, and I'll start taking care of one of the most annoying steps I have during the episode creation process, which is thumbnail preparation.
My process for preparing thumbnails is this:
- Create Thumbnail in Google Drive - When the video is starting to be produced, the thumbnail is chosen, prepared, and downloaded to the episode's google drive folder.
- Prepare Versions - We use this thumbnail for youtube videos, but also we save it in the repository and generate image versions out of it.
- Push all versions to GitHub - at the end, all the images are committed to the episode's branch and pushed to GitHub, waiting for publication.
Google Drive Integration schema
I want to completely delegate or automate the work choosing and adjusting thumbnails, and I don't want people to be forced learning how to work with GitHub repositories and how to commit files.
This is the reason why I'll keep uploading thumbnails to drive following a simple file name convention and automate the rest.
As you may expect, to work with thumbnails, I need to download my file from google.
Later we'll download it once the episode gets scheduled using some sort of sidekiq observer or event listener.
Let's start with the google drive integration then.
To start working with google API, I visited their Python tutorial for the language-agnostic part.
First you need to enable it on your account using google UI, and then setup credentials.
Then make sure you share your drive with the service account email.
You'll need to create a new access Key and download as a json file, saved in the root directory of our project.
Once you have it, we can implement the connection.
Subscribe to Hanami Mastery PRO
This is only a preview of the episode. Subscribe to Hanami Mastery PRO to see the full video, and access several other premium resources. Thanks for watching, and see you in the next one!
That's all for today, thank you for watching, and see you in the next episode!
Add your suggestion to our discussion panel!
I'll gladly cover them in the future episodes! Thank you!