Initial work
This commit is contained in:
commit
929088cef0
13 files changed
+613
No files matched your search
@@ -0,0 +1,39 @@
|
||||
# Problem
|
||||
Every week at Sunday, I write a One Piece progress report of the episodes I watched in the past week.
|
||||
I want to automate this process by creating a script that generates a report based on the episodes I watched.
|
||||
|
||||
# Current Process
|
||||
1. I open Jellyfin to see the latest episode suggested on the homepage.
|
||||
2. The jellyfin episode displayed is in format Season X Episode Y.
|
||||
3. I need the episode number that's actually for the whole series, so in order to get that, I need to check Sonarr to see the episode number for the whole series.
|
||||
4. I then take:
|
||||
- Latest episode I watched on Saturday e.g. 925
|
||||
- Last episode I watched on the previous Saturday e.g. 915
|
||||
- Deduct the number of episodes I watched in the past week, which is 925 - 915 = 10.
|
||||
- Take the date range for the past week, which is Feb 8-14.
|
||||
5. Based on that data, I'd write something like:
|
||||
> ONE PIECE PROGRESS!!! (Feb 8-14)
|
||||
> Episode 928/1155
|
||||
> Around 10 episodes watched this week!
|
||||
|
||||
# Proposed Solution
|
||||
1. We can use python or javascript to create a script that automates this process.
|
||||
2. The script will:
|
||||
- Get the latest Saturday's date and the previous Saturday's date.
|
||||
- Fetch the latest episode the specified user watched from Jellyfin for One Piece using its API.
|
||||
- Also fetch the latest episode the specified user watched from Jellyfin for One Piece from the previous week using its API.
|
||||
- Find the episode number for the whole series from Sonarr using its API given the season and episode number from Jellyfin.
|
||||
- Calculate the number of episodes watched in the past week by deducting the previous week's episode number from the latest episode number.
|
||||
- Generate a templated text to be copied and pasted into the progress report e.g. ONE PIECE PROGRESS!!! etc etc as specified at #5 of the current process.
|
||||
3. The script is just run on a web page, so the web page would give me a detailed report specified at #4 of the current process, and also a templated text that I can copy and paste into my progress report.
|
||||
|
||||
# Stack
|
||||
1. One single container that runs a web server (e.g. Flask for Python or Express for JavaScript) to serve the web page and handle API requests.
|
||||
2. No other dependencies needed besides an existing running container for Jellyfin and Sonarr, which the script will interact with via their APIs.
|
||||
3. Env file where I can specify:
|
||||
- Jellyfin API key and user ID
|
||||
- Sonarr API key and series ID for One Piece
|
||||
- Host names for Jellyfin and Sonarr
|
||||
4. The web page will have a simple form to input the date range (defaulting to the past week) and a button to generate the report. The generated report will be displayed on the page for easy copying.
|
||||
- Auto-fill the date range based on the current date, so that it defaults to the past week (e.g. if today is Feb 15, it will default to Feb 8-14).
|
||||
- The form will also have a button to fetch the latest episode data from Jellyfin and Sonarr, so that the user can easily get the latest episode numbers without having to manually check the APIs
|
||||
Reference in new issue
Block a user