diff --git a/Writerside/topics/User-Guide.md b/Writerside/topics/User-Guide.md index b29d75c..1ed1244 100644 --- a/Writerside/topics/User-Guide.md +++ b/Writerside/topics/User-Guide.md @@ -3,8 +3,8 @@ If you are coming from Radarr or Sonarr you will find that MediaManager does things a bit differently. Instead of completely automatically downloading and managing your media, MediaManager focuses on providing an easy-to-use interface to guide you through the process of finding and downloading media. Advanced features like multiple -qualities of a show/movie necessitate such a paradigm shift. __So here is a quick step-by-step guide to get you started: -__ +qualities of a show/movie necessitate such a paradigm shift. +__So here is a quick step-by-step guide to get you started:__ diff --git a/Writerside/topics/configuration-backend.md b/Writerside/topics/configuration-backend.md index a315ce1..bd1e630 100644 --- a/Writerside/topics/configuration-backend.md +++ b/Writerside/topics/configuration-backend.md @@ -4,9 +4,10 @@ These variables configure the core backend application, database connections, au ## General Settings -| Variable | Description | Default | -|-----------------|-----------------------------|-----------| -| `API_BASE_PATH` | The url base of the backend | `/api/v1` | +| Variable | Description | Default | +|-----------------|----------------------------------------------------------------------------------|-----------| +| `API_BASE_PATH` | The url base of the backend | `/api/v1` | +| `CORS_URLS` | Enter the origins you are going to access the api from (e.g. https://mm.example) | - | ## Database Settings diff --git a/media_manager/main.py b/media_manager/main.py index a6e7a02..20d5dce 100644 --- a/media_manager/main.py +++ b/media_manager/main.py @@ -5,8 +5,6 @@ from logging.config import dictConfig from pythonjsonlogger.json import JsonFormatter -import torrent.service -from database import SessionLocal LOGGING_CONFIG = { "version": 1, @@ -59,6 +57,8 @@ from datetime import datetime from contextlib import asynccontextmanager from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.cron import CronTrigger +import media_manager.torrent.service +from media_manager.database import SessionLocal init_db() log.info("Database initialized") @@ -77,37 +77,28 @@ else: def hourly_tasks(): log.info(f"Tasks are running at {datetime.now()}") auto_download_all_approved_season_requests() - torrent.service.TorrentService(db=SessionLocal()).import_all_torrents() + media_manager.torrent.service.TorrentService(db=SessionLocal()).import_all_torrents() scheduler = BackgroundScheduler() trigger = CronTrigger(minute=0, hour="*") scheduler.add_job(hourly_tasks, trigger) +scheduler.start() @asynccontextmanager async def lifespan(app: FastAPI): - scheduler.start() yield scheduler.shutdown() - -app = FastAPI(lifespan=lifespan) - - base_path = os.getenv("API_BASE_PATH") or "/api/v1" log.info("Base Path for API: %s", base_path) -app = FastAPI(root_path=base_path) +app = FastAPI(root_path=base_path, lifespan=lifespan) -if basic_config.DEVELOPMENT: - origins = [ - "*", - ] -else: - origins = basic_config.CORS_URLS.split(",") - log.info("CORS URLs activated for following origins:") - for origin in origins: - log.info(f" - {origin}") +origins = basic_config.CORS_URLS.split(",") +log.info("CORS URLs activated for following origins:") +for origin in origins: + log.info(f" - {origin}") app.add_middleware( CORSMiddleware, diff --git a/web/src/lib/components/app-sidebar.svelte b/web/src/lib/components/app-sidebar.svelte index a62de73..778890b 100644 --- a/web/src/lib/components/app-sidebar.svelte +++ b/web/src/lib/components/app-sidebar.svelte @@ -40,12 +40,12 @@ navSecondary: [ { title: 'Support', - url: '#', + url: 'https://github.com/maxdorninger/MediaManager/issues', icon: LifeBuoy }, { title: 'Feedback', - url: '#', + url: 'https://github.com/maxdorninger/MediaManager/issues', icon: Send }, { diff --git a/web/src/lib/components/season-requests-table.svelte b/web/src/lib/components/season-requests-table.svelte index 87ecc69..ea24305 100644 --- a/web/src/lib/components/season-requests-table.svelte +++ b/web/src/lib/components/season-requests-table.svelte @@ -150,6 +150,12 @@ {/if} + {:else } + + + There are currently no requests. + + {/each}