Files
arr-tui/dev/screenshots/posters.sh
T
nilsandClaude Opus 5.5 5b8100eb54 Screenshots: season posters
The fake Sonarr sends season posters on request, generated per season.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:42:49 +02:00

25 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Generate a poster for every title in catalog.py: a gradient with the title
# and year, 500x750 JPEG in posters/. Needs ImageMagick 7 and fontconfig.
set -euo pipefail
cd "$(dirname "$0")"
font=$(fc-match -f '%{file}' 'DejaVu Serif:style=Bold')
small=$(fc-match -f '%{file}' 'DejaVu Sans')
mkdir -p posters
python3 -c '
import catalog
for m in catalog.MOVIES: print("m%d|%s|%d|%s|%s" % (m[0], m[1], m[2], m[10][0], m[10][1]))
for s in catalog.SERIES: print("s%d|%s|%d|%s|%s" % (s[0], s[1], s[2], s[7][0], s[7][1]))
for s in catalog.SERIES:
for n in range(1, len(s[5]) + 1): print("s%d-%d|%s|Season %d|%s|%s" % (s[0], n, s[1], n, s[7][1], s[7][0]))
u = catalog.UPCOMING; print("m%d|%s|%d|%s|%s" % (u[0], u[1], u[2], u[3][0], u[3][1]))
' | while IFS='|' read -r id title year c1 c2; do
magick -size 500x750 "gradient:$c1-$c2" \
\( -size 420x320 -background none -fill white -font "$font" -gravity center caption:"$title" \) \
-gravity north -geometry +0+120 -composite \
\( -size 420x60 -background none -fill '#ffffffcc' -font "$small" -pointsize 30 -gravity center caption:"$year" \) \
-gravity south -geometry +0+70 -composite \
-quality 88 "posters/$id.jpg"
done