[PR #4383] [MERGED] Use fuse.js for podcast episode search #4232

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4383
Author: @JKubovy
Created: 6/6/2025
Status: Merged
Merged: 6/14/2025
Merged by: @advplyr

Base: masterHead: improve-podcast-episode-search


📝 Commits (2)

  • eda7036 Use fuse.js for podcast episode search
  • 6d0d141 Add fuse.basic.min.js in libs instead of full npm package, use lower threshold for quick matching

📊 Changes

3 files changed (+35 additions, -24 deletions)

View changed files

server/libs/fusejs/index.js (+13 -0)
📝 server/scanner/Scanner.js (+1 -1)
📝 server/utils/podcastUtils.js (+21 -23)

📄 Description

Replace levenshtein distance with fuse.js fuzzy searching library. Search in episode's title and subtitle

Brief summary

This PR improves the manual podcast episode search by replacing the Levenshtein distance algorithm with Fuse.js, a lightweight fuzzy search library. The result is a more intuitive and forgiving search experience when linking audio files to episodes.

Which issue is fixed?

Fixes #4382

In-depth Description

Previously, episode search relied on Levenshtein distance, which often failed to return results when users searched using partial titles, numbers, or keywords — e.g., searching "212" for "Super Podcast - Episode 212 - How to start writing book".

This PR replaces that logic with Fuse.js, a fuzzy matching library. Fuse allows more flexible search by ranking matches based on relevance instead of string similarity distance. With this change, users no longer need to copy full or exact episode titles to find a match.

Fuse.js is added as a new dependency. It's licensed under Apache 2.0, which is compatible with the project’s GPLv3 license.

While this update is currently applied only to episode search, Fuse.js could potentially be reused in other areas of the app where improved search UX is desired.

How have you tested this?

  • Manually add podcast and download one episode
  • In edit dialog (Match tab) a try to search multiple episode names
  • Verified that relevant results are returned even with partial input

Screenshots


🔄 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/4383 **Author:** [@JKubovy](https://github.com/JKubovy) **Created:** 6/6/2025 **Status:** ✅ Merged **Merged:** 6/14/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `improve-podcast-episode-search` --- ### 📝 Commits (2) - [`eda7036`](https://github.com/advplyr/audiobookshelf/commit/eda7036f70c9a3a1cd699231c8ac9531368aee31) Use fuse.js for podcast episode search - [`6d0d141`](https://github.com/advplyr/audiobookshelf/commit/6d0d1415e44b7ec4fe75806332a398ffda368821) Add fuse.basic.min.js in libs instead of full npm package, use lower threshold for quick matching ### 📊 Changes **3 files changed** (+35 additions, -24 deletions) <details> <summary>View changed files</summary> ➕ `server/libs/fusejs/index.js` (+13 -0) 📝 `server/scanner/Scanner.js` (+1 -1) 📝 `server/utils/podcastUtils.js` (+21 -23) </details> ### 📄 Description Replace levenshtein distance with fuse.js fuzzy searching library. Search in episode's title and subtitle ## Brief summary This PR improves the manual podcast episode search by replacing the Levenshtein distance algorithm with [Fuse.js](https://github.com/krisk/fuse), a lightweight fuzzy search library. The result is a more intuitive and forgiving search experience when linking audio files to episodes. ## Which issue is fixed? Fixes #4382 ## In-depth Description Previously, episode search relied on Levenshtein distance, which often failed to return results when users searched using partial titles, numbers, or keywords — e.g., searching "212" for "Super Podcast - Episode 212 - How to start writing book". This PR replaces that logic with Fuse.js, a fuzzy matching library. Fuse allows more flexible search by ranking matches based on relevance instead of string similarity distance. With this change, users no longer need to copy full or exact episode titles to find a match. Fuse.js is added as a new dependency. It's licensed under Apache 2.0, which is compatible with the project’s GPLv3 license. While this update is currently applied only to episode search, Fuse.js could potentially be reused in other areas of the app where improved search UX is desired. ## How have you tested this? - Manually add podcast and download one episode - In edit dialog (Match tab) a try to search multiple episode names - Verified that relevant results are returned even with partial input ## Screenshots --- <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:55 +02:00
adam closed this issue 2026-04-25 00:18:55 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4232