Commit Graph

35 Commits

Author SHA1 Message Date
Maximilian Dorninger
f5253990e0 switch from APScheduler to Taskiq (#461)
This PR replaces the APScheduler lib with the Taskiq task queuing lib. 

# why

APScheduler doesn't support FastAPI's DI in tasks, this makes them quite
cumbersome to read and write since DB, Repositories and Services all
need to be instanciated manually.

Moreover, Taskiq makes it easier to start background tasks from FastAPI
requests. This enables MM to move to a more event-based architecture.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* App now uses an orchestrated async startup/shutdown and runs
background scheduling via a database-backed task queue; startup enqueues
pre-load/import/update tasks.

* **Bug Fixes**
* Improved torrent client handling with clearer conflict messages and
guidance for manual resolution.
* Enhanced logging around season, episode and metadata update
operations; minor regex/behaviour formatting preserved.

* **Chores**
* Updated dependencies to support the new task queue and connection
pooling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-26 21:23:24 +01:00
Maximilian Dorninger
a643c9426d remove everything related to requests (#455)
This PR removes the requests feature. The functionality will be replaced
either by Seerr or by reimplementing it in a better way.
2026-02-22 19:46:47 +01:00
natarelli22
d8a0ec66c3 Support for handling Single Episode Torrents (#331)
**Description**
As explained on #322, MediaManager currently only matches torrents that
represent full seasons or season packs.
As a result, valid episode-based releases — commonly returned by
indexers such as EZTV — are filtered out during scoring and never
considered for download.

Initial changes to the season parsing logic allow these torrents to be
discovered.
However, additional changes are required beyond season parsing to
properly support single-episode imports.

This PR is intended as a work-in-progress / RFC to discuss the required
changes and align on the correct approach before completing the
implementation.

**Things planned to do**
[X] Update Web UI to better display episode-level details
[ ] Update TV show import logic to handle single episode files, instead
of assuming full season files (to avoid integrity errors when episodes
are missing)
[ ] Create episode file tables to store episode-level data, similar to
season files
[ ] Implement fetching and downloading logic for single-episode torrents

**Notes / current limitations**
At the moment, the database and import logic assume one file per season
per quality, which works for season packs but not for episode-based
releases.

These changes are intentionally not completed yet and are part of the
discussion this PR aims to start.

**Request for feedback**
This represents a significant change in how TV content is handled in
MediaManager.
Before proceeding further, feedback from @maxdorninger on the overall
direction and next steps would be greatly appreciated.

Once aligned, the remaining tasks can be implemented incrementally.

---------

Co-authored-by: Maximilian Dorninger <97409287+maxdorninger@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-22 15:21:19 +01:00
Marcel Hellwig
96b84d45db Adding some more new lints (#393)
Enable `UP` and `TRY` lint
2026-02-01 18:04:15 +01:00
Maximilian Dorninger
a39e0d204a Ruff enable type annotations rule (#362)
This PR enables the ruff rule for return type annotations (ANN), and
adds the ty package for type checking.
2026-01-06 17:07:19 +01:00
Marcel Hellwig
75406cbc64 ruff: add RET lint
lints about assign and immediatly returning a variable
2026-01-05 19:30:42 +01:00
Marcel Hellwig
ff013ac76e ruff: enable I lint 2026-01-05 19:30:42 +01:00
Marcel Hellwig
97cb3b5c1e ruff: enable EM lint 2026-01-05 19:30:42 +01:00
maxid
51560ae1e9 refactor: remove unneeded comments 2025-12-29 23:01:34 +01:00
maxid
009f743259 refactor: enhance exception handling 2025-12-29 22:54:45 +01:00
maxid
61fc87e577 fix bug: actually save imdb_id to database 2025-12-27 12:42:36 +01:00
maxid
9c6676f1f3 feat: add imdb_id parameter to update movie and show methods 2025-12-23 20:29:51 +01:00
aasmoe
fda59e49b2 Pass language as a value in show and movie objects. DB migration to add original_langauge column. Removes workarounds 2025-12-13 19:30:02 +00:00
maxid
c984d40fd3 format code 2025-12-10 17:50:11 +01:00
Maximilian Dorninger
a603c65fd3 Update media_manager/tv/repository.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-08 00:38:15 +01:00
Maximilian Dorninger
bed2fe8fa7 Update media_manager/tv/repository.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-08 00:37:27 +01:00
maxid
643d2448b1 reduce logs 2025-12-08 00:30:59 +01:00
maxid
64bcd85287 make add_show endpoint always return the show 2025-12-07 16:05:10 +01:00
maxid
11cafa800a add route which returns the total count of all episodes 2025-12-06 21:04:58 +01:00
maxDorninger
49b95df59d add backend code to get/set tv library 2025-07-16 02:00:20 +02:00
maxDorninger
9360b88842 format code with ruff 2025-06-22 17:41:50 +02:00
maxDorninger
87cb9088c4 add logic to backend to automatically download new seasons 2025-06-22 14:03:41 +02:00
maxDorninger
d525231959 add ended attribute to show 2025-06-09 21:16:27 +02:00
maxDorninger
406ae044cb add ability to update show's metadata and extract the poster image download logic into a separate function 2025-06-09 12:14:21 +02:00
maxDorninger
302890171f refactor repository module to import NotFoundError from media_manager.exceptions and fix return statement in delete operation 2025-06-08 18:42:02 +02:00
maxDorninger
3d9e9d00d0 add get_torrent_by_id dependency, add 404 error message and make NotFoundException globally available 2025-06-08 18:40:30 +02:00
maxDorninger
1e79869d1e fix requests not working 2025-06-08 15:56:36 +02:00
maxDorninger
41222b2452 fix season requests not working 2025-06-08 12:08:49 +02:00
maxDorninger
231c36efe0 run linter and formatter 2025-06-07 13:29:48 +02:00
maxDorninger
1fab5d8056 run linter and formatter 2025-06-07 13:23:00 +02:00
maxDorninger
d31658a82f update router and exceptions and create dependencies.py 2025-06-07 13:19:16 +02:00
maxDorninger
5b26b3a665 create tv service and repository classes 2025-06-06 21:53:05 +02:00
maxDorninger
3ec45c5f0a format code 2025-05-31 14:40:33 +02:00
maxDorninger
40c90d90ed feat: add automatic downloads for approved season requests 2025-05-31 13:45:50 +02:00
maxDorninger
206df8b150 refactor: change folder structure 2025-05-29 15:36:35 +02:00