Created
August 31, 2024 15:58
-
-
Save rinsuki/d3526c637ee6a1ac0bc10b55a0ef426b to your computer and use it in GitHub Desktop.
Revisions
-
rinsuki created this gist
Aug 31, 2024 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Check Picard plugin location with https://picard-docs.musicbrainz.org/en/troubleshooting/does_not_start.html and place to subdirectory of plugins folder. e.g. on macOS, `~/Library/Preferences/MusicBrainz/Picard/plugins/shiftjis-wav/__init__.py` 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ from picard import log from picard.formats.wav import RiffListInfo PLUGIN_API_VERSIONS = ["2.2"] # trying to patch here https://github.com/metabrainz/picard/blob/4d49ac4bfb9bed3c87ddd843d81235561b3b32bd/picard/formats/wav.py#L143-L149 @staticmethod def decode(value: bytes): log.debug(f"patched decoder {value}") try: value = value.decode('utf-8') except UnicodeDecodeError: value = value.decode('shift-jis') return value.rstrip('\0') # https://docs.python.org/3/tutorial/classes.html#private-variables RiffListInfo._RiffListInfo__decode_data = decode