fix #732
This commit is contained in:
parent
a71a95892f
commit
47e1218fe0
@ -622,8 +622,9 @@ class TransferChain(ChainBase):
|
|||||||
if not path.exists():
|
if not path.exists():
|
||||||
return
|
return
|
||||||
if path.is_file():
|
if path.is_file():
|
||||||
# 删除文件、nfo、jpg
|
# 删除文件、nfo、jpg等同名文件
|
||||||
files = glob.glob(f"{Path(path.parent).joinpath(path.stem)}*")
|
pattern = path.stem.replace('[', '?').replace(']', '?')
|
||||||
|
files = path.parent.glob(f"{pattern}.*")
|
||||||
for file in files:
|
for file in files:
|
||||||
Path(file).unlink()
|
Path(file).unlink()
|
||||||
logger.warn(f"文件 {path} 已删除")
|
logger.warn(f"文件 {path} 已删除")
|
||||||
|
@ -11,6 +11,7 @@ from app.chain import ChainBase
|
|||||||
from app.chain.cookiecloud import CookieCloudChain
|
from app.chain.cookiecloud import CookieCloudChain
|
||||||
from app.chain.mediaserver import MediaServerChain
|
from app.chain.mediaserver import MediaServerChain
|
||||||
from app.chain.subscribe import SubscribeChain
|
from app.chain.subscribe import SubscribeChain
|
||||||
|
from app.chain.tmdb import TmdbChain
|
||||||
from app.chain.transfer import TransferChain
|
from app.chain.transfer import TransferChain
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
from app.db import SessionFactory
|
from app.db import SessionFactory
|
||||||
@ -183,6 +184,14 @@ class Scheduler(metaclass=Singleton):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 后台刷新TMDB壁纸
|
||||||
|
self._scheduler.add_job(
|
||||||
|
TmdbChain(self._db).get_random_wallpager,
|
||||||
|
"interval",
|
||||||
|
minutes=30,
|
||||||
|
next_run_time=datetime.now(pytz.timezone(settings.TZ)) + timedelta(seconds=3)
|
||||||
|
)
|
||||||
|
|
||||||
# 公共定时服务
|
# 公共定时服务
|
||||||
self._scheduler.add_job(
|
self._scheduler.add_job(
|
||||||
SchedulerChain(self._db).scheduler_job,
|
SchedulerChain(self._db).scheduler_job,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user