Skip to content

fix: exclude role-labelled contributors from author metadata - #55

Merged
mstrhakr merged 2 commits into
masterfrom
mstrhakr/issue47
Oct 4, 2026
Merged

mstrhakr merged 2 commits into
masterfrom
mstrhakr/issue47

Conversation

@mstrhakr

@mstrhakr mstrhakr commented Oct 4, 2026

Copy link
Copy Markdown
Owner

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:

  • Added the IsNonAuthorRole helper in internal/contributors/authors.go to detect and filter out contributor names that include non-author roles (e.g., "translator", "editor").
  • Updated EnrichedBook.Author() and EnrichedBook.Writer() in internal/audnexus/metadata.go to use this helper, so only real authors are returned or listed. [1] [2]
  • Modified convertBook in internal/library/sync.go to skip non-author contributors when constructing the Author and AuthorASIN fields.

Testing and Validation:

  • Added unit tests for IsNonAuthorRole in internal/contributors/authors_test.go to ensure correct identification of non-author roles.
  • Added and expanded tests in internal/audnexus/metadata_test.go and internal/library/sync_author_test.go to verify that only authors are returned, that co-authors are preserved, and that fallbacks work as expected. [1] [2]

Code Organization:

  • Introduced the new internal/contributors package 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

Copilot AI balanced review requested due to automatic review settings October 4, 2026 13:43

This comment was marked as resolved.

@mstrhakr
mstrhakr merged commit 716c2cf into master Oct 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Translator credit is incorrectly included in author metadata and directory name

2 participants