Skip to content

MasterEvarior/plex-pinned-collection-randomizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Plex Pinned Collection Randomizer

quality workflow release workflow

A small utility script, which randomises the pinned collections on my Plex server. I run this in conjunction with Kometa.

If you want something more capable or with a GUI, you may want to use these alternatives instead:

Build

To build the container yourself, simply clone the repository and then build the container with the provided docker file. You can the run it as described in the section below.

docker build --tag ppcr .

Alternatively you can install the necessary dependencies with pip and the run the script:

pip install --no-cache-dir -r requirements.txt
python script.py

Run

The easiest way is to use the provided container. Do not forget to add the necessary environment variables.

docker run -d \
  -e PPCR_BASE_URL='http://192.168.1.1:32400' \
  -e PPCR_TOKEN='xxxx' \
  ghcr.io/masterevarior/plex-pinned-collection-randomizer:latest

Environment Variables

Name Description Default Example Mandatory
PPCR_BASE_URL URL to your Plex server http://192.168.1.1:32400 βœ…
PPCR_TOKEN Token for your Plex server xxxxxxx βœ…
PPCR_AMOUNT Amount of collections that should be pinned at random 5 12 ❌
PPCR_MIN_AMOUNT_IN_COLLECTION Amount of movies/shows a collection does need to include to be considered for pinning 0 3 ❌
PPCR_ALWAYS_PIN A list of strings, seperated by ;. If these strings are found inside of a collection name, it will always be pinned (empty) Popular;Christmas Things ❌
PPCR_ALLOW_DUPLICATES If set to false, no collections with the same name will be pinned. True False ❌
PPCR_INCLUDED_LIBRARY_TYPES A list of strings, seperated by ;. Only libraries with this type of media will be considered, valid are movie and show. movie;show movie ❌

Development

Linting

All linters are run with the treefmt command. Note that the command does not install the required formatters.

treefmt

Git Hooks

There are some hooks for formatting and the like. To use those, execute the following command:

git config --local core.hooksPath .githooks/

Nix

If you are using NixOS or the Nix package manager, there is a dev shell available for your convenience. This will install Go, everything needed for formatting, set the Git hooks and some default environment variables. Start it with this command:

nix develop

If you happen to use nix-direnv, this is also supported.

Improvements, issues and more

Pull requests, improvements and issues are always welcome.

About

πŸ“Œ Pin random collections to your Plex home page

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •