diff --git a/app/controllers/ConfigController.php b/app/controllers/ConfigController.php index 617d675..98d4c16 100644 --- a/app/controllers/ConfigController.php +++ b/app/controllers/ConfigController.php @@ -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(); @@ -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