From 63536d64d8ab1a8299b29a116f87efb97713a79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Didier=20Corbi=C3=A8re?= Date: Fri, 13 Sep 2013 00:07:28 +0100 Subject: [PATCH] Add author sort property --- resources/epub-loader/CalibreDbLoader.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/epub-loader/CalibreDbLoader.class.php b/resources/epub-loader/CalibreDbLoader.class.php index a391233..c4a6001 100644 --- a/resources/epub-loader/CalibreDbLoader.class.php +++ b/resources/epub-loader/CalibreDbLoader.class.php @@ -185,7 +185,7 @@ class CalibreDbLoader $stmt->execute(); } // Add the authors in the db - foreach ($inBookInfo->mAuthors as $author) { + foreach ($inBookInfo->mAuthors as $authorSort => $author) { // Get the author id $sql = 'select id from authors where name=:author'; $stmt = $this->mDb->prepare($sql); @@ -200,7 +200,7 @@ class CalibreDbLoader $sql = 'insert into authors(name, sort) values(:author, :sort)'; $stmt = $this->mDb->prepare($sql); $stmt->bindParam(':author', $author); - $stmt->bindParam(':sort', $author); + $stmt->bindParam(':sort', $authorSort); $stmt->execute(); // Get the author id $sql = 'select id from authors where name=:author';