Implement chapter merging feature and update ranking algorithm

Added automatic chapter merging to M4B with admin/config toggles, UI controls, and backend logic. Updated documentation to reflect implementation. Refactored ranking algorithm: increased Title/Author match points, removed size scoring, and improved Usenet/torrent handling. Enhanced Prowlarr integration for protocol detection and filtering. Improved file organizer to support chapter merging. Various bug fixes and logging improvements.
This commit is contained in:
kikootwo
2026-01-08 16:26:26 -05:00
parent 722a78ac33
commit 288421012d
21 changed files with 922 additions and 128 deletions
+19 -4
View File
@@ -344,11 +344,18 @@ async function searchByAsin(
const html = await fetchHtml(searchUrl, flaresolverrUrl, logger);
const $ = cheerio.load(html);
// Exclude MD5 links from "Recent downloads" banner (they're in .js-recent-downloads-container)
// Exclude MD5 links from "Recent downloads" banner and "Partial matches" section
// Only look for actual search result links
const searchResultLinks = $('a[href*="/md5/"]').filter((i, elem) => {
// Exclude links inside the recent downloads banner
return $(elem).closest('.js-recent-downloads-container').length === 0;
if ($(elem).closest('.js-recent-downloads-container').length > 0) {
return false;
}
// Exclude links inside the partial matches section
if ($(elem).closest('.js-partial-matches-show').length > 0) {
return false;
}
return true;
});
if (DEBUG_ENABLED) {
@@ -451,9 +458,17 @@ async function searchByTitle(
const html = await fetchHtml(searchUrl, flaresolverrUrl, logger);
const $ = cheerio.load(html);
// Exclude MD5 links from "Recent downloads" banner (they're in .js-recent-downloads-container)
// Exclude MD5 links from "Recent downloads" banner and "Partial matches" section
const searchResultLinks = $('a[href*="/md5/"]').filter((i, elem) => {
return $(elem).closest('.js-recent-downloads-container').length === 0;
// Exclude links inside the recent downloads banner
if ($(elem).closest('.js-recent-downloads-container').length > 0) {
return false;
}
// Exclude links inside the partial matches section
if ($(elem).closest('.js-partial-matches-show').length > 0) {
return false;
}
return true;
});
if (DEBUG_ENABLED) {