Compare commits
2 Commits
e87a2ed237
...
578ac3e034
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
578ac3e034 | ||
|
|
f4f22572c1 |
@@ -26,7 +26,7 @@ RUN apt install -yq libssl-dev \
|
|||||||
fluxbox \
|
fluxbox \
|
||||||
xvfb \
|
xvfb \
|
||||||
gnome-screenshot \
|
gnome-screenshot \
|
||||||
libsqlite3-dev sqlite3 \
|
libsqlite3-dev sqlite3 sqlitebrowser \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -198,8 +198,14 @@ impl HanimeProvider {
|
|||||||
|
|
||||||
async fn get(&self, cache: VideoCache, pool: DbPool, page: u8, query: String, sort:String) -> Result<Vec<VideoItem>> {
|
async fn get(&self, cache: VideoCache, pool: DbPool, page: u8, query: String, sort:String) -> Result<Vec<VideoItem>> {
|
||||||
let index = format!("{}:{}:{}", query, page, sort);
|
let index = format!("{}:{}:{}", query, page, sort);
|
||||||
let order_by = sort.split(".").collect::<Vec<&str>>()[0].to_string();
|
let order_by = match sort.contains("."){
|
||||||
let ordering = sort.split(".").collect::<Vec<&str>>()[1].to_string();
|
true => sort.split(".").collect::<Vec<&str>>()[0].to_string(),
|
||||||
|
false => "created_at_unix".to_string(),
|
||||||
|
};
|
||||||
|
let ordering = match sort.contains("."){
|
||||||
|
true => sort.split(".").collect::<Vec<&str>>()[1].to_string(),
|
||||||
|
false => "desc".to_string(),
|
||||||
|
};
|
||||||
let old_items = match cache.get(&index) {
|
let old_items = match cache.get(&index) {
|
||||||
Some((time, items)) => {
|
Some((time, items)) => {
|
||||||
if time.elapsed().unwrap_or_default().as_secs() < 60 * 60 * 12 {
|
if time.elapsed().unwrap_or_default().as_secs() < 60 * 60 * 12 {
|
||||||
|
|||||||
Reference in New Issue
Block a user