Adopt "Title (YYYY)" pool naming and clean Filmotéka link names
This commit is contained in:
+7
-1
@@ -139,12 +139,18 @@ class File:
|
||||
if isinstance(t, Tag) and t.category == "Rok" and t.name.isdigit():
|
||||
year = t.name
|
||||
break
|
||||
if year is None:
|
||||
# Last resort: recover it from a canonical "Title (YYYY)" filename.
|
||||
from .naming import parse_pool_stem
|
||||
parsed = parse_pool_stem(self.file_path.stem)
|
||||
if parsed is not None:
|
||||
year = parsed[1]
|
||||
rating = cache.get("rating")
|
||||
# user attributes first; core fields take precedence over same-named keys
|
||||
context = dict(self.attributes)
|
||||
context.update({
|
||||
"title": self.title or self.file_path.stem,
|
||||
"year": "" if year is None else year,
|
||||
"year": "" if year is None else str(year),
|
||||
"rating": "" if rating is None else rating,
|
||||
"ext": self.file_path.suffix,
|
||||
"stem": self.file_path.stem,
|
||||
|
||||
Reference in New Issue
Block a user