sharmaanupam106 / TvShuffleForPlex

The purpose of this application is to allow a chronological shuffling of tv shows. The selected TV Shows maybe shuffled however the episodes will be selected based on next unwatched.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TvShuffleForPlex

Description

The purpose of this application is to allow a chronological shuffling of tv shows. The selected TV Shows maybe shuffled however the episodes will be selected based on next unwatched.

NOTE: This is not a secure site, keep it within your local network. (no port forwarding)

How it works

  • You select a series of TV shows you want to see
  • You select the length of the queue you want generated. (default 20)
  • You select shuffle.
    • Inclusive shuffle will only pick episodes from the selected tv shows
    • Exclusive shuffle will only pick episodes from all shows NOT selected.
  • The app will randomly pick a show from your selected tv shows list, and find the next unwatched episode to put in the queue slot
    • It will move on to the next queue slot and pick a random show to do the same with.
    • If a show is selected for 2 or more slots and the next unwatched episode is already in the queue, the later slot will get the episode following the last episode in the list, keeping the order of episodes in the queue in order.
  • Once the queue is generate, you select which active client you want the queue sent to for viewing.

High level functionalities

  • Allow users to select the plex server from which to source tv shows.
  • Allow users to multi select tv shows from which shuffled (inclusive and exclusive) episodes will be selected.
  • Allow users to save the selected tv shows as lists, making it easier to come back to the same list of shows.
  • Allow users to set the max number of episodes that will be put in the plex queue.
  • Allow users to push the generated episodes plex queue to a given client.

Supported Systems

  • Ubuntu 20.x - Manjaro 20.x
  • Windows 10 (64bit)

Installation

LINUX

Auto Service Install

Does the same steps as the Manual Install

  1. Download the Git Repo
  2. Run the service_install.sh script This script required elevated privileges to run
    • Use sudo service_install.sh to prevent having to put your password multiple times, or erring out
    • Uninstall using service_uninstall.sh script This script required elevated privileges to run

Manual install

  1. Download the Git Repo
  2. Install the requirements pip3 install -r requirements.txt
  3. Make migrations
    python3 manage.py makemigrations
    python3 manage.py migrate
    
  4. Start the application python3 manage.py runserver {IP}:{PORT}
Optional
  • Create and Enable a service.
    • Create service file touch TvShuffleForPlex.service
    • Edit the file with the following (Make sure you update all {} with the correct info)
    [Install]
    WantedBy=multi-user.target
    
    [Unit]
    Description=TV Shuffle For Plex
    After=network.target
    StartLimitIntervalSec=0
    
    [Service]
    WorkingDirectory={INSTALL PATH}
    Type=simple
    Restart=always
    RestartSec=1
    ExecStart={FULL PATH TO PYTHON3} {INSTALL PATH}/TvShuffleForPlex/manage.py runserver {IP}:{PORT}
    
    • Link the to service controller systemctl link ./TvShuffleForPlex.service
    • Reload daemon systemctl daemon-reload
    • Enable the service systemctl enable TvShuffleForPlex.service
      • Will automatically start the service on boot.
    • Start the service systemctl start TvShuffleForPlex.service
      • Check to make sure the service started normally without errors systemctl status PlexTvStation.service
  • Starting and Stopping the service
    • Start service systemctl start TvShuffleForPlex.service
    • Stop service systemctl stop TvShuffleForPlex.service

Troubleshooting

  • Read the log files at {INSTALL PATH}/TvShuffleForPlex/_tvshuffleforplex/logs
  • Read console outputs journalctl -u TvShuffleForPlex.service
  • Google errors that might occur.

Windows

Thank you to NSSM - Non-sucking Service Manager for making Windows service creation simple

Auto Service Install

Does the same steps as the Manual Install

  1. Download the Git Repo
  2. Run the service_install.bat script This script required elevated privileges to run
    • Uninstall using service_uninstall.bat script This script required elevated privileges to run

Manual install

  1. Download the Git Repo
  2. Install the requirements pip3 install -r requirements.txt
  3. Make migrations
    python3 manage.py makemigrations
    python3 manage.py migrate
    
  4. Start the application python3 manage.py runserver {IP}:{PORT}
Optional
  • Create and Enable a service. Using NSSM - Non-sucking Service Manager located in {INSTALL PATH}\nssm-2.24\win64\nssm.exe

    (Make sure you update all {} with the correct info)

    • Create a service from an admin cmd nssm.exe install TvShuffleForPlex {FULL PATH TO PYTHON} {INSTALL PATH}/TvShuffleForPlex/manage.py runserver {IP}:{PORT}
    • Start the service nssm.exe start TvShuffleForPlex
    • Check the status of the service nssm.exe status TvShuffleForPlex

Usage

  • Login with your plex account

    http://{IP}:{PORT}/login
    

    Login

  • Select a plex server

    ServerSelect

  • Select TV Shows

    ShowSelect

  • Shuffle the Shows

    • Inclusive/Exclusive select
    • Max episodes in generate queue

    Shuffle

  • Shuffle the list

  • Select a client to push the queue to

    ClientPush

  • Save the selected list

    SaveList

  • Select saved List

    SelectList

About

The purpose of this application is to allow a chronological shuffling of tv shows. The selected TV Shows maybe shuffled however the episodes will be selected based on next unwatched.

License:GNU General Public License v3.0


Languages

Language:C++ 62.9%Language:Python 26.1%Language:C 5.3%Language:HTML 3.6%Language:Batchfile 1.5%Language:Shell 0.5%Language:Makefile 0.2%