book: add {author} (primary author) output template field

as_dict only exposed {authors} (all authors joined with '; '), which scatters
one author across folders when books credit co-authors. Add {author} (first
author) so users can organize by primary author: -o "{author}/{title}.{ext}".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mattias Svensson 2026-06-28 14:18:15 +02:00
parent 1e6e5f161c
commit f3648281af

View File

@ -25,6 +25,7 @@ class Metadata:
"identifier": self.identifier or "UNKNOWN",
"language": self.language or "UNKNOWN",
"authors": "; ".join(self.authors),
"author": self.authors[0] if self.authors else "UNKNOWN",
"description": self.description or "UNKNOWN",
"release_date": self.release_date.isoformat() if self.release_date else "UNKNOWN",
}