-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement filesize validation for movies and episodes (#869)
* feat: implement filesize validation for movies and episodes * feat: enhance filesize validation for movies and episodes, improve logging and delete invalid torrents * fix: fix invalid log string property accessor * feat: reintroduce and refactor filesize validation with media type enums - Added `ShowMediaType`, `MovieMediaType`, and `MediaType` enums to categorize media types. - Refactored `filesize_is_acceptable` function to use media type enums for validation. - Updated `Downloader` class to utilize the new media type enums for file validation. - Consolidated movie and show filesize validation into a single function. - Enhanced code readability and maintainability by using enums and reducing redundancy. * fix: ordering of assignment after super call * fix: ordering of assignment before super call * fix: remove duplicate request logging Caller should log on exception. * fix: remove possible duplicate hashes from uppercase, and lowercase scrapers. * feat: enhance downloader with improved filesize validation and logging - Introduced `InvalidFileSizeException` for better error handling. - Added `DownloadCachedStreamResult` class to encapsulate download results. - Refactored `validate_filesize` to raise exceptions and log invalid file sizes. - Enhanced logging with `get_invalid_filesize_log_string` for clearer messages. - Improved structure and readability of the downloader service. * fix: less cpu cycles * fix: ensure item attributes are updated after filesize validation --------- Co-authored-by: PromKnight <[email protected]>
- Loading branch information
1 parent
f2636e4
commit d1041db
Showing
7 changed files
with
161 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .item import Episode, MediaItem, Movie, Season, Show # noqa | ||
from .item import Episode, MediaItem, Movie, Season, Show, ShowMediaType, MovieMediaType, MediaType # noqa | ||
from .state import States # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.