Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A while ago I ran into the issue where if you check the "Append authors as Mood tags" option when a library is first set up with this agent, books will be stuck with those tags even if this option is unchecked and the metadata is refreshed. As far as I can tell, this happens because the only place where the moods are cleared is inside the
add_authors_to_moods
function, which is never called if that option is not checked.My attempt to fix this is based on moving the call to
helper.metadata.moods.clear()
before both of the mood tag setting functions, and only ifforce
is set. I'm not an expert on these agents, but I assumeforce
isTrue
when a user triggers a manual refresh, can you confirm if that is the case?I also removed the call to
clear()
the metadata inside theadd_authors_to_moods
function as it would only be called in this caseif not self.helper.metadata.moods
, meaning clearing wouldn't actually do anything? At least that's how I interpreted it.To test this, you can just try switching a library back and forth between setting "Append authors as Mood tags" from checked to not checked and refreshing the metadata. Let me know if you'd like me to change anything to get this approved!