added read_only attribute to base StorageStyle class - #3231
Closed
slogsdon7 wants to merge 4 commits into
Closed
Conversation
7 tasks
Member
|
This change looks good to me! The only issue is that one of your lines is too long and if failing the style check. Would you mind fixing that up? It might also be nice to add a test for this, but I won't insist :) |
Author
Done and done :). Gotta head out before these CI checks finish but if they catch anything else I'll fix them later today |
Member
|
The MediaFile split has happened now, so I'll close this in favour of beetbox/mediafile#9. Thanks for handling the migration! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Worked on as part of addressing #3216 in a backwards-compatible way.
The way I did this was to modify the base StorageClass to take a named argument "read_only." If the argument evaluates too true, then the
store()method on the instance is set to a lambda which simply returns None.Example usage:
MP4StorageStyle('----:com.apple.iTunes:Label', read_only=True).For the moment, read only styles should be placed after the other styles of the same type in the argument list, as MediaField's get method returns on the first tag style it reads from the file.