fix: first run not create poster folder problem.

This commit is contained in:
EstrellaXD
2023-10-10 13:53:56 +08:00
parent 9d9b243d97
commit 87a49c49b1
3 changed files with 3 additions and 3 deletions

View File

@@ -8,5 +8,6 @@ TMDB_API = "32b19d6a05b512190a056fa4e747cbbc"
DATA_PATH = "sqlite:///data/data.db"
LEGACY_DATA_PATH = Path("data/data.json")
VERSION_PATH = Path("config/version.info")
POSTERS_PATH = Path("data/posters")
PLATFORM = "Windows" if "\\" in settings.downloader.path else "Unix"

View File

@@ -36,9 +36,6 @@ class Program(RenameThread, RSSThread):
if not self.database:
first_run()
logger.info("[Core] No db file exists, create database file.")
if not self.img_cache:
logger.info("[Core] No image cache exists, create image cache.")
cache_image()
return {"status": "First run detected."}
if self.legacy_data:
logger.info(

View File

@@ -1,6 +1,7 @@
import logging
from module.rss import RSSEngine
from module.conf import POSTERS_PATH
logger = logging.getLogger(__name__)
@@ -15,3 +16,4 @@ def first_run():
with RSSEngine() as engine:
engine.create_table()
engine.user.add_default_user()
POSTERS_PATH.mkdir(parents=True, exist_ok=True)