Skip to content

Conversation

@maxdorninger
Copy link
Owner

This pull request makes several significant improvements to the codebase, focusing on standardizing configuration usage, enhancing exception handling, and introducing new utilities for logging and filesystem checks. The main changes include replacing the old AllEncompassingConfig with the new MediaManagerConfig throughout the project, expanding and refactoring the exception hierarchy for better error handling, and adding new modules for logging and filesystem validation.

Configuration Standardization:

  • Replaced all imports and usages of AllEncompassingConfig with MediaManagerConfig across the codebase to unify and clarify configuration management. This affects files in authentication, indexer, and service modules, as well as Alembic migrations.

Exception Handling Improvements:

  • Refactored the exception hierarchy by introducing a MediaManagerException base class and several specific exceptions for common HTTP error scenarios (e.g., BadRequestError, UnauthorizedError, ForbiddenError, ConflictError, UnprocessableEntityError). Updated exception handlers to match these new classes and return appropriate HTTP status codes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the codebase by standardizing configuration usage and improving exception handling. Key changes include renaming AllEncompassingConfig to MediaManagerConfig, updating exception types from generic errors to specific HTTP-oriented exceptions, removing the valkey dependency, and reorganizing router endpoints with improved documentation.

Key Changes

  • Renamed AllEncompassingConfig to MediaManagerConfig throughout the codebase
  • Updated exception handling to use ConflictError instead of MediaAlreadyExists/generic exceptions
  • Removed valkey and prowlarr-py dependencies
  • Updated dependency versions (fastapi, starlette, pillow, fastapi-users)
  • Refactored TV service methods to accept domain objects instead of IDs
  • Reorganized and documented TV router endpoints

Reviewed changes

Copilot reviewed 37 out of 39 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pyproject.toml Updated dependency versions and removed prowlarr-py
metadata_relay/uv.lock Updated lock file with new dependency versions
metadata_relay/pyproject.toml Removed valkey dependency
media_manager/tv/service.py Refactored methods to accept Show/Season objects instead of IDs, updated config references
media_manager/tv/router.py Reorganized endpoints with better structure and added docstrings
media_manager/tv/repository.py Changed exception from MediaAlreadyExists to ConflictError
media_manager/torrent/utils.py Updated config class references
media_manager/torrent/manager.py Updated config class references
media_manager/torrent/download_clients/* Updated config class references across all clients
media_manager/scheduler.py New scheduler setup file added
media_manager/notification/* Updated config class references across notification providers
media_manager/movies/repository.py Changed exception from ValueError to ConflictError
media_manager/metadataProvider/tmdb.py Updated config class reference
media_manager/config.py Renamed AllEncompassingConfig to MediaManagerConfig

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import media_manager.movies.router as movies_router
import media_manager.tv.router as tv_router
from media_manager.notification.router import router as notification_router
import logging
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module 'logging' is imported with both 'import' and 'import from'.
Module 'media_manager.logging' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
import media_manager.database
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module 'media_manager.database' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,73 @@
import logging
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module 'logging' imports itself.
The module 'media_manager.logging' imports itself.

Copilot uses AI. Check for mistakes.
@maxdorninger maxdorninger merged commit 3937441 into master Jan 2, 2026
15 checks passed
@maxdorninger maxdorninger deleted the refactor-code branch January 4, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants