summaryrefslogtreecommitdiff
path: root/services/film_people.py
blob: ef0e2ff6595f605fa118a0ebb226d9bc7d724c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from urllib.parse import quote


def split_credit_names(value: str | None) -> list[str]:
    if not value:
        return []

    normalized = value.replace(";", ",")
    return [item.strip() for item in normalized.split(",") if item.strip()]


def normalize_name(value: str) -> str:
    return value.casefold().strip()


def director_href(name: str) -> str:
    return f"/director/{quote(name, safe='')}"