The plugins works - but only after a refresh of the already loaded albums.
How to get the metadata written at the first run?
I’ve tried to set the priority to low, without success.
Usage of the tagger script is also no option, because according to the documentation the is_complete() function works only in the file rename scripts.
That’s not really possible. It only works when refreshing the release with the files already matched because only in this case it is guaranteed that all the files are present.
One option could be to use register_file_post_addition_to_track_processor instead, then update the tag for all files of the album every time this runs. Something roughly like this:
from picard.file import register_file_post_addition_to_track_processor
def set_complete_release_tag(track, file):
album = track.album
for file in album.iterfiles():
file.metadata["releasecompleteness"] = album.is_complete()
register_file_post_addition_to_track_processor(set_complete_release_tag)
Works perfectly! Thanks for the hint and even more, thanks for this great software.
Just one restriction: If a file is moved from a complete album to another album, then the old album is not complete anymore. But the tags are not updated. To fix this, also register the same function to register_file_post_removal_from_track_processor.