Add Calibre fields: Description, Language, Subjects, Isbn, CreationDate, ModificationDate

This commit is contained in:
Marsender 2013-10-10 01:16:43 +01:00
parent 356a1e263b
commit fce60d4079
6 changed files with 196 additions and 29 deletions

View file

@ -42,15 +42,24 @@ class BookExport
* @param string Epub file name
* @throws Exception if error
*
* @return void
* @return string Empty string or error if any
*/
public function AddEpub($inFileName)
{
// Load the book infos
$bookInfos = new BookInfos();
$bookInfos->LoadFromEpub($inFileName);
// Add the book
$this->AddBook($bookInfos);
$error = '';
try {
// Load the book infos
$bookInfos = new BookInfos();
$bookInfos->LoadFromEpub($inFileName);
// Add the book
$this->AddBook($bookInfos);
}
catch (Exception $e) {
$error = $e->getMessage();
}
return $error;
}
/**
@ -83,6 +92,8 @@ class BookExport
$this->mExport->SetProperty($i++, 'Publisher');
$this->mExport->SetProperty($i++, 'Serie');
$this->mExport->SetProperty($i++, 'SerieIndex');
$this->mExport->SetProperty($i++, 'CreationDate');
$this->mExport->SetProperty($i++, 'ModificationDate');
$this->mExport->AddContent();
}
@ -105,6 +116,8 @@ class BookExport
$this->mExport->SetProperty($i++, $inBookInfo->mPublisher);
$this->mExport->SetProperty($i++, $inBookInfo->mSerie);
$this->mExport->SetProperty($i++, $inBookInfo->mSerieIndex);
$this->mExport->SetProperty($i++, $inBookInfo->mCreationDate);
$this->mExport->SetProperty($i++, $inBookInfo->mModificationDate);
$this->mExport->AddContent();
}