Works around the issue that os.path.isabs detects a path like \\server\share not as absolute.
This can break file naming on Windows shares and result in recursive sub folders.
See also https://bugs.python.org/issue22302
Apply workaround to ensure file name changes in case only also on Linux when using case insensitive file systems.
Unify the approaches for Windows and Linux. Apply the workaround only if necessary.
On some case sensitive, case preserving file systems a normal rename will not change the casing. Detect this case and workaround it by doing a double rename.
Fix crash in Tags From Filenames if same tag placeholder was used multiple times. Refactor the parsing and matching of the expression into separate class with tests.
PICARD-1972: Allow initializing Metadata with another Metadata object
If calling Metadata(other_metadata) make a full copy and don't just treat other_metadata as a dict.
Apart of making the API more intuitive this fixes issues with track metadata being not fully preserved when attaching files to tracks.
This was introduced very eraly in d923c9a. Originally MB provided a more fixed list of instruments, with instrument names as attributes actually being camel cased.
This is no longer the case and instruments should now be used as given in the API response.
- catch exceptions in extract_year_from_date() and log them to debug
- return None if year cannot be extracted
- check for None in metadata.compare_to_release_parts() before trying to compare years
This isn't perfect, the function is called a lot of time and it spams debug log (if enabled)
Note: I removed a very old comment in imports that doesn't make any sense (it was introduced 6 years ago in 323d12892c) and it was making isort unhappy.
* Added a release-level producer to release.json because the existing release-artist relationships are not used in tagging
* Modified the existing release test to check that the producer tag is the release-level producer when "Use release relationships" is enabled
* Added a release test to check that the producer tag is empty when "Use release relationships" is disabled
discid.disc.DiscError only exists in python-discid, not in the compat version of python-libdiscid. The proper way in both libraries is to access discid.DiscError.