#!/bin/bash

filename="$1"

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

# Extract just the filename without path
#filename=$(basename "$filename")

echo "$filename"

# Extract season and episode (e.g., S01E01)
if [[ $filename =~ Anime/([^/]+) ]]; then
    show_name="${BASH_REMATCH[1]}"
    echo "$show_name"
else
    echo "Error: Could not find season/episode pattern in filename" >&2
    #return 1
fi
