Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
yurii-github committed Sep 3, 2020
1 parent 612d73b commit fc0e820
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions app/controllers/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ public function actionImportNewCoverFromPdf()
\Yii::$app->response->format = Response::FORMAT_JSON;

if (\Yii::$app->request->getMethod() == 'GET') {
return $this->GET_actionImportNewCoverFromPdf();
return Books::find()->select(['book_guid'])
->where(new Expression('book_cover IS NULL'))
->andWhere(new Expression("filename LIKE '%.pdf'"))
->asArray()
->all();
}

return $this->POST_actionImportNewCoverFromPdf();
Expand Down Expand Up @@ -129,16 +133,7 @@ protected function buildGhostCommand($srcPdfFile, $outJpegFile)
"$srcPdfFile"
CMD;
}

protected function GET_actionImportNewCoverFromPdf()
{
return Books::find()->select(['book_guid'])
->where(new Expression('book_cover IS NULL'))
->andWhere(new Expression("filename LIKE '%.pdf'"))
->asArray()
->all();
}


/**
* returns array of books filenames located in FS library folder
* filename is in UTF-8
Expand Down

0 comments on commit fc0e820

Please sign in to comment.