mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 10:56:46 -04:00
Search se:alternate-title when searching ebooks
This commit is contained in:
parent
9af540a68d
commit
98ad906c11
1 changed files with 6 additions and 1 deletions
|
@ -30,6 +30,7 @@ class Ebook{
|
|||
public $DistCoverUrl;
|
||||
public $Title;
|
||||
public $FullTitle;
|
||||
public $AlternateTitle;
|
||||
public $Description;
|
||||
public $LongDescription;
|
||||
public $Language;
|
||||
|
@ -154,6 +155,8 @@ class Ebook{
|
|||
|
||||
$this->FullTitle = $this->NullIfEmpty($xml->xpath('/package/metadata/dc:title[@id="fulltitle"]'));
|
||||
|
||||
$this->AlternateTitle = $this->NullIfEmpty($xml->xpath('/package/metadata/meta[@property="se:alternate-title"]'));
|
||||
|
||||
$date = $xml->xpath('/package/metadata/dc:date');
|
||||
if($date !== false && sizeof($date) > 0){
|
||||
$this->Timestamp = new DateTime((string)$date[0]);
|
||||
|
@ -381,10 +384,12 @@ class Ebook{
|
|||
}
|
||||
|
||||
public function Contains(string $query): bool{
|
||||
// When searching an ebook, we search the title, author(s), SE tags, and LoC tags.
|
||||
// When searching an ebook, we search the title, alternate title, author(s), SE tags, and LoC tags.
|
||||
|
||||
$searchString = $this->FullTitle ?? $this->Title;
|
||||
|
||||
$searchString .= ' ' . $this->AlternateTitle;
|
||||
|
||||
foreach($this->Authors as $author){
|
||||
$searchString .= ' ' . $author->Name;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue