From 7bb51443377353bcf2c63ca051b8e2f945154bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Didier=20Corbi=C3=A8re?= Date: Fri, 13 Sep 2013 11:19:17 +0100 Subject: [PATCH] Add AuthorsSort in book export --- resources/epub-loader/BookExport.class.php | 2 ++ resources/epub-loader/BookInfos.class.php | 2 -- resources/epub-loader/CalibreDbLoader.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/epub-loader/BookExport.class.php b/resources/epub-loader/BookExport.class.php index 79c480d..b53e553 100644 --- a/resources/epub-loader/BookExport.class.php +++ b/resources/epub-loader/BookExport.class.php @@ -73,6 +73,7 @@ class BookExport $this->mExport->SetProperty($i++, 'Uri'); $this->mExport->SetProperty($i++, 'Title'); $this->mExport->SetProperty($i++, 'Authors'); + $this->mExport->SetProperty($i++, 'AuthorsSort'); $this->mExport->SetProperty($i++, 'Language'); $this->mExport->SetProperty($i++, 'Description'); $this->mExport->SetProperty($i++, 'Subjects'); @@ -92,6 +93,7 @@ class BookExport $this->mExport->SetProperty($i++, $inBookInfo->mUri); $this->mExport->SetProperty($i++, $inBookInfo->mTitle); $this->mExport->SetProperty($i++, implode(' - ', $inBookInfo->mAuthors)); + $this->mExport->SetProperty($i++, implode(' - ', array_keys($inBookInfo->mAuthors))); $this->mExport->SetProperty($i++, $inBookInfo->mLanguage); $this->mExport->SetProperty($i++, $inBookInfo->mDescription); $this->mExport->SetProperty($i++, implode(' - ', $inBookInfo->mSubjects)); diff --git a/resources/epub-loader/BookInfos.class.php b/resources/epub-loader/BookInfos.class.php index 9928523..bda5003 100644 --- a/resources/epub-loader/BookInfos.class.php +++ b/resources/epub-loader/BookInfos.class.php @@ -21,7 +21,6 @@ class BookInfos public $mUuid = ''; public $mUri = ''; public $mTitle = ''; - public $mTitleSort = ''; public $mAuthors = null; public $mLanguage = ''; public $mDescription = ''; @@ -51,7 +50,6 @@ class BookInfos $this->mUuid = $epub->Uuid(); $this->mUri = $epub->Uri(); $this->mTitle = $epub->Title(); - $this->mTitleSort = $this->mTitle; // Use title for now $this->mAuthors = $epub->Authors(); $this->mLanguage = $epub->Language(); $this->mDescription = $epub->Description(); diff --git a/resources/epub-loader/CalibreDbLoader.class.php b/resources/epub-loader/CalibreDbLoader.class.php index c4a6001..1630f5d 100644 --- a/resources/epub-loader/CalibreDbLoader.class.php +++ b/resources/epub-loader/CalibreDbLoader.class.php @@ -144,7 +144,7 @@ class CalibreDbLoader $sql = 'insert into books(title, sort, uuid, path) values(:title, :sort, :uuid, :path)'; $stmt = $this->mDb->prepare($sql); $stmt->bindParam(':title', $inBookInfo->mTitle); - $stmt->bindParam(':sort', $inBookInfo->mTitleSort); + $stmt->bindParam(':sort', $inBookInfo->mTitle); $stmt->bindParam(':uuid', $inBookInfo->mUuid); $stmt->bindParam(':path', $inBookInfo->mPath); $stmt->execute();