Repository navigation
fix: exclude role-labelled contributors from author metadata - #55
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces logic to filter out non-author contributors (such as translators or editors) from author fields throughout the codebase, ensuring that only actual authors are listed. It does this by adding a helper function to detect non-author roles, updating author extraction in both the Audnexus and Audible integration code, and adding comprehensive tests to verify the new behavior.
Contributor Role Filtering:
IsNonAuthorRolehelper ininternal/contributors/authors.goto detect and filter out contributor names that include non-author roles (e.g., "translator", "editor").EnrichedBook.Author()andEnrichedBook.Writer()ininternal/audnexus/metadata.goto use this helper, so only real authors are returned or listed. [1] [2]convertBookininternal/library/sync.goto skip non-author contributors when constructing theAuthorandAuthorASINfields.Testing and Validation:
IsNonAuthorRoleininternal/contributors/authors_test.goto ensure correct identification of non-author roles.internal/audnexus/metadata_test.goandinternal/library/sync_author_test.goto verify that only authors are returned, that co-authors are preserved, and that fallbacks work as expected. [1] [2]Code Organization:
internal/contributorspackage and updated imports in affected files to use the shared role-filtering logic. [1] [2]These changes improve the accuracy of author metadata by ensuring that only actual authors are surfaced in the application's data and user interfaces.
Closes #47