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.
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
PICARD-2032: Set albumsort/titlesort tags #369
PICARD-2032: Set albumsort/titlesort tags #369
Changes from 1 commit
b4cdc8a
02ba8f3
0e63460
b37b0f4
c490589
8baf3af
e5d1d9a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Might also be helpful say that these are words which aren't title-cased.
Check notice on line 83 in plugins/enhanced_titles/__init__.py
Codacy Production / Codacy Static Code Analysis
plugins/enhanced_titles/__init__.py#L83
Check notice on line 119 in plugins/enhanced_titles/__init__.py
Codacy Production / Codacy Static Code Analysis
plugins/enhanced_titles/__init__.py#L119
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 would IMO be better of as a function taking the field value and returning a sorted value, leaving the caller to get the unsorted value and store the sorted value i.e.
Also, using return enables early return improved readability avoiding multiple nested if/else i.e.
Check notice on line 176 in plugins/enhanced_titles/__init__.py
Codacy Production / Codacy Static Code Analysis
plugins/enhanced_titles/__init__.py#L176
Check notice on line 177 in plugins/enhanced_titles/__init__.py
Codacy Production / Codacy Static Code Analysis
plugins/enhanced_titles/__init__.py#L177
Check notice on line 190 in plugins/enhanced_titles/__init__.py
Codacy Production / Codacy Static Code Analysis
plugins/enhanced_titles/__init__.py#L190
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.
IMO, this is coded incorrectly. This function is called each and every time a script function is called and simply repeats the exact same code each time.
IMO the set of words for all languages should be calculated once, at load time rather than each time a script function is called. Personally I would store it in the same dict as the separate languages with an empty string as the key.