testing and fixing

This commit is contained in:
Simon
2025-08-09 12:21:43 +00:00
parent 6b4b0be522
commit 3feeb02251
12 changed files with 204 additions and 96 deletions

View File

@@ -357,40 +357,39 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
}],
nsfw: true,
});
status.add_channel(Channel {
id: "spankbang".to_string(),
name: "SpankBang".to_string(),
description: "Popular Porn Videos - SpankBang".to_string(),
premium: false,
favicon: "https://www.google.com/s2/favicons?sz=64&domain=spankbang.com".to_string(),
status: "active".to_string(),
categories: vec![],
options: vec![ChannelOption {
id: "sort".to_string(),
title: "Sort".to_string(),
description: "Sort the Videos".to_string(), //"Sort the videos by Date or Name.".to_string(),
systemImage: "list.number".to_string(),
colorName: "blue".to_string(),
options: vec![
FilterOption {
id: "trending_videos".to_string(),
title: "Trending".to_string(),
},
FilterOption {
id: "new_videos".to_string(),
title: "New".to_string(),
},
FilterOption {
id: "most_popular".to_string(),
title: "Popular".to_string(),
},
],
multiSelect: false,
}],
nsfw: true,
});
// status.add_channel(Channel {
// id: "spankbang".to_string(),
// name: "SpankBang".to_string(),
// description: "Popular Porn Videos - SpankBang".to_string(),
// premium: false,
// favicon: "https://www.google.com/s2/favicons?sz=64&domain=spankbang.com".to_string(),
// status: "active".to_string(),
// categories: vec![],
// options: vec![ChannelOption {
// id: "sort".to_string(),
// title: "Sort".to_string(),
// description: "Sort the Videos".to_string(), //"Sort the videos by Date or Name.".to_string(),
// systemImage: "list.number".to_string(),
// colorName: "blue".to_string(),
// options: vec![
// FilterOption {
// id: "trending_videos".to_string(),
// title: "Trending".to_string(),
// },
// FilterOption {
// id: "new_videos".to_string(),
// title: "New".to_string(),
// },
// FilterOption {
// id: "most_popular".to_string(),
// title: "Popular".to_string(),
// },
// ],
// multiSelect: false,
// }],
// nsfw: true,
// });
// pronhub
status.add_channel(Channel {
id: "rule34video".to_string(),
name: "Rule34Video".to_string(),
@@ -431,6 +430,52 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
}],
nsfw: true,
});
status.add_channel(Channel {
id: "all".to_string(),
name: "All".to_string(),
description: "Query from all sites of this Server".to_string(),
premium: false,
favicon: "https://hottub.spacemoehre.de/favicon".to_string(),
status: "active".to_string(),
categories: vec![],
options: vec![ChannelOption {
id: "sites".to_string(),
title: "Sites".to_string(),
description: "What Sites to use".to_string(), //"Sort the videos by Date or Name.".to_string(),
systemImage: "list.number".to_string(),
colorName: "green".to_string(),
options: vec![
FilterOption {
id: "hanime".to_string(),
title: "Hanime".to_string(),
},
FilterOption {
id: "perverzija".to_string(),
title: "Perverzija".to_string(),
},
FilterOption {
id: "pmvhaven".to_string(),
title: "PMVHaven".to_string(),
},
FilterOption {
id: "pornhub".to_string(),
title: "Pornhub".to_string(),
},
FilterOption {
id: "redtube".to_string(),
title: "Redtube".to_string(),
},
FilterOption {
id: "rule34video".to_string(),
title: "Rule34Video".to_string(),
},
],
multiSelect: true,
}],
nsfw: true,
});
status.add_channel(Channel {
id: "redtube".to_string(),
name: "Redtube".to_string(),
@@ -494,7 +539,12 @@ async fn videos_post(
.as_deref()
.unwrap_or("all")
.to_string();
let sites = video_request
.sites
.as_deref()
.unwrap_or("")
.to_string();
let options = ServerOptions { featured: Some(featured), category: Some(category), sites: Some(sites) };
let video_items = provider
.get_videos(
cache.get_ref().clone(),
@@ -504,8 +554,7 @@ async fn videos_post(
query.clone(),
page.to_string(),
perPage.to_string(),
featured.clone(),
category.clone(),
options.clone()
)
.await;
videos.items = video_items.clone();
@@ -524,8 +573,7 @@ async fn videos_post(
let sort_clone = sort.clone();
let query_clone = query.clone();
let per_page_clone = perPage.to_string();
let featured_clone = featured.clone();
let category_clone = category.clone();
let options_clone = options.clone();
task::spawn_local(async move {
// if let AnyProvider::Spankbang(_) = provider_clone {
// // Spankbang has a delay for the next page
@@ -540,8 +588,7 @@ async fn videos_post(
query_clone,
next_page.to_string(),
per_page_clone,
featured_clone,
category_clone,
options_clone
)
.await;
});