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:
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
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
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 |
β |
All linters are run with the treefmt command. Note that the command does not install the required formatters.
treefmt
There are some hooks for formatting and the like. To use those, execute the following command:
git config --local core.hooksPath .githooks/
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.
Pull requests, improvements and issues are always welcome.