Skip to content

Commit

Permalink
Merge pull request #2371 from dipu-bd/dev
Browse files Browse the repository at this point in the history
Version 3.7.0
  • Loading branch information
dipu-bd authored May 11, 2024
2 parents a76195d + f9b6200 commit d4ce59f
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 424 deletions.
800 changes: 400 additions & 400 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lncrawl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.0
3.7.0
65 changes: 45 additions & 20 deletions lncrawl/assets/web/script.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
// Handle key events
let keyPressTimer = null;
let navigationInterval = null;

function goToHref(el) {
if (!el) return;
const href = el.getAttribute("href");
if (href === "#") return;
window.location.href = href;
}

window.addEventListener("keyup", function (evt) {
function goToHref(el) {
if (!el) return;
const href = el.getAttribute("href");
if (href === "#") return;
window.location.href = href;
clearInterval(keyPressTimer);
clearInterval(navigationInterval);
switch (evt.key) {
case "ArrowLeft":
goToHref(document.querySelector("a.prev-button"));
break;
case "ArrowRight":
goToHref(document.querySelector("a.next-button"));
break;
default:
break;
}
});


switch (evt.key) {
case "ArrowLeft":
goToHref(document.querySelector("a.prev-button"));
break;
case "ArrowRight":
goToHref(document.querySelector("a.next-button"));
break;
default:
break;
}
});
window.addEventListener("keydown", function (evt) {
clearInterval(keyPressTimer);
clearInterval(navigationInterval);
switch (evt.key) {
case "ArrowLeft":
keyPressTimer = setTimeout(() => {
navigationInterval = setInterval(() => {
goToHref(document.querySelector("a.prev-button"));
}, 50);
}, 450);
break;
case "ArrowRight":
keyPressTimer = setTimeout(() => {
navigationInterval = setInterval(() => {
goToHref(document.querySelector("a.next-button"));
}, 50);
}, 450);
break;
default:
break;
}
});

// Handle next TOC select
function addTocSelectListener() {
Expand All @@ -38,10 +64,9 @@ function debouncedUpdate(evt) {
var height = document.body.scrollHeight - window.innerHeight + 10;
var percent = Math.round((100.0 * scroll) / height);
document.getElementById("readpos").innerText = percent + "%";
}, 100); // 100ms delay
}, 100); // 100ms delay
}


window.addEventListener("scroll", debouncedUpdate);

window.addEventListener("load", function (evt) {
Expand Down
8 changes: 7 additions & 1 deletion lncrawl/core/novel_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from concurrent.futures import Future
from slugify import slugify
import difflib

from ..models import CombinedSearchResult, SearchResult
from .sources import crawler_list, prepare_crawler
Expand Down Expand Up @@ -101,5 +102,10 @@ def search_novels(app):
novels=value,
)
)
processed.sort(key=lambda x: -len(x.novels))
processed.sort(
key=lambda x: (
-len(x.novels),
-difflib.SequenceMatcher(None, x.title, app.user_input).ratio(),
)
)
app.search_results = processed[:MAX_RESULTS]
2 changes: 1 addition & 1 deletion sources/_index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sources/zh/ddxsss.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class DdxSss(Crawler):
base_url = [
"https://www.ddxsss.com/",
"https://www.ddxss.cc/",
]
# custom banned text as it's all loose and the cleaner deletes the whole chapter if used in bad_text_*
banned_text = [
Expand Down

0 comments on commit d4ce59f

Please sign in to comment.