Skip to content

michaeldtimpe/the-game

Repository files navigation

The Game

A movie randomizer web app that picks films from your Plex libraries and curated studio collections, displaying them in a visual poster grid that emulates the Plex shelf browsing experience.

What It Does

Each time you hit Play, The Game:

  • Picks a random movie from each of your Plex libraries, then shows it alongside 5 alphabetical neighbors (6 total per library) -- just like scrolling to that spot in Plex
  • Picks one random film each from Disney, Marvel, Pixar, and Lucasarts curated lists
  • Displays everything in a dark-themed poster grid with movie artwork

The randomly chosen movie in each library row is highlighted with a white title. Studio picks show posters fetched from TMDB.

Franchise de-clustering: libraries are browsed in alphabetical order, so a long shared prefix would otherwise bunch a whole series together -- every "Harry Potter and the ..." film sorts under "Ha", so a pick there fills the entire row with Harry Potter. The shuffle instead sorts such titles by their distinctive part (Chamber of Secrets, Goblet of Fire, Prisoner of Azkaban ...), scattering them across the library for a more varied row. The full title is still shown on each card. To de-cluster another series, add its prefix to SORT_PREFIXES in server.js.

Quick Start

Local Development

# Install dependencies
npm install

# Copy and configure
cp config.example.json config.json
# Edit config.json with your Plex URL, token, TMDB key, and library section IDs

# Run in dev mode (backend + Vite hot reload)
npm run dev
# Open http://localhost:5173

Production

npm run build
npm start
# Open http://localhost:3000

Docker (Synology Compatible)

# Place config.json next to docker-compose.yml
docker-compose up -d --build
# Open http://YOUR_NAS_IP:3000

On Synology, you can also import via Container Manager by pointing a new project at this folder.

For deploying/operating the live instance (on a Synology NAS), see docs/DEPLOY.md.

Configuration

Copy config.example.json to config.json:

{
  "plexUrl": "http://192.168.1.247:32400",
  "plexToken": "YOUR_PLEX_TOKEN",
  "tmdbApiKey": "YOUR_TMDB_API_KEY",
  "libraries": [
    { "name": "New", "sectionId": 1 },
    { "name": "Fang", "sectionId": 2 },
    { "name": "Floof", "sectionId": 3 }
  ],
  "port": 3000
}

Finding your values:

  • Plex Token: In Plex Web, open any media > Get Info > View XML. The X-Plex-Token is in the URL.
  • TMDB API Key: Free at themoviedb.org/settings/api
  • Library Section IDs: Visit http://YOUR_PLEX:32400/library/sections?X-Plex-Token=TOKEN -- the key attribute on each <Directory> is the section ID.

Studio Lists

The studio-lists/ folder contains curated text files (one movie title per line) for Disney, Marvel, Pixar, and Lucasarts. For current per-file counts:

wc -l studio-lists/*.txt

Edit these files to add or remove titles. Changes take effect on next server restart.

Features

  • 5-second splash animation on first load
  • Play Again button to reshuffle without reloading
  • Mobile/desktop view toggle
  • Movie posters from Plex (local) and TMDB (studio picks)
  • Responsive layout with dark Plex-inspired theme
  • TMDB poster caching to avoid rate limits
  • Plex libraries auto-refresh every 24 hours; manual refresh via /api/refresh
  • Franchise de-clustering so a single series doesn't fill a whole row (see above)

API Endpoints

Endpoint Description
GET /api/shuffle Returns randomized selections for all libraries and studio picks
GET /api/refresh Re-scans Plex libraries and returns updated movie counts

Previous Versions

The previous-versions/ directory contains the v1 and v2 Python CLI implementations that used weighted randomization and history tracking. The current version (v3) is a complete rewrite with no database or history -- pure random each time.

About

This is my personal movie randomizer to help us pick something to watch from our collection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors