Affects Version/s: 1.3.2
Fix Version/s: None
Component/s: File Move & Rename
At the moment the only method of checking whether a file needs saving is if the metadata has changed. This ticket is to highlight other things that should be included in this test:
- "Write tags to files" is set and writeable metadata has changed. We need to have a list of ~ prefixed metadata that is written to files and needs to be checked.
- "Move files" is selected and file is not in the correct location.
- "Rename files" is selected and the filename has changed.
- "Embed cover images into tags" is not set and "Clear existing tags" is set and file contains embedded images
- "Embed cover images into tags" is set and "Clear existing tags" is set and there are embedded images and there are no downloaded images.
- "Embed cover images into tags" is set, and there are downloaded images and embedded images differ from images downloaded.
- File is ID3 and "Write tags to files" is set and ID3v23/4 version in settings is different from the version used in the file.
- File is ID3 and Text Encoding setting differs from the text encoding setting in any of the existing tags. (This will need code to capture the list of encodings in tags in the file.)
The Album should be shown as needing saving (i.e. icon stared) if:
- Any of the files underneath need saving (see above)
- "Save cover images as separate files" is set and "Move files" is set and the downloaded images do not exist exactly in the target directory.
- "Save cover images as separate files" is set and "Move files" is not set and the downloaded images do not exist exactly in all the directories that files are located in.
There may well be other combinations that I have not thought out.
I would suggest that we have some sort of isDirty function so that this can be re-run on loaded Albums/Tracks/Files by Options code when any of the options above are changed. We should also provide some way for plugins to mark a file as dirty in case the plugin implements new functionality.
If we can fully identify the list of reasons a file / album needs to be changed, then we can also implement functionality to avoid doing the save if it is not needed. See PICARD-300.