#6 author name not showing

已关闭
Blance3 月之前创建 · 1 条评论

Author is showing Unknown

Author is showing Unknown

Issue Resolved

Fixed the author name display issue by improving the metadata extraction logic.

Root Cause: The Audiobookshelf API can return author information in different field formats:

  • metadata.authorName (string field)
  • metadata.authors (array of author objects)

The original code only checked authorName, causing "Unknown" to appear when the API used the authors array format.

Solution: Created a robust extract_author_name() helper function that:

  1. First tries metadata.authorName (string field)
  2. Falls back to extracting from metadata.authors array
  3. Handles both dict and string formats in the authors array
  4. Only returns "Unknown" as a last resort

Changes Made:

  • Added extract_author_name() helper function in app/main.py
  • Updated book creation and update logic to use the new extraction method
  • Service restarted with the fix applied

Next Steps for User: Re-sync your library to update existing books with correct author names. The fix will automatically apply to all future syncs.

Commit: 17c0957

✅ **Issue Resolved** Fixed the author name display issue by improving the metadata extraction logic. **Root Cause:** The Audiobookshelf API can return author information in different field formats: - `metadata.authorName` (string field) - `metadata.authors` (array of author objects) The original code only checked `authorName`, causing "Unknown" to appear when the API used the `authors` array format. **Solution:** Created a robust `extract_author_name()` helper function that: 1. First tries `metadata.authorName` (string field) 2. Falls back to extracting from `metadata.authors` array 3. Handles both dict and string formats in the authors array 4. Only returns "Unknown" as a last resort **Changes Made:** - Added `extract_author_name()` helper function in `app/main.py` - Updated book creation and update logic to use the new extraction method - Service restarted with the fix applied **Next Steps for User:** Re-sync your library to update existing books with correct author names. The fix will automatically apply to all future syncs. **Commit:** 17c0957
登录 并参与到对话中。
未选择标签
未选择里程碑
未指派成员
2 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。