javtiful fix

This commit is contained in:
Simon
2026-05-02 14:11:06 +00:00
parent 6a4fc98720
commit e4d409fe1f
2 changed files with 19 additions and 53 deletions

View File

@@ -81,20 +81,16 @@ impl JavtifulProvider {
colorName: "blue".to_string(),
options: vec![
FilterOption {
id: "newest".into(),
title: "Newest".into(),
id: "relevance".into(),
title: "Relevance".into(),
},
FilterOption {
id: "top rated".into(),
title: "Top Rated".into(),
id: "latest".into(),
title: "Latest".into(),
},
FilterOption {
id: "most viewed".into(),
title: "Most Viewed".into(),
},
FilterOption {
id: "top favorites".into(),
title: "Top Favorites".into(),
id: "popular".into(),
title: "Popular".into(),
},
],
multiSelect: false,
@@ -120,8 +116,8 @@ impl JavtifulProvider {
options: ServerOptions,
) -> Result<Vec<VideoItem>> {
let sort_string = match sort {
"top rated" => "/sort=top_rated",
"most viewed" => "/sort=most_viewed",
"latest" => "sort=latest&",
"popular" => "sort=popular&",
_ => "",
};
let video_url = format!("{}/videos{}?page={}", self.url, sort_string, page);
@@ -180,12 +176,12 @@ impl JavtifulProvider {
options: ServerOptions,
) -> Result<Vec<VideoItem>> {
let sort_string = match options.sort.as_deref().unwrap_or("") {
"top rated" => "/sort=top_rated",
"most viewed" => "/sort=most_viewed",
"latest" => "sort=latest&",
"popular" => "sort=popular&",
_ => "",
};
let video_url = format!(
"{}/search/videos{}?search_query={}&page={}",
"{}/search?{}q={}&page={}",
self.url,
sort_string,
query.replace(" ", "+"),