Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Author Moods Toggle #71

Merged
merged 1 commit into from
Jan 5, 2023
Merged

Fix Author Moods Toggle #71

merged 1 commit into from
Jan 5, 2023

Conversation

csandman
Copy link
Contributor

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 if force is set. I'm not an expert on these agents, but I assume force is True 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 the add_authors_to_moods function as it would only be called in this case if 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!

@djdembeck
Copy link
Owner

I assume force is True when a user triggers a manual refresh, can you confirm if that is the case?

Yes, I believe a manual refresh or 'refresh all' in the library. It's been a while since I tested it, which was when I first re-wrote the original Audiobooks.bundle.

Let me look this over. I've been away from code for a while, so might need to stare blankly at the screen for a bit 😛

@djdembeck djdembeck added the bug Something isn't working label Jan 5, 2023
@djdembeck djdembeck merged commit 9461d3f into djdembeck:develop Jan 5, 2023
@csandman
Copy link
Contributor Author

csandman commented Jan 6, 2023

Awesome, thanks for taking a look!

@csandman csandman deleted the fix-moods branch January 9, 2023 20:51
@djdembeck djdembeck mentioned this pull request Jan 24, 2023
djdembeck added a commit that referenced this pull request Jan 24, 2023
* feat!: multi region (#66)

* feat: ✨ add `RegionTool` helper for building regional urls; add region setting

* fix: 🐛 quick matching could fail, fixes #51

* fix: 🐛 increase timeout and add sleep time to requests to allow them to come back
also try to catch SSLError that plex throws when time out occurs

* fix: 🚑 fix unbound error in `make_request`

* feat: 🎨 region override in search using `[AB]`
author ASIN override

* feat: ✨ `update_tools` uses super class and supports region extraction now
ids are now saved as `$ASIN_$REGION`;
BREAKING: new IDs are required for region support. Refreshing items created by this version on an old version will not work

* refactor: ♻️ allow overriding asin + region for albums

* docs: 📝 add region info into README

* fix: correctly clear authors when settings change

#71

* fix(album-search): 🐛 `normalizedName` was requested before being made available

* fix: 🐛 `content_type` check was not plural, all data was trying to be collected into variable if unused

* refactor: ♻️ break up some long functions

now more manageable for future use and also easier to read/infer

* chore(release): 1.0.0

Co-authored-by: Chris Sandvik <9214195+csandman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants