files: suppport subtitle field in BookItem

This commit is contained in:
E. S. 2024-03-15 21:36:57 +00:00
parent ab594fcad2
commit 26c1d43cc5

View File

@ -619,6 +619,7 @@ class BookItem extends model implements FilesItemInterface {
public int $parentId; public int $parentId;
public string $author; public string $author;
public string $title; public string $title;
public string $subtitle;
public int $year; public int $year;
public int $size; public int $size;
public FilesItemType $type; public FilesItemType $type;
@ -686,9 +687,12 @@ class BookItem extends model implements FilesItemInterface {
} }
public function getSubtitle(): ?string { public function getSubtitle(): ?string {
if (!$this->year) if (!$this->year && !$this->subtitle)
return null; return null;
return '('.$this->year.')'; $buf = '(';
$buf .= $this->subtitle ?: $this->year;
$buf .= ')';
return $buf;
} }
} }