[PR #4319] [MERGED] Audible confidence score #4215

Closed
opened 2026-04-25 00:18:50 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4319
Author: @mikiher
Created: 5/21/2025
Status: Merged
Merged: 7/22/2025
Merged by: @advplyr

Base: masterHead: audible-confidence-score


📝 Commits (8)

  • 387e58a Add levenshteinSimilarity function to utils
  • a894ceb Match confidence calculation for audible results
  • de25763 Add match confidence display to BookMatchCard
  • 5017e7c Merge branch 'advplyr:master' into audible-confidence-score
  • 9c44fc0 Merge branch 'advplyr:master' into audible-confidence-score
  • bf6d81b Merge branch 'advplyr:master' into audible-confidence-score
  • e9a7055 Merge branch 'advplyr:master' into audible-confidence-score
  • 8c4bbfd Add match confidence as a badge on match book card

📊 Changes

5 files changed (+403 additions, -20 deletions)

View changed files

📝 client/components/cards/BookMatchCard.vue (+11 -3)
📝 client/strings/en-us.json (+1 -0)
📝 server/finders/BookFinder.js (+139 -10)
📝 server/utils/index.js (+8 -0)
📝 test/server/finders/BookFinder.test.js (+244 -7)

📄 Description

Brief summary

This adds a match confidence score when matching audiobooks using Audible.

Which issue is fixed?

Fixes #4277 (eventually).

In-depth Description

When returning match results from Audible, a new match confidence score is calculated based on book duration, title and subtitle, and author.

Details:

  • The duration, title, and author scores are linearly combined
    • duration is weighted 0.7, title 0.2 and author 0.1
  • Duration is given 1.0 score if diff is less than 1 minute, then the score drops linearly to 0.6 if diff is 5 mintues, and then more sharply to 0.0 when diff is 10 minutes or more.
  • The title score is calculated by comparing the book title to the actual title query.
    • If the title query seems to have a subtitle, we compare it to the book title + subtitle
  • The author score is calculated by comparing the book author to the actual author query
    • If the book author has multiple authors (separated by commas), we try to compare against each of the authors and take the maximum score
  • if the title is an ASIN, a 1.0 match confidence score is returned (the duration, title, and author scores are not calculated).

The combined score is written to the result record.

I added some code to display it in BookMatchCard.vue (only so you can easily check it - this is not necessarily how we want to display it)

At this point, I haven't yet added the quick match dialog support. This is just for you to comment on the confidence score.

How have you tested this?

Added extensive unit testing, and ran through many books to see what kinds of scores we get. It looks like a threshold of 0.85-0.9 could be used to skip the intended quick match approval dialog.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4319 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 5/21/2025 **Status:** ✅ Merged **Merged:** 7/22/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `audible-confidence-score` --- ### 📝 Commits (8) - [`387e58a`](https://github.com/advplyr/audiobookshelf/commit/387e58a7146807063521fff10789ffe986348efd) Add levenshteinSimilarity function to utils - [`a894ceb`](https://github.com/advplyr/audiobookshelf/commit/a894ceb9cf0b34f4c1511cc4183b5b7b7c007cb0) Match confidence calculation for audible results - [`de25763`](https://github.com/advplyr/audiobookshelf/commit/de25763a74ec57074489596d855550f8665bcf81) Add match confidence display to BookMatchCard - [`5017e7c`](https://github.com/advplyr/audiobookshelf/commit/5017e7ce9eb968c3df6c90bbb8a5fe92faf7376a) Merge branch 'advplyr:master' into audible-confidence-score - [`9c44fc0`](https://github.com/advplyr/audiobookshelf/commit/9c44fc0d0139e8c98bc248064071024f8bfd11bd) Merge branch 'advplyr:master' into audible-confidence-score - [`bf6d81b`](https://github.com/advplyr/audiobookshelf/commit/bf6d81b333b907164e563265c2042c957d76cd11) Merge branch 'advplyr:master' into audible-confidence-score - [`e9a7055`](https://github.com/advplyr/audiobookshelf/commit/e9a705587acc94d5ea1115f5677d44a7b3798172) Merge branch 'advplyr:master' into audible-confidence-score - [`8c4bbfd`](https://github.com/advplyr/audiobookshelf/commit/8c4bbfd6a2fc8c92e2a9e862b3e4e24b73d1df24) Add match confidence as a badge on match book card ### 📊 Changes **5 files changed** (+403 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `client/components/cards/BookMatchCard.vue` (+11 -3) 📝 `client/strings/en-us.json` (+1 -0) 📝 `server/finders/BookFinder.js` (+139 -10) 📝 `server/utils/index.js` (+8 -0) 📝 `test/server/finders/BookFinder.test.js` (+244 -7) </details> ### 📄 Description ## Brief summary This adds a match confidence score when matching audiobooks using Audible. ## Which issue is fixed? Fixes #4277 (eventually). ## In-depth Description When returning match results from Audible, a new match confidence score is calculated based on book duration, title and subtitle, and author. Details: - The duration, title, and author scores are linearly combined - duration is weighted 0.7, title 0.2 and author 0.1 - Duration is given 1.0 score if diff is less than 1 minute, then the score drops linearly to 0.6 if diff is 5 mintues, and then more sharply to 0.0 when diff is 10 minutes or more. - The title score is calculated by comparing the book title to the actual title query. - If the title query seems to have a subtitle, we compare it to the book title + subtitle - The author score is calculated by comparing the book author to the actual author query - If the book author has multiple authors (separated by commas), we try to compare against each of the authors and take the maximum score - if the title is an ASIN, a 1.0 match confidence score is returned (the duration, title, and author scores are not calculated). The combined score is written to the result record. I added some code to display it in BookMatchCard.vue (only so you can easily check it - this is not necessarily how we want to display it) At this point, I haven't yet added the quick match dialog support. This is just for you to comment on the confidence score. ## How have you tested this? Added extensive unit testing, and ran through many books to see what kinds of scores we get. It looks like a threshold of 0.85-0.9 could be used to skip the intended quick match approval dialog. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:50 +02:00
adam closed this issue 2026-04-25 00:18:50 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4215