add movie tasks to scheduled tasks

This commit is contained in:
maxDorninger
2025-06-24 19:25:30 +02:00
parent 8b4da3ba3d
commit bdc3a4aea0
3 changed files with 8 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ from logging.config import dictConfig
from pathlib import Path
from pythonjsonlogger.json import JsonFormatter
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
@@ -52,9 +53,10 @@ import media_manager.movies.router as movies_router # noqa: E402
import media_manager.tv.router as tv_router # noqa: E402
from media_manager.tv.service import ( # noqa: E402
auto_download_all_approved_season_requests,
import_all_torrents,
import_all_show_torrents,
update_all_non_ended_shows_metadata,
)
from media_manager.movies.service import import_all_movie_torrents, update_all_movies_metadata
import shutil # noqa: E402
from fastapi import FastAPI # noqa: E402
@@ -81,13 +83,14 @@ else:
def hourly_tasks():
log.info(f"Hourly tasks are running at {datetime.now()}")
auto_download_all_approved_season_requests()
import_all_torrents()
import_all_show_torrents()
import_all_movie_torrents()
def weekly_tasks():
log.info(f"Weekly tasks are running at {datetime.now()}")
update_all_non_ended_shows_metadata()
update_all_movies_metadata()
scheduler = BackgroundScheduler()
trigger = CronTrigger(minute=0, hour="*")

View File

@@ -577,7 +577,7 @@ def auto_download_all_approved_movie_requests() -> None:
db.close()
def import_all_torrents() -> None:
def import_all_movie_torrents() -> None:
db: Session = SessionLocal()
movie_repository = MovieRepository(db=db)
torrent_service = TorrentService(torrent_repository=TorrentRepository(db=db))

View File

@@ -746,7 +746,7 @@ def auto_download_all_approved_season_requests() -> None:
db.close()
def import_all_torrents() -> None:
def import_all_show_torrents() -> None:
db: Session = SessionLocal()
tv_repository = TvRepository(db=db)
torrent_service = TorrentService(torrent_repository=TorrentRepository(db=db))