The playlist randomizer is a tool that can be used to randomly select a TV show from a personal repository and continue where you left off by setting an episode marker in each show. At this moment in time, it should be used exclusively with VLC Media Player.
If you'd like to use this program, you can find a copy of it in the dist
subfolder of this repository. Additionally, if you'd like to make changes, you can clone/fork this repository and use pyinstaller to generate your own executable.
git clone https://github.com/jonotassia/playlist-randomizer.git
pip install -r requirements.txt
pyinstaller -wF vlc_randomizer.py
Once you've got the application up and running, you can follow this Quick Start Guide to get started.
A playlist will be created using the list of shows and frequencies provided in a playlist scheme:
-
Workflow:
- Select a scheme to generate the playlist.
- Select the maximum duration of the playlist.
- Randomize TV Shows/Movies
- Launch VLC Media Player with playlist from above
-
Requirements
- Programme uses native VLC playlist queue to populate videos so that they play one after another
- Programme imposes a queue limit in the playlist either by number of hours or number of episodes, adjustable by user parameters
- Programme saves off in the show directory a tracker of which episode within the show should play next based on the last episode played (sequential selection)
- This will be set when the user loads the playlist into VLC Media Player
- If show folders have subfolders for seasons or other extras, these markers will correctly point to the next episode in the show using a human sort.
- Programme uses native VLC playlist queue to populate videos so that they play one after another
-
Workflow:
- User creates or edits a scheme, which generates a file in the TV_PATH/.scheme/ folder, containing the following elements:
- Title: Playlist name
- Each row: folder_name, frequency
- User can select frequency for each show, which impacts the odds that the programme will be selected. A zero means it will be omitted entirely.
- User creates or edits a scheme, which generates a file in the TV_PATH/.scheme/ folder, containing the following elements:
-
Workflow:
- User selects a TV show from the TV_PATH
- The show prepopulates with the first episode of the show if it is the first time it has been loaded.
- User can browse the folder and select the next episode in the series for that show.
There are 2 key elements in the file structure of this program:
- .eps files [.txt]: These files are used to point the program to the correct episode of the show. Each subdirectory beneath a show folder will have one of these files and will incrementally point it to the right episode folder by folder.
- .scheme folder [.csv]: The .scheme folder houses all of the schemes that a user creates. It is created dynmically when the user creates their first scheme.
There are 5 main classes in this program:
- Playlist: Controls the functionality around building the playlist and tracking which episodes have been encountered in order to correctly write the .eps files on load into VLC.
- Show: Manages search methods within a TV show, including finding the first, current, or next episodes of the show.
- Scheme: Manages data in the form of a Pandas dataframe that is loaded from a scheme files.
- Interface: Controls user inputs and builds the GUI. Also contains methods to load playlist into VLC.
- PathManager: Controls program level paths that are needed for running the programme, such as the VLC Path and TV Path.