-
-
Notifications
You must be signed in to change notification settings - Fork 75
Enhacement for import existing media #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
juandbc
wants to merge
11
commits into
maxdorninger:master
from
juandbc:improve-import-existing-files
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3280ff9
Modify return type for TorrentService#cancel_download to avoid error
juandbc 1fd7693
Add util to extract subtitle language code
juandbc 459db90
Add missing index to subtitle suffix
juandbc 1e3562d
Fix Ruff checks
juandbc f290ab3
Add util to extract quality when import existing media
juandbc 48c617a
Fix shows quality when import
juandbc 270b1c3
Fix QualityString method access modifier
juandbc e8c5eff
Fix util quality for HD/720p
juandbc 1ab337d
Add scoring rule evaluation for custom search
juandbc d823eaa
Merge pull request #5 from juandbc/fix-custom-search-scoring-rule
juandbc 2016cfe
Merge branch 'master' into improve-import-existing-files
juandbc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| *.py text eol=lf | ||
| *.md text eol=lf | ||
| *.toml text eol=lf | ||
| *.yml text eol=lf | ||
| *.yaml text eol=lf | ||
| *.sh text eol=lf | ||
| *.txt text eol=lf | ||
| *.ini text eol=lf | ||
| *.mako text eol=lf | ||
| *.iml text eol=lf | ||
| *.js text eol=lf | ||
| *.ts text eol=lf | ||
| *.json text eol=lf | ||
| *.css text eol=lf | ||
| *.svelte text eol=lf | ||
|
|
||
| Makefile text eol=lf | ||
| Dockerfile text eol=lf | ||
|
|
||
| # Binary files | ||
| *.png binary | ||
| *.jpg binary | ||
| *.jpeg binary | ||
| *.gif binary | ||
| *.ico binary |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -22,6 +22,10 @@ class QualityStrings(Enum): | |
| sd = "400p" | ||
| unknown = "unknown" | ||
|
|
||
| @staticmethod | ||
| def get_label(quality: Quality) -> str: | ||
| return QualityStrings[quality.name].value | ||
|
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 27 returns Proposed fix class QualityStrings(Enum):
uhd = "4K"
fullhd = "1080p"
hd = "720p"
- sd = "400p"
+ sd = "480p"
unknown = "unknown"🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| class TorrentStatus(Enum): | ||
| finished = 1 | ||
|
|
||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential
IndexErrorif no video files found in source directory.video_files[0]will raise anIndexErrorifget_files_for_importreturns an empty list. Unlikeimport_torrent_files(line 488) which validateslen(video_files) != 1, this method lacks a guard.🛡️ Proposed fix to add validation
video_files, subtitle_files, _all_files = get_files_for_import( directory=new_source_path ) + if not video_files: + log.error(f"No video files found in {new_source_path}") + return False + file_quality = extract_quality_video_file(video_files[0]) file_suffix = f"{QualityStrings.get_label(file_quality)} - IMPORTED"📝 Committable suggestion
🤖 Prompt for AI Agents