Skip to content

Commit

Permalink
fix(komga): non-english search not working (#782)
Browse files Browse the repository at this point in the history
Close #659
  • Loading branch information
dyphire authored Nov 8, 2024
1 parent 38ee875 commit 60a7f4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/rust/multi.komga/res/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "multi.komga",
"lang": "multi",
"name": "Komga",
"version": 2,
"version": 3,
"url": "https://komga.org",
"nsfw": 0
},
Expand Down
9 changes: 4 additions & 5 deletions src/rust/multi.komga/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod dto;
extern crate alloc;
use aidoku::{
error::{AidokuError, AidokuErrorKind, Result},
helpers::uri::{encode_uri, encode_uri_component},
helpers::uri::encode_uri,
prelude::*,
std::{defaults::defaults_get, net::Request, String, StringRef, Vec},
Chapter, Filter, FilterType, Listing, Manga, MangaPageResult, Page,
Expand Down Expand Up @@ -69,18 +69,17 @@ fn get_manga_list(filters: Vec<Filter>, page: i32) -> Result<MangaPageResult> {
let title = title.read();
if title.starts_with("regex:") {
url.push_str("&search_regex=");
url.push_str(&encode_uri_component(
title
url.push_str(title
.strip_prefix("regex:")
.map(|v| v.trim())
.unwrap_or_default(),
));
);
if !title.contains(",TITLE") && !title.contains(",TITLE_SORT") {
url.push_str(",TITLE");
}
} else {
url.push_str("&search=");
url.push_str(&encode_uri_component(title));
url.push_str(&title);
}
}
}
Expand Down

0 comments on commit 60a7f4d

Please sign in to comment.