Here’s a weekly update of Project One.
If you recall reading about v0.0.1, we made a quick outline of what the first milestone needed to look like. Let’s recap, changing a few small things:
- Hardware - Raspberry Pi 4B + 128GB USB Stick (temporary, testing)
- Goal - One channel, focused on a single TV Series that airs between 5AM-10PM.
- Scheduler - Reads in a Channel Definition file, creates a channel based on rules, creates a unique schedule based on rules to fill programming for the day, and hands the channel and schedule to the Program Manager.
- File Watcher - Makes sure that Series and Episode metadata is available offline so that the Scheduler can work. Scans for new TV series, makes sure that each Series is in the master database, has Series metadata and all Episode metadata in a local database (episodes metadata is stored in local JSON file for future access), parses said metadata, and manages the databases.
- Program Manager - Takes the schedule provided by the Scheduler, finds which file to play, determines the playback position, and plays the file at the proper playback position.
- Software - Python, FFMPEG/FFPlay, SqLite3, TheTVDB Python Module
As of today, I am pleased to say that everything above is working as described above. I am able to run the script, files and databases are managed, a schedule and channel are created based on a single Channel Definition file, and playback is started immediately per schedule.
So, what doesn’t work in the scope of v0.0.1?
Currently, there is nothing setup for the Program Manager to handle the schedule, as in playing one file after the other. I can run the script in its current state and it will only play the file that the schedule says to, then the script ends. From what I can gather, I’ve got to research and build the Program Manager to handle separate processes, being able to basically keep an eye on the time and say “It’s 11:30AM, play this episode.” When the next time block comes around, the Program Manager can say “It’s 12PM, play this episode.”
Next, the structure of channels, schedules, etc, it’s very basic. Maybe it’s all I need and I’m sure that the structure will change over time as things are needed, however, it works for now.
As for steps beyond this milestone, I will add in more channels, create the tedious task of “changing channels”, look into more complicated channel definitions and rules, and then finally get around to the hardware side of things.
Time to rest over the weekend and get back to it on Monday.