\n"
"Language: pl\n"
@@ -538,24 +538,24 @@ msgstr "Edytuj użytkownika %(nick)s"
msgid "Password for user %s reset"
msgstr ""
-#: cps/web.py:3170
+#: cps/web.py:3169
msgid "Error opening eBook. File does not exist or file is not accessible"
msgstr ""
-#: cps/web.py:3185 cps/web.py:3419 cps/web.py:3424 cps/web.py:3579
+#: cps/web.py:3184 cps/web.py:3445 cps/web.py:3450 cps/web.py:3605
msgid "edit metadata"
msgstr "edytuj metadane"
-#: cps/web.py:3198 cps/web.py:3449
+#: cps/web.py:3197 cps/web.py:3475
#, python-format
msgid "File extension \"%s\" is not allowed to be uploaded to this server"
msgstr "Rozszerzenie pliku \"%s\" nie jest dozwolone do przesłania na ten serwer"
-#: cps/web.py:3201 cps/web.py:3453
+#: cps/web.py:3201 cps/web.py:3479
msgid "File to be uploaded must have an extension"
msgstr "Plik do przesłania musi mieć rozszerzenie"
-#: cps/web.py:3213 cps/web.py:3473
+#: cps/web.py:3213 cps/web.py:3499
#, python-format
msgid "Failed to create path %s (Permission denied)."
msgstr "Nie udało się utworzyć łącza %s (Odmowa dostępu)."
@@ -570,29 +570,43 @@ msgstr ""
msgid "File format %s added to %s"
msgstr ""
-#: cps/web.py:3249 cps/web.py:3253
+#: cps/web.py:3252
+#, python-format
+msgid "Failed to create path for cover %s (Permission denied)."
+msgstr ""
+
+#: cps/web.py:3259
+#, python-format
+msgid "Failed to store cover-file %s."
+msgstr ""
+
+#: cps/web.py:3262
+msgid "Cover-file is not a valid image file"
+msgstr ""
+
+#: cps/web.py:3275 cps/web.py:3279
msgid "unknown"
msgstr ""
-#: cps/web.py:3275
+#: cps/web.py:3301
msgid "Cover is not a jpg file, can't save"
msgstr ""
-#: cps/web.py:3428
+#: cps/web.py:3454
msgid "Error editing book, please check logfile for details"
msgstr ""
-#: cps/web.py:3478
+#: cps/web.py:3504
#, python-format
msgid "Failed to store file %s (Permission denied)."
msgstr "Nie można przechowywać pliku %s (Odmowa dostępu)."
-#: cps/web.py:3483
+#: cps/web.py:3509
#, python-format
msgid "Failed to delete file %s (Permission denied)."
msgstr "Nie udało się usunąć pliku %s (Odmowa dostępu)."
-#: cps/web.py:3565
+#: cps/web.py:3591
#, python-format
msgid "File %s uploaded"
msgstr ""
@@ -776,7 +790,7 @@ msgid "Ok"
msgstr "OK"
#: cps/templates/admin.html:112 cps/templates/admin.html:126
-#: cps/templates/book_edit.html:144 cps/templates/book_edit.html:166
+#: cps/templates/book_edit.html:148 cps/templates/book_edit.html:170
#: cps/templates/config_edit.html:206 cps/templates/config_view_edit.html:164
#: cps/templates/email_edit.html:40 cps/templates/email_edit.html:75
#: cps/templates/shelf.html:60 cps/templates/shelf_edit.html:19
@@ -812,7 +826,7 @@ msgstr ""
msgid "Delete formats:"
msgstr ""
-#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:165
+#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:169
#: cps/templates/email_edit.html:73 cps/templates/email_edit.html:74
msgid "Delete"
msgstr ""
@@ -821,13 +835,13 @@ msgstr ""
msgid "Book Title"
msgstr "Tytuł książki"
-#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:225
-#: cps/templates/book_edit.html:243 cps/templates/search_form.html:10
+#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:229
+#: cps/templates/book_edit.html:247 cps/templates/search_form.html:10
msgid "Author"
msgstr "Autor"
-#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:230
-#: cps/templates/book_edit.html:245 cps/templates/search_form.html:106
+#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:234
+#: cps/templates/book_edit.html:249 cps/templates/search_form.html:106
msgid "Description"
msgstr "Opis"
@@ -854,91 +868,95 @@ msgid ""
"afterwards empty again)"
msgstr ""
-#: cps/templates/book_edit.html:65 cps/templates/detail.html:131
+#: cps/templates/book_edit.html:64
+msgid "Upload Cover from local drive"
+msgstr ""
+
+#: cps/templates/book_edit.html:69 cps/templates/detail.html:131
msgid "Publishing date"
msgstr "Data publikacji"
-#: cps/templates/book_edit.html:72 cps/templates/user_edit.html:33
+#: cps/templates/book_edit.html:76 cps/templates/user_edit.html:33
msgid "Language"
msgstr "Język"
-#: cps/templates/book_edit.html:83 cps/templates/search_form.html:117
+#: cps/templates/book_edit.html:87 cps/templates/search_form.html:117
msgid "Yes"
msgstr "Tak"
-#: cps/templates/book_edit.html:84 cps/templates/search_form.html:118
+#: cps/templates/book_edit.html:88 cps/templates/search_form.html:118
msgid "No"
msgstr "Nie"
-#: cps/templates/book_edit.html:130
+#: cps/templates/book_edit.html:134
msgid "Upload format"
msgstr ""
-#: cps/templates/book_edit.html:139
+#: cps/templates/book_edit.html:143
msgid "view book after edit"
msgstr "wyświetl książkę po edycji"
-#: cps/templates/book_edit.html:142 cps/templates/book_edit.html:178
+#: cps/templates/book_edit.html:146 cps/templates/book_edit.html:182
msgid "Get metadata"
msgstr "Uzyskaj metadane"
-#: cps/templates/book_edit.html:143 cps/templates/config_edit.html:204
+#: cps/templates/book_edit.html:147 cps/templates/config_edit.html:204
#: cps/templates/config_view_edit.html:163 cps/templates/login.html:20
#: cps/templates/search_form.html:153 cps/templates/shelf_edit.html:17
#: cps/templates/user_edit.html:151
msgid "Submit"
msgstr "Wyślij"
-#: cps/templates/book_edit.html:157
+#: cps/templates/book_edit.html:161
msgid "Are you really sure?"
msgstr ""
-#: cps/templates/book_edit.html:160
+#: cps/templates/book_edit.html:164
msgid "Book will be deleted from Calibre database"
msgstr ""
-#: cps/templates/book_edit.html:161
+#: cps/templates/book_edit.html:165
msgid "and from hard disk"
msgstr ""
-#: cps/templates/book_edit.html:181
+#: cps/templates/book_edit.html:185
msgid "Keyword"
msgstr "Słowo kluczowe"
-#: cps/templates/book_edit.html:182
+#: cps/templates/book_edit.html:186
msgid " Search keyword "
msgstr " Szukaj słowa kluczowego "
-#: cps/templates/book_edit.html:184 cps/templates/layout.html:46
+#: cps/templates/book_edit.html:188 cps/templates/layout.html:46
msgid "Go!"
msgstr "Idź!"
-#: cps/templates/book_edit.html:188
+#: cps/templates/book_edit.html:192
msgid "Click the cover to load metadata to the form"
msgstr "Kliknij okładkę, aby załadować metadane do formularza"
-#: cps/templates/book_edit.html:200 cps/templates/book_edit.html:240
+#: cps/templates/book_edit.html:204 cps/templates/book_edit.html:244
msgid "Loading..."
msgstr "Ładowanie..."
-#: cps/templates/book_edit.html:205 cps/templates/layout.html:221
+#: cps/templates/book_edit.html:209 cps/templates/layout.html:221
msgid "Close"
msgstr "Zamknij"
-#: cps/templates/book_edit.html:227 cps/templates/book_edit.html:244
+#: cps/templates/book_edit.html:231 cps/templates/book_edit.html:248
#: cps/templates/detail.html:126 cps/templates/search_form.html:14
msgid "Publisher"
msgstr "Wydawca"
-#: cps/templates/book_edit.html:232 cps/templates/book_edit.html:246
+#: cps/templates/book_edit.html:236 cps/templates/book_edit.html:250
msgid "Source"
msgstr "Źródło"
-#: cps/templates/book_edit.html:241
+#: cps/templates/book_edit.html:245
msgid "Search error!"
msgstr "Błąd wyszukiwania!"
-#: cps/templates/book_edit.html:242
+#: cps/templates/book_edit.html:246
msgid "No Result(s) found! Please try aonther keyword."
msgstr ""
diff --git a/cps/translations/ru/LC_MESSAGES/messages.po b/cps/translations/ru/LC_MESSAGES/messages.po
index 7099c7a8..46532801 100644
--- a/cps/translations/ru/LC_MESSAGES/messages.po
+++ b/cps/translations/ru/LC_MESSAGES/messages.po
@@ -14,7 +14,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
-"POT-Creation-Date: 2018-08-28 10:22+0200\n"
+"POT-Creation-Date: 2018-08-28 14:05+0200\n"
"PO-Revision-Date: 2017-04-30 00:47+0300\n"
"Last-Translator: Pavel Korovin \n"
"Language: ru\n"
@@ -540,24 +540,24 @@ msgstr "Изменить пользователя %(nick)s"
msgid "Password for user %s reset"
msgstr ""
-#: cps/web.py:3170
+#: cps/web.py:3169
msgid "Error opening eBook. File does not exist or file is not accessible"
msgstr ""
-#: cps/web.py:3185 cps/web.py:3419 cps/web.py:3424 cps/web.py:3579
+#: cps/web.py:3184 cps/web.py:3445 cps/web.py:3450 cps/web.py:3605
msgid "edit metadata"
msgstr "изменить метаданные"
-#: cps/web.py:3198 cps/web.py:3449
+#: cps/web.py:3197 cps/web.py:3475
#, python-format
msgid "File extension \"%s\" is not allowed to be uploaded to this server"
msgstr "Запрещена загрузка файлов с расширением \"%s\""
-#: cps/web.py:3201 cps/web.py:3453
+#: cps/web.py:3201 cps/web.py:3479
msgid "File to be uploaded must have an extension"
msgstr "Загружаемый файл должен иметь расширение"
-#: cps/web.py:3213 cps/web.py:3473
+#: cps/web.py:3213 cps/web.py:3499
#, python-format
msgid "Failed to create path %s (Permission denied)."
msgstr "Ошибка при создании пути %s (доступ запрещён)"
@@ -572,29 +572,43 @@ msgstr ""
msgid "File format %s added to %s"
msgstr ""
-#: cps/web.py:3249 cps/web.py:3253
+#: cps/web.py:3252
+#, python-format
+msgid "Failed to create path for cover %s (Permission denied)."
+msgstr ""
+
+#: cps/web.py:3259
+#, python-format
+msgid "Failed to store cover-file %s."
+msgstr ""
+
+#: cps/web.py:3262
+msgid "Cover-file is not a valid image file"
+msgstr ""
+
+#: cps/web.py:3275 cps/web.py:3279
msgid "unknown"
msgstr "неизвестно"
-#: cps/web.py:3275
+#: cps/web.py:3301
msgid "Cover is not a jpg file, can't save"
msgstr ""
-#: cps/web.py:3428
+#: cps/web.py:3454
msgid "Error editing book, please check logfile for details"
msgstr ""
-#: cps/web.py:3478
+#: cps/web.py:3504
#, python-format
msgid "Failed to store file %s (Permission denied)."
msgstr "Ошибка записи файоа %s (доступ запрещён)"
-#: cps/web.py:3483
+#: cps/web.py:3509
#, python-format
msgid "Failed to delete file %s (Permission denied)."
msgstr "Ошибка удаления файла %s (доступ запрещён)"
-#: cps/web.py:3565
+#: cps/web.py:3591
#, python-format
msgid "File %s uploaded"
msgstr ""
@@ -778,7 +792,7 @@ msgid "Ok"
msgstr "Ok"
#: cps/templates/admin.html:112 cps/templates/admin.html:126
-#: cps/templates/book_edit.html:144 cps/templates/book_edit.html:166
+#: cps/templates/book_edit.html:148 cps/templates/book_edit.html:170
#: cps/templates/config_edit.html:206 cps/templates/config_view_edit.html:164
#: cps/templates/email_edit.html:40 cps/templates/email_edit.html:75
#: cps/templates/shelf.html:60 cps/templates/shelf_edit.html:19
@@ -814,7 +828,7 @@ msgstr "Удалить книгу"
msgid "Delete formats:"
msgstr ""
-#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:165
+#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:169
#: cps/templates/email_edit.html:73 cps/templates/email_edit.html:74
msgid "Delete"
msgstr "Удалить"
@@ -823,13 +837,13 @@ msgstr "Удалить"
msgid "Book Title"
msgstr "Название"
-#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:225
-#: cps/templates/book_edit.html:243 cps/templates/search_form.html:10
+#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:229
+#: cps/templates/book_edit.html:247 cps/templates/search_form.html:10
msgid "Author"
msgstr "Автор"
-#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:230
-#: cps/templates/book_edit.html:245 cps/templates/search_form.html:106
+#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:234
+#: cps/templates/book_edit.html:249 cps/templates/search_form.html:106
msgid "Description"
msgstr "Описание"
@@ -856,91 +870,95 @@ msgid ""
"afterwards empty again)"
msgstr ""
-#: cps/templates/book_edit.html:65 cps/templates/detail.html:131
+#: cps/templates/book_edit.html:64
+msgid "Upload Cover from local drive"
+msgstr ""
+
+#: cps/templates/book_edit.html:69 cps/templates/detail.html:131
msgid "Publishing date"
msgstr "Опубликовано"
-#: cps/templates/book_edit.html:72 cps/templates/user_edit.html:33
+#: cps/templates/book_edit.html:76 cps/templates/user_edit.html:33
msgid "Language"
msgstr "Язык"
-#: cps/templates/book_edit.html:83 cps/templates/search_form.html:117
+#: cps/templates/book_edit.html:87 cps/templates/search_form.html:117
msgid "Yes"
msgstr "Да"
-#: cps/templates/book_edit.html:84 cps/templates/search_form.html:118
+#: cps/templates/book_edit.html:88 cps/templates/search_form.html:118
msgid "No"
msgstr "Нет"
-#: cps/templates/book_edit.html:130
+#: cps/templates/book_edit.html:134
msgid "Upload format"
msgstr ""
-#: cps/templates/book_edit.html:139
+#: cps/templates/book_edit.html:143
msgid "view book after edit"
msgstr "смотреть книгу после редактирования"
-#: cps/templates/book_edit.html:142 cps/templates/book_edit.html:178
+#: cps/templates/book_edit.html:146 cps/templates/book_edit.html:182
msgid "Get metadata"
msgstr "Получить метаданные"
-#: cps/templates/book_edit.html:143 cps/templates/config_edit.html:204
+#: cps/templates/book_edit.html:147 cps/templates/config_edit.html:204
#: cps/templates/config_view_edit.html:163 cps/templates/login.html:20
#: cps/templates/search_form.html:153 cps/templates/shelf_edit.html:17
#: cps/templates/user_edit.html:151
msgid "Submit"
msgstr "Отправить"
-#: cps/templates/book_edit.html:157
+#: cps/templates/book_edit.html:161
msgid "Are you really sure?"
msgstr "Вы действительно уверены?"
-#: cps/templates/book_edit.html:160
+#: cps/templates/book_edit.html:164
msgid "Book will be deleted from Calibre database"
msgstr "Книга будет удалена из БД Calibre"
-#: cps/templates/book_edit.html:161
+#: cps/templates/book_edit.html:165
msgid "and from hard disk"
msgstr "и с диска"
-#: cps/templates/book_edit.html:181
+#: cps/templates/book_edit.html:185
msgid "Keyword"
msgstr "Ключевое слово"
-#: cps/templates/book_edit.html:182
+#: cps/templates/book_edit.html:186
msgid " Search keyword "
msgstr " Поиск по ключевому слову"
-#: cps/templates/book_edit.html:184 cps/templates/layout.html:46
+#: cps/templates/book_edit.html:188 cps/templates/layout.html:46
msgid "Go!"
msgstr "Искать"
-#: cps/templates/book_edit.html:188
+#: cps/templates/book_edit.html:192
msgid "Click the cover to load metadata to the form"
msgstr "Нажмите на обложку, чтобы получить метаданные"
-#: cps/templates/book_edit.html:200 cps/templates/book_edit.html:240
+#: cps/templates/book_edit.html:204 cps/templates/book_edit.html:244
msgid "Loading..."
msgstr "Загрузка..."
-#: cps/templates/book_edit.html:205 cps/templates/layout.html:221
+#: cps/templates/book_edit.html:209 cps/templates/layout.html:221
msgid "Close"
msgstr "Закрыть"
-#: cps/templates/book_edit.html:227 cps/templates/book_edit.html:244
+#: cps/templates/book_edit.html:231 cps/templates/book_edit.html:248
#: cps/templates/detail.html:126 cps/templates/search_form.html:14
msgid "Publisher"
msgstr "Издатель"
-#: cps/templates/book_edit.html:232 cps/templates/book_edit.html:246
+#: cps/templates/book_edit.html:236 cps/templates/book_edit.html:250
msgid "Source"
msgstr "Источник"
-#: cps/templates/book_edit.html:241
+#: cps/templates/book_edit.html:245
msgid "Search error!"
msgstr "Ошибка поиска!"
-#: cps/templates/book_edit.html:242
+#: cps/templates/book_edit.html:246
msgid "No Result(s) found! Please try aonther keyword."
msgstr ""
diff --git a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
index 2f7d7eaf..4e326adc 100644
--- a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
+++ b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
@@ -15,7 +15,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
-"POT-Creation-Date: 2018-08-28 10:22+0200\n"
+"POT-Creation-Date: 2018-08-28 14:05+0200\n"
"PO-Revision-Date: 2017-01-06 17:00+0000\n"
"Last-Translator: dalin \n"
"Language: zh_Hans_CN\n"
@@ -540,24 +540,24 @@ msgstr "编辑用户 %(nick)s"
msgid "Password for user %s reset"
msgstr ""
-#: cps/web.py:3170
+#: cps/web.py:3169
msgid "Error opening eBook. File does not exist or file is not accessible"
msgstr "打开电子书出错。文件不存在或不可访问"
-#: cps/web.py:3185 cps/web.py:3419 cps/web.py:3424 cps/web.py:3579
+#: cps/web.py:3184 cps/web.py:3445 cps/web.py:3450 cps/web.py:3605
msgid "edit metadata"
msgstr "编辑元数据"
-#: cps/web.py:3198 cps/web.py:3449
+#: cps/web.py:3197 cps/web.py:3475
#, python-format
msgid "File extension \"%s\" is not allowed to be uploaded to this server"
msgstr "不能上传后缀为 \"%s\" 的文件到此服务器"
-#: cps/web.py:3201 cps/web.py:3453
+#: cps/web.py:3201 cps/web.py:3479
msgid "File to be uploaded must have an extension"
msgstr "要上传的文件必须有一个后缀"
-#: cps/web.py:3213 cps/web.py:3473
+#: cps/web.py:3213 cps/web.py:3499
#, python-format
msgid "Failed to create path %s (Permission denied)."
msgstr "创建路径 %s 失败(权限拒绝)。"
@@ -572,29 +572,43 @@ msgstr ""
msgid "File format %s added to %s"
msgstr ""
-#: cps/web.py:3249 cps/web.py:3253
+#: cps/web.py:3252
+#, python-format
+msgid "Failed to create path for cover %s (Permission denied)."
+msgstr ""
+
+#: cps/web.py:3259
+#, python-format
+msgid "Failed to store cover-file %s."
+msgstr ""
+
+#: cps/web.py:3262
+msgid "Cover-file is not a valid image file"
+msgstr ""
+
+#: cps/web.py:3275 cps/web.py:3279
msgid "unknown"
msgstr "未知"
-#: cps/web.py:3275
+#: cps/web.py:3301
msgid "Cover is not a jpg file, can't save"
msgstr ""
-#: cps/web.py:3428
+#: cps/web.py:3454
msgid "Error editing book, please check logfile for details"
msgstr ""
-#: cps/web.py:3478
+#: cps/web.py:3504
#, python-format
msgid "Failed to store file %s (Permission denied)."
msgstr "存储文件 %s 失败(权限拒绝)。"
-#: cps/web.py:3483
+#: cps/web.py:3509
#, python-format
msgid "Failed to delete file %s (Permission denied)."
msgstr "删除文件 %s 失败(权限拒绝)。"
-#: cps/web.py:3565
+#: cps/web.py:3591
#, python-format
msgid "File %s uploaded"
msgstr ""
@@ -778,7 +792,7 @@ msgid "Ok"
msgstr "确定"
#: cps/templates/admin.html:112 cps/templates/admin.html:126
-#: cps/templates/book_edit.html:144 cps/templates/book_edit.html:166
+#: cps/templates/book_edit.html:148 cps/templates/book_edit.html:170
#: cps/templates/config_edit.html:206 cps/templates/config_view_edit.html:164
#: cps/templates/email_edit.html:40 cps/templates/email_edit.html:75
#: cps/templates/shelf.html:60 cps/templates/shelf_edit.html:19
@@ -814,7 +828,7 @@ msgstr "删除书籍"
msgid "Delete formats:"
msgstr ""
-#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:165
+#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:169
#: cps/templates/email_edit.html:73 cps/templates/email_edit.html:74
msgid "Delete"
msgstr "删除"
@@ -823,13 +837,13 @@ msgstr "删除"
msgid "Book Title"
msgstr "书名"
-#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:225
-#: cps/templates/book_edit.html:243 cps/templates/search_form.html:10
+#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:229
+#: cps/templates/book_edit.html:247 cps/templates/search_form.html:10
msgid "Author"
msgstr "作者"
-#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:230
-#: cps/templates/book_edit.html:245 cps/templates/search_form.html:106
+#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:234
+#: cps/templates/book_edit.html:249 cps/templates/search_form.html:106
msgid "Description"
msgstr "简介"
@@ -856,91 +870,95 @@ msgid ""
"afterwards empty again)"
msgstr ""
-#: cps/templates/book_edit.html:65 cps/templates/detail.html:131
+#: cps/templates/book_edit.html:64
+msgid "Upload Cover from local drive"
+msgstr ""
+
+#: cps/templates/book_edit.html:69 cps/templates/detail.html:131
msgid "Publishing date"
msgstr "出版日期"
-#: cps/templates/book_edit.html:72 cps/templates/user_edit.html:33
+#: cps/templates/book_edit.html:76 cps/templates/user_edit.html:33
msgid "Language"
msgstr "语言"
-#: cps/templates/book_edit.html:83 cps/templates/search_form.html:117
+#: cps/templates/book_edit.html:87 cps/templates/search_form.html:117
msgid "Yes"
msgstr "确认"
-#: cps/templates/book_edit.html:84 cps/templates/search_form.html:118
+#: cps/templates/book_edit.html:88 cps/templates/search_form.html:118
msgid "No"
msgstr ""
-#: cps/templates/book_edit.html:130
+#: cps/templates/book_edit.html:134
msgid "Upload format"
msgstr ""
-#: cps/templates/book_edit.html:139
+#: cps/templates/book_edit.html:143
msgid "view book after edit"
msgstr "编辑后查看书籍"
-#: cps/templates/book_edit.html:142 cps/templates/book_edit.html:178
+#: cps/templates/book_edit.html:146 cps/templates/book_edit.html:182
msgid "Get metadata"
msgstr "获取元数据"
-#: cps/templates/book_edit.html:143 cps/templates/config_edit.html:204
+#: cps/templates/book_edit.html:147 cps/templates/config_edit.html:204
#: cps/templates/config_view_edit.html:163 cps/templates/login.html:20
#: cps/templates/search_form.html:153 cps/templates/shelf_edit.html:17
#: cps/templates/user_edit.html:151
msgid "Submit"
msgstr "提交"
-#: cps/templates/book_edit.html:157
+#: cps/templates/book_edit.html:161
msgid "Are you really sure?"
msgstr "您真的确认?"
-#: cps/templates/book_edit.html:160
+#: cps/templates/book_edit.html:164
msgid "Book will be deleted from Calibre database"
msgstr "书籍会被从Calibre数据库和硬盘中删除"
-#: cps/templates/book_edit.html:161
+#: cps/templates/book_edit.html:165
msgid "and from hard disk"
msgstr ""
-#: cps/templates/book_edit.html:181
+#: cps/templates/book_edit.html:185
msgid "Keyword"
msgstr "关键字"
-#: cps/templates/book_edit.html:182
+#: cps/templates/book_edit.html:186
msgid " Search keyword "
msgstr "搜索关键字"
-#: cps/templates/book_edit.html:184 cps/templates/layout.html:46
+#: cps/templates/book_edit.html:188 cps/templates/layout.html:46
msgid "Go!"
msgstr "走起!"
-#: cps/templates/book_edit.html:188
+#: cps/templates/book_edit.html:192
msgid "Click the cover to load metadata to the form"
msgstr "点击封面加载元数据到表单"
-#: cps/templates/book_edit.html:200 cps/templates/book_edit.html:240
+#: cps/templates/book_edit.html:204 cps/templates/book_edit.html:244
msgid "Loading..."
msgstr "加载中..."
-#: cps/templates/book_edit.html:205 cps/templates/layout.html:221
+#: cps/templates/book_edit.html:209 cps/templates/layout.html:221
msgid "Close"
msgstr "关闭"
-#: cps/templates/book_edit.html:227 cps/templates/book_edit.html:244
+#: cps/templates/book_edit.html:231 cps/templates/book_edit.html:248
#: cps/templates/detail.html:126 cps/templates/search_form.html:14
msgid "Publisher"
msgstr "出版社"
-#: cps/templates/book_edit.html:232 cps/templates/book_edit.html:246
+#: cps/templates/book_edit.html:236 cps/templates/book_edit.html:250
msgid "Source"
msgstr "来源"
-#: cps/templates/book_edit.html:241
+#: cps/templates/book_edit.html:245
msgid "Search error!"
msgstr "搜索错误"
-#: cps/templates/book_edit.html:242
+#: cps/templates/book_edit.html:246
msgid "No Result(s) found! Please try aonther keyword."
msgstr ""
diff --git a/cps/web.py b/cps/web.py
index 0d2db20c..27bcd8c6 100644
--- a/cps/web.py
+++ b/cps/web.py
@@ -3153,7 +3153,6 @@ def reset_password(user_id):
return redirect(url_for('admin'))
-
@app.route("/admin/book/", methods=['GET', 'POST'])
@login_required_if_no_ano
@edit_required
@@ -3170,14 +3169,14 @@ def edit_book(book_id):
flash(_(u"Error opening eBook. File does not exist or file is not accessible"), category="error")
return redirect(url_for("index"))
- for index in range(0, len(book.languages)):
+ for indx in range(0, len(book.languages)):
try:
- book.languages[index].language_name = LC.parse(book.languages[index].lang_code).get_language_name(
+ book.languages[indx].language_name = LC.parse(book.languages[indx].lang_code).get_language_name(
get_locale())
except Exception:
- book.languages[index].language_name = _(isoLanguages.get(part3=book.languages[index].lang_code).name)
- for author in book.authors:
- author_names.append(author.name.replace('|', ','))
+ book.languages[indx].language_name = _(isoLanguages.get(part3=book.languages[indx].lang_code).name)
+ for authr in book.authors:
+ author_names.append(authr.name.replace('|', ','))
# Show form
if request.method != 'POST':
@@ -3185,7 +3184,7 @@ def edit_book(book_id):
title=_(u"edit metadata"), page="editbook")
# Update book
- edited_books_id = set()
+ edited_books_id = {}
# Check and handle Uploaded file
if 'btn-upload-format' in request.files:
@@ -3195,7 +3194,8 @@ def edit_book(book_id):
if '.' in requested_file.filename:
file_ext = requested_file.filename.rsplit('.', 1)[-1].lower()
if file_ext not in ALLOWED_EXTENSIONS:
- flash(_('File extension "%s" is not allowed to be uploaded to this server' % file_ext), category="error")
+ flash(_('File extension "%s" is not allowed to be uploaded to this server' % file_ext),
+ category="error")
return redirect(url_for('show_book', book_id=book.id))
else:
flash(_('File to be uploaded must have an extension'), category="error")
@@ -3231,10 +3231,36 @@ def edit_book(book_id):
db.session.connection().connection.connection.create_function("title_sort", 1, db.title_sort)
# Queue uploader info
- uploadText=_(u"File format %s added to %s" % (file_ext.upper(),book.title))
+ uploadText=_(u"File format %s added to %s" % (file_ext.upper(), book.title))
helper.global_WorkerThread.add_upload(current_user.nickname,
- ""+ uploadText + "")
+ "" + uploadText + "")
+ if 'btn-upload-cover' in request.files:
+ requested_file = request.files['btn-upload-cover']
+ # check for empty request
+ if requested_file.filename != '':
+ file_ext = requested_file.filename.rsplit('.', 1)[-1].lower()
+ # file_name = book.path.rsplit('/', 1)[-1]
+ filepath = os.path.normpath(os.path.join(config.config_calibre_dir, book.path))
+ saved_filename = os.path.join(filepath, 'cover.' + file_ext)
+
+ # check if file path exists, otherwise create it, copy file to calibre path and delete temp file
+ if not os.path.exists(filepath):
+ try:
+ os.makedirs(filepath)
+ except OSError:
+ flash(_(u"Failed to create path for cover %s (Permission denied)." % filepath), category="error")
+ return redirect(url_for('show_book', book_id=book.id))
+ try:
+ requested_file.save(saved_filename)
+ # im=Image.open(saved_filename)
+ book.has_cover = 1
+ except OSError:
+ flash(_(u"Failed to store cover-file %s." % saved_filename), category="error")
+ return redirect(url_for('show_book', book_id=book.id))
+ except IOError:
+ flash(_(u"Cover-file is not a valid image file" % saved_filename), category="error")
+ return redirect(url_for('show_book', book_id=book.id))
to_save = request.form.to_dict()
try:
@@ -3410,8 +3436,8 @@ def edit_book(book_id):
if config.config_use_google_drive:
gdriveutils.updateGdriveCalibreFromLocal()
author_names = []
- for author in book.authors:
- author_names.append(author.name)
+ for authr in book.authors:
+ author_names.append(authr.name)
if "detail_view" in to_save:
return redirect(url_for('show_book', book_id=book.id))
else:
@@ -3456,12 +3482,12 @@ def upload():
# extract metadata from file
meta = uploader.upload(requested_file)
title = meta.title
- author = meta.author
+ authr = meta.author
tags = meta.tags
series = meta.series
series_index = meta.series_id
title_dir = helper.get_valid_filename(title)
- author_dir = helper.get_valid_filename(author)
+ author_dir = helper.get_valid_filename(authr)
filepath = os.path.join(config.config_calibre_dir, author_dir, title_dir)
saved_filename = os.path.join(filepath, title_dir + meta.extension.lower())
@@ -3490,11 +3516,11 @@ def upload():
move(meta.cover, os.path.join(filepath, "cover.jpg"))
# handle authors
- is_author = db.session.query(db.Authors).filter(db.Authors.name == author).first()
+ is_author = db.session.query(db.Authors).filter(db.Authors.name == authr).first()
if is_author:
db_author = is_author
else:
- db_author = db.Authors(author, helper.get_sorted_author(author), "")
+ db_author = db.Authors(authr, helper.get_sorted_author(authr), "")
db.session.add(db_author)
# handle series
diff --git a/messages.pot b/messages.pot
index 4fd4bd3c..22192793 100644
--- a/messages.pot
+++ b/messages.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2018-08-28 10:22+0200\n"
+"POT-Creation-Date: 2018-08-28 14:05+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -529,24 +529,24 @@ msgstr ""
msgid "Password for user %s reset"
msgstr ""
-#: cps/web.py:3170
+#: cps/web.py:3169
msgid "Error opening eBook. File does not exist or file is not accessible"
msgstr ""
-#: cps/web.py:3185 cps/web.py:3419 cps/web.py:3424 cps/web.py:3579
+#: cps/web.py:3184 cps/web.py:3445 cps/web.py:3450 cps/web.py:3605
msgid "edit metadata"
msgstr ""
-#: cps/web.py:3198 cps/web.py:3449
+#: cps/web.py:3197 cps/web.py:3475
#, python-format
msgid "File extension \"%s\" is not allowed to be uploaded to this server"
msgstr ""
-#: cps/web.py:3201 cps/web.py:3453
+#: cps/web.py:3201 cps/web.py:3479
msgid "File to be uploaded must have an extension"
msgstr ""
-#: cps/web.py:3213 cps/web.py:3473
+#: cps/web.py:3213 cps/web.py:3499
#, python-format
msgid "Failed to create path %s (Permission denied)."
msgstr ""
@@ -561,29 +561,43 @@ msgstr ""
msgid "File format %s added to %s"
msgstr ""
-#: cps/web.py:3249 cps/web.py:3253
+#: cps/web.py:3252
+#, python-format
+msgid "Failed to create path for cover %s (Permission denied)."
+msgstr ""
+
+#: cps/web.py:3259
+#, python-format
+msgid "Failed to store cover-file %s."
+msgstr ""
+
+#: cps/web.py:3262
+msgid "Cover-file is not a valid image file"
+msgstr ""
+
+#: cps/web.py:3275 cps/web.py:3279
msgid "unknown"
msgstr ""
-#: cps/web.py:3275
+#: cps/web.py:3301
msgid "Cover is not a jpg file, can't save"
msgstr ""
-#: cps/web.py:3428
+#: cps/web.py:3454
msgid "Error editing book, please check logfile for details"
msgstr ""
-#: cps/web.py:3478
+#: cps/web.py:3504
#, python-format
msgid "Failed to store file %s (Permission denied)."
msgstr ""
-#: cps/web.py:3483
+#: cps/web.py:3509
#, python-format
msgid "Failed to delete file %s (Permission denied)."
msgstr ""
-#: cps/web.py:3565
+#: cps/web.py:3591
#, python-format
msgid "File %s uploaded"
msgstr ""
@@ -767,7 +781,7 @@ msgid "Ok"
msgstr ""
#: cps/templates/admin.html:112 cps/templates/admin.html:126
-#: cps/templates/book_edit.html:144 cps/templates/book_edit.html:166
+#: cps/templates/book_edit.html:148 cps/templates/book_edit.html:170
#: cps/templates/config_edit.html:206 cps/templates/config_view_edit.html:164
#: cps/templates/email_edit.html:40 cps/templates/email_edit.html:75
#: cps/templates/shelf.html:60 cps/templates/shelf_edit.html:19
@@ -803,7 +817,7 @@ msgstr ""
msgid "Delete formats:"
msgstr ""
-#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:165
+#: cps/templates/book_edit.html:22 cps/templates/book_edit.html:169
#: cps/templates/email_edit.html:73 cps/templates/email_edit.html:74
msgid "Delete"
msgstr ""
@@ -812,13 +826,13 @@ msgstr ""
msgid "Book Title"
msgstr ""
-#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:225
-#: cps/templates/book_edit.html:243 cps/templates/search_form.html:10
+#: cps/templates/book_edit.html:35 cps/templates/book_edit.html:229
+#: cps/templates/book_edit.html:247 cps/templates/search_form.html:10
msgid "Author"
msgstr ""
-#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:230
-#: cps/templates/book_edit.html:245 cps/templates/search_form.html:106
+#: cps/templates/book_edit.html:39 cps/templates/book_edit.html:234
+#: cps/templates/book_edit.html:249 cps/templates/search_form.html:106
msgid "Description"
msgstr ""
@@ -843,91 +857,95 @@ msgstr ""
msgid "Cover URL (jpg, cover is downloaded and stored in database, field is afterwards empty again)"
msgstr ""
-#: cps/templates/book_edit.html:65 cps/templates/detail.html:131
+#: cps/templates/book_edit.html:64
+msgid "Upload Cover from local drive"
+msgstr ""
+
+#: cps/templates/book_edit.html:69 cps/templates/detail.html:131
msgid "Publishing date"
msgstr ""
-#: cps/templates/book_edit.html:72 cps/templates/user_edit.html:33
+#: cps/templates/book_edit.html:76 cps/templates/user_edit.html:33
msgid "Language"
msgstr ""
-#: cps/templates/book_edit.html:83 cps/templates/search_form.html:117
+#: cps/templates/book_edit.html:87 cps/templates/search_form.html:117
msgid "Yes"
msgstr ""
-#: cps/templates/book_edit.html:84 cps/templates/search_form.html:118
+#: cps/templates/book_edit.html:88 cps/templates/search_form.html:118
msgid "No"
msgstr ""
-#: cps/templates/book_edit.html:130
+#: cps/templates/book_edit.html:134
msgid "Upload format"
msgstr ""
-#: cps/templates/book_edit.html:139
+#: cps/templates/book_edit.html:143
msgid "view book after edit"
msgstr ""
-#: cps/templates/book_edit.html:142 cps/templates/book_edit.html:178
+#: cps/templates/book_edit.html:146 cps/templates/book_edit.html:182
msgid "Get metadata"
msgstr ""
-#: cps/templates/book_edit.html:143 cps/templates/config_edit.html:204
+#: cps/templates/book_edit.html:147 cps/templates/config_edit.html:204
#: cps/templates/config_view_edit.html:163 cps/templates/login.html:20
#: cps/templates/search_form.html:153 cps/templates/shelf_edit.html:17
#: cps/templates/user_edit.html:151
msgid "Submit"
msgstr ""
-#: cps/templates/book_edit.html:157
+#: cps/templates/book_edit.html:161
msgid "Are you really sure?"
msgstr ""
-#: cps/templates/book_edit.html:160
+#: cps/templates/book_edit.html:164
msgid "Book will be deleted from Calibre database"
msgstr ""
-#: cps/templates/book_edit.html:161
+#: cps/templates/book_edit.html:165
msgid "and from hard disk"
msgstr ""
-#: cps/templates/book_edit.html:181
+#: cps/templates/book_edit.html:185
msgid "Keyword"
msgstr ""
-#: cps/templates/book_edit.html:182
+#: cps/templates/book_edit.html:186
msgid " Search keyword "
msgstr ""
-#: cps/templates/book_edit.html:184 cps/templates/layout.html:46
+#: cps/templates/book_edit.html:188 cps/templates/layout.html:46
msgid "Go!"
msgstr ""
-#: cps/templates/book_edit.html:188
+#: cps/templates/book_edit.html:192
msgid "Click the cover to load metadata to the form"
msgstr ""
-#: cps/templates/book_edit.html:200 cps/templates/book_edit.html:240
+#: cps/templates/book_edit.html:204 cps/templates/book_edit.html:244
msgid "Loading..."
msgstr ""
-#: cps/templates/book_edit.html:205 cps/templates/layout.html:221
+#: cps/templates/book_edit.html:209 cps/templates/layout.html:221
msgid "Close"
msgstr ""
-#: cps/templates/book_edit.html:227 cps/templates/book_edit.html:244
+#: cps/templates/book_edit.html:231 cps/templates/book_edit.html:248
#: cps/templates/detail.html:126 cps/templates/search_form.html:14
msgid "Publisher"
msgstr ""
-#: cps/templates/book_edit.html:232 cps/templates/book_edit.html:246
+#: cps/templates/book_edit.html:236 cps/templates/book_edit.html:250
msgid "Source"
msgstr ""
-#: cps/templates/book_edit.html:241
+#: cps/templates/book_edit.html:245
msgid "Search error!"
msgstr ""
-#: cps/templates/book_edit.html:242
+#: cps/templates/book_edit.html:246
msgid "No Result(s) found! Please try aonther keyword."
msgstr ""