Gonna do it in PHP because I used PHP daily for 12 years and haven’t used it in like 5 years and want to reconnect with it.
I have quite a few shows downloaded and want to have a way to generate a playlist for the day for my kid to watch on his tablet.
Will need a database to keep track of every show and episode and if he’s watched it before.
Do I want to bother renaming every file to have a sensible name or just compensate for it in the code with some regex?
$showModel->getEpisode( $absolute_episode= 40);
$showModel->getEpisode( $season = 2, $episode = 17);
$showModel->getLastWatchedEpisode();
$showModel->getNextUnwatchedEpisode();
Getting an episode, whether looking at file names on disk, or looking in a database… when I put them into the database in the first place I would need to have already parsed the random file names to deduce the season and episode to store that info properly.
$allShows = $showModel->getAllShows();
for each {
$allShows as $showModel...
$playlistBuilder->add( $showModel->getNextUnwatchedEpisode() );
}
$playlistBuilder->randomize();
$playlistBuilder->writeM3uFile( date("Y-m-d") );
By using extended m3u options I might be able to force VLC to show a more detailed playlist entry item than just the awkward original file names.
Will need to be able to include/exclude shows from the playlist build process to make it easy to test/debug certain things.
For example if I have only 5 episodes of Big City Greens and all 5 eventually get marked as watched
then there won’t be anything returned from $showModel->getNextUnwatchedEpisode();
When I add 20 more episodes of that I’d like to be able to do a test run that includes only Big City Greens, One Piece, and Naruto just to make sure that those new episodes are being picked up.
to be continued…