#!/bin/bash

filename="/mnt/truenas/media/Anime/Pokemon/Season 03 (The Johto Journeys)/Pokemon - 157 - The Fortune Hunters.mkv"

if [ -z "$filename" ]; then
    echo "Usage: get_season 'filename.mkv'" >&2
    return 1
fi

echo "$filename"

# Extract season number and name (e.g., "Season 03 (The Johto Journeys)")
pattern='Season [0-9]{2} \([^)]+\)'
if [[ $filename =~ $pattern ]]; then
    echo "${BASH_REMATCH[0]}"
else
    echo "Pattern not found"
fi
