now safes the cookies for the requester
This commit is contained in:
@@ -16,6 +16,7 @@ use crate::providers::redtube::RedtubeProvider;
|
||||
use crate::providers::rule34video::Rule34videoProvider;
|
||||
use crate::providers::spankbang::SpankbangProvider;
|
||||
use crate::util::cache::VideoCache;
|
||||
use crate::util::requester::Requester;
|
||||
use crate::{db, providers::*, status::*, videos::*, DbPool};
|
||||
use cute::c;
|
||||
|
||||
@@ -862,8 +863,9 @@ async fn videos_post(
|
||||
video_request: web::types::Json<VideosRequest>,
|
||||
cache: web::types::State<VideoCache>,
|
||||
pool: web::types::State<DbPool>,
|
||||
requester: web::types::State<Requester>,
|
||||
) -> Result<impl web::Responder, web::Error> {
|
||||
|
||||
let requester = requester.get_ref().clone();
|
||||
let mut conn = pool.get().expect("couldn't get db connection from pool");
|
||||
// Ensure "videos" table exists with two string columns
|
||||
if !(db::has_table(&mut conn, "videos").unwrap()){
|
||||
@@ -928,7 +930,7 @@ async fn videos_post(
|
||||
.as_deref()
|
||||
.unwrap_or("en")
|
||||
.to_string();
|
||||
let options = ServerOptions { featured: Some(featured), category: Some(category), sites: Some(sites), filter: Some(filter), language: Some(language) };
|
||||
let options = ServerOptions { featured: Some(featured), category: Some(category), sites: Some(sites), filter: Some(filter), language: Some(language), requester: Some(requester) };
|
||||
let video_items = provider
|
||||
.get_videos(
|
||||
cache.get_ref().clone(),
|
||||
|
||||
Reference in New Issue
Block a user