If a file is moved to a track where the metadata matches perfectly but only cover art is different, then the similarity score of this file was not recalculated. That means the file retains the similarity of the previous (probably bad) match. Also only do this change if the state was NORMAL before (similar to the other state updates, ignoring states like PENDING and ERROR).
A renaming script evaluating to an empty name would cause files to be renamed to e.g. "_mp3", breaking the file extension. Now the original filename will be kept.
acoustid_fingerprint is now a normal attribute of File and always available. Adding and removing the file to and from the AcoustIDManager is now completely handled in File.
- QSettings object needs special care, as file was re-created on exit
- Append a cleanup function as soon as possible to ensure temporary dirs & files are removed in any case
- prefer addCleanup() over tearDown(), keeping creation and cleanup together
This also seems not only on the macOS version but also on the Python build being used. On the build server with macOS 10.15 this works with the Python binaries provided on the server, but fails with official binaries from python.org.
- access times are likely to differ, a race condition is possible
- stat() has be done after the change to be able to compare
- comments added
- force sync after modifying test file
- make code easier to understand
See https://github.com/metabrainz/picard/pull/1132#issuecomment-474113665
https://docs.python.org/3/library/os.html#os.utime
Since Python 3.3, ns parameter is available
"The best way to preserve exact times is to use the st_atime_ns and st_mtime_ns
fields from the os.stat() result object with the ns parameter to utime."
Make time preservation testable.