forked from L4GSP1KE/Upload-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 135
Update exportmi.py to scan VOB instead of IFO for ScanType if upload is a DVD full disc #1273
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
Closed
Changes from all commits
Commits
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Fallback probing can still miss ScanType on some DVD layouts.
At Line 536, glob fallback only runs when heuristic candidates are empty. If a heuristic file exists but has no usable video ScanType, Line 576 returns empty without trying other
.VOBfiles, so the ScanType can still remain unset.💡 Proposed fix (probe multiple candidates, largest-first, until ScanType is found)
🧰 Tools
🪛 Ruff (0.15.2)
[warning] 552-552: Do not catch blind exception:
Exception(BLE001)
[warning] 558-558: Do not catch blind exception:
Exception(BLE001)
[warning] 571-571: Unnecessary key check before dictionary access
Replace with
dict.get(RUF019)
🤖 Prompt for AI Agents
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.
This is a bad suggestion as the proposed change will undoubtedly cause an incorrect scan type to be written to MediaInfo.json at some point. We do not ever want to read a .VOB file that is not the largest one as the largest .VOB file in a DVD full disc will always be the main movie. If you read any of the smaller .VOB files, they main contain a different scan type than the main movie .VOB files. It is better to fallback to returning an empty string and allowing video.py to handle the case where the Scan type field is not present in the largest .VOB MediaInfo dict.
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.
@9Oc, you're absolutely right—thank you for the correction! I understand now that the largest VOB file always contains the main movie on a DVD full disc, and probing smaller VOBs could indeed lead to an incorrect scan type being written. Your current implementation correctly identifies and uses only the largest VOB, with a fallback to an empty string thatvideo.pycan handle appropriately. I appreciate the explanation of the DVD structure!✏️ Learnings added
🧠 Learnings used