Files
wordarr/wordarr/config.py
T

35 lines
1.2 KiB
Python

import os
from pathlib import Path
DOWNLOAD_DIR = Path(os.environ.get("WORDARR_DOWNLOAD_DIR", "/mnt/downloads"))
CONFIG_DIR = Path(os.environ.get("WORDARR_CONFIG_DIR", "/config"))
DB_PATH = Path(os.environ.get("WORDARR_DB_PATH", str(CONFIG_DIR / "wordarr.db")))
EBOOK_EXTENSIONS = {".epub", ".pdf", ".mobi", ".azw3", ".azw", ".fb2", ".djvu"}
# a Calibre export drops a dozen more formats next to those; list the ones you
# want the scan to offer, e.g. WORDARR_EXTRA_EBOOK_EXTENSIONS=".kepub,.lit,.rtf"
EBOOK_EXTENSIONS |= {
e if e.startswith(".") else f".{e}"
for e in (x.strip().lower() for x in
os.environ.get("WORDARR_EXTRA_EBOOK_EXTENSIONS", "").split(","))
if e
}
AUDIOBOOK_EXTENSIONS = {".m4b", ".m4a", ".mp3", ".flac", ".ogg", ".opus"}
COMIC_EXTENSIONS = {".cbz", ".cbr", ".cb7"}
ALL_EXTENSIONS = EBOOK_EXTENSIONS | AUDIOBOOK_EXTENSIONS | COMIC_EXTENSIONS
DEFAULT_NAMING = {
"ebook": {
"folder": "{Author}/{Title} ({Year})",
"file": "{Author} - {Title}",
},
"audiobook": {
"folder": "{Author}/{Title}",
"file": "{Title}",
},
"comic": {
"folder": "{Series}",
"file": "{Series} - Band {Volume}",
},
}