Add author sort property

This commit is contained in:
Didier Corbière 2013-09-13 00:07:28 +01:00
parent 987d73ccb8
commit 63536d64d8

View file

@ -185,7 +185,7 @@ class CalibreDbLoader
$stmt->execute(); $stmt->execute();
} }
// Add the authors in the db // Add the authors in the db
foreach ($inBookInfo->mAuthors as $author) { foreach ($inBookInfo->mAuthors as $authorSort => $author) {
// Get the author id // Get the author id
$sql = 'select id from authors where name=:author'; $sql = 'select id from authors where name=:author';
$stmt = $this->mDb->prepare($sql); $stmt = $this->mDb->prepare($sql);
@ -200,7 +200,7 @@ class CalibreDbLoader
$sql = 'insert into authors(name, sort) values(:author, :sort)'; $sql = 'insert into authors(name, sort) values(:author, :sort)';
$stmt = $this->mDb->prepare($sql); $stmt = $this->mDb->prepare($sql);
$stmt->bindParam(':author', $author); $stmt->bindParam(':author', $author);
$stmt->bindParam(':sort', $author); $stmt->bindParam(':sort', $authorSort);
$stmt->execute(); $stmt->execute();
// Get the author id // Get the author id
$sql = 'select id from authors where name=:author'; $sql = 'select id from authors where name=:author';