files: suppport subtitle field in BookItem
This commit is contained in:
parent
ab594fcad2
commit
26c1d43cc5
@ -619,6 +619,7 @@ class BookItem extends model implements FilesItemInterface {
|
||||
public int $parentId;
|
||||
public string $author;
|
||||
public string $title;
|
||||
public string $subtitle;
|
||||
public int $year;
|
||||
public int $size;
|
||||
public FilesItemType $type;
|
||||
@ -686,9 +687,12 @@ class BookItem extends model implements FilesItemInterface {
|
||||
}
|
||||
|
||||
public function getSubtitle(): ?string {
|
||||
if (!$this->year)
|
||||
if (!$this->year && !$this->subtitle)
|
||||
return null;
|
||||
return '('.$this->year.')';
|
||||
$buf = '(';
|
||||
$buf .= $this->subtitle ?: $this->year;
|
||||
$buf .= ')';
|
||||
return $buf;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user