adapted cache duration
This commit is contained in:
40
src/api.rs
40
src/api.rs
@@ -160,7 +160,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
if clientversion >= ClientVersion::new(22, 101, "22e".to_string()) {
|
if clientversion >= ClientVersion::new(22, 101, "22e".to_string()) {
|
||||||
// pmvhaven
|
// pmvhaven
|
||||||
@@ -235,7 +235,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if clientversion >= ClientVersion::new(22, 97, "22a".to_string()) {
|
if clientversion >= ClientVersion::new(22, 97, "22a".to_string()) {
|
||||||
@@ -306,7 +306,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: None,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
// status.add_channel(Channel {
|
// status.add_channel(Channel {
|
||||||
@@ -403,7 +403,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
// multiSelect: false,
|
// multiSelect: false,
|
||||||
// }],
|
// }],
|
||||||
// nsfw: true,
|
// nsfw: true,
|
||||||
//cacheDuration: 1800,
|
//cacheDuration: Some(1800),
|
||||||
// });
|
// });
|
||||||
|
|
||||||
status.add_channel(Channel {
|
status.add_channel(Channel {
|
||||||
@@ -445,7 +445,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
let files = fs::read_dir("./src/providers").unwrap();
|
let files = fs::read_dir("./src/providers").unwrap();
|
||||||
@@ -481,7 +481,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: true,
|
multiSelect: true,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Redtube
|
// Redtube
|
||||||
@@ -495,7 +495,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
categories: vec![],
|
categories: vec![],
|
||||||
options: vec![],
|
options: vec![],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// ok.porn
|
// ok.porn
|
||||||
@@ -530,7 +530,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// pornhat
|
// pornhat
|
||||||
@@ -565,7 +565,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
//perfectgirls
|
//perfectgirls
|
||||||
@@ -600,7 +600,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// okxxx
|
// okxxx
|
||||||
@@ -635,7 +635,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// homoxxx
|
// homoxxx
|
||||||
@@ -670,7 +670,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// // hentaimoon
|
// // hentaimoon
|
||||||
@@ -705,7 +705,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
// multiSelect: false,
|
// multiSelect: false,
|
||||||
// }],
|
// }],
|
||||||
// nsfw: true,
|
// nsfw: true,
|
||||||
// cacheDuration: 1800,
|
// cacheDuration: Some(1800),
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// xxthots
|
// xxthots
|
||||||
@@ -740,7 +740,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// porn00
|
// porn00
|
||||||
@@ -775,7 +775,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// freshporno
|
// freshporno
|
||||||
@@ -810,7 +810,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
}],
|
}],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
|
|
||||||
// porn00
|
// porn00
|
||||||
@@ -824,7 +824,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
// categories: vec![],
|
// categories: vec![],
|
||||||
// options: vec![],
|
// options: vec![],
|
||||||
// nsfw: true,
|
// nsfw: true,
|
||||||
// cacheDuration: 1800,
|
// cacheDuration: Some(1800),
|
||||||
// });
|
// });
|
||||||
|
|
||||||
//missav
|
//missav
|
||||||
@@ -957,7 +957,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
if clientversion >= ClientVersion::new(22, 105, "22i".to_string()) {
|
if clientversion >= ClientVersion::new(22, 105, "22i".to_string()) {
|
||||||
@@ -1021,7 +1021,7 @@ async fn status(req: HttpRequest) -> Result<impl web::Responder, web::Error> {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
nsfw: true,
|
nsfw: true,
|
||||||
cacheDuration: 1800,
|
cacheDuration: Some(1800),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
status.iconUrl = format!("http://{}/favicon.ico", host).to_string();
|
status.iconUrl = format!("http://{}/favicon.ico", host).to_string();
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ pub struct Channel {
|
|||||||
pub categories: Vec<String>, //[],
|
pub categories: Vec<String>, //[],
|
||||||
pub options: Vec<ChannelOption>,
|
pub options: Vec<ChannelOption>,
|
||||||
pub nsfw: bool, //true
|
pub nsfw: bool, //true
|
||||||
pub cacheDuration: u32, //Some(86400)
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub cacheDuration: Option<u32>, //Some(86400)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(serde::Serialize)]
|
#[derive(serde::Serialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user