Make kobo resources editable (#3472)
This commit is contained in:
+9
-2
@@ -41,13 +41,12 @@ from werkzeug.datastructures import Headers
|
|||||||
from sqlalchemy import func
|
from sqlalchemy import func
|
||||||
from sqlalchemy.sql.expression import and_, or_
|
from sqlalchemy.sql.expression import and_, or_
|
||||||
from sqlalchemy.exc import StatementError
|
from sqlalchemy.exc import StatementError
|
||||||
from sqlalchemy.sql import select
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from . import config, logger, kobo_auth, db, calibre_db, helper, shelf as shelf_lib, ub, csrf, kobo_sync_status
|
from . import config, logger, kobo_auth, db, calibre_db, helper, shelf as shelf_lib, ub, csrf, kobo_sync_status
|
||||||
from . import isoLanguages
|
from . import isoLanguages
|
||||||
from .epub import get_epub_layout
|
from .epub import get_epub_layout
|
||||||
from .constants import COVER_THUMBNAIL_SMALL, COVER_THUMBNAIL_MEDIUM, COVER_THUMBNAIL_LARGE
|
from .constants import COVER_THUMBNAIL_SMALL, COVER_THUMBNAIL_MEDIUM, COVER_THUMBNAIL_LARGE, BASE_DIR
|
||||||
from .helper import get_download_link
|
from .helper import get_download_link
|
||||||
from .services import SyncToken as SyncToken
|
from .services import SyncToken as SyncToken
|
||||||
from .web import download_required
|
from .web import download_required
|
||||||
@@ -1134,6 +1133,14 @@ def download_book(book_id, book_format):
|
|||||||
|
|
||||||
|
|
||||||
def NATIVE_KOBO_RESOURCES():
|
def NATIVE_KOBO_RESOURCES():
|
||||||
|
kobo_file = os.path.join(BASE_DIR, "kobo_resources.txt")
|
||||||
|
try:
|
||||||
|
if os.path.isfile(kobo_file):
|
||||||
|
with open(kobo_file, "r") as f:
|
||||||
|
lines = f.read()
|
||||||
|
return json.loads(lines)
|
||||||
|
except Exception as e:
|
||||||
|
log.error(e)
|
||||||
return {
|
return {
|
||||||
"account_page": "https://www.kobo.com/account/settings",
|
"account_page": "https://www.kobo.com/account/settings",
|
||||||
"account_page_rakuten": "https://my.rakuten.co.jp/",
|
"account_page_rakuten": "https://my.rakuten.co.jp/",
|
||||||
|
|||||||
@@ -44,4 +44,4 @@ natsort>=2.2.0,<8.5.0
|
|||||||
comicapi>=2.2.0,<3.3.0
|
comicapi>=2.2.0,<3.3.0
|
||||||
|
|
||||||
# Kobo integration
|
# Kobo integration
|
||||||
jsonschema>=3.2.0,<4.24.0
|
jsonschema>=3.2.0,<4.30.0
|
||||||
|
|||||||
Reference in New Issue
Block a user