Upping version.
This commit is contained in:
parent
6c9210db42
commit
5f4d6b4493
|
@ -2,7 +2,7 @@ version: '3.7'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
torrents-csv:
|
torrents-csv:
|
||||||
image: dessalines/torrents-csv:v0.0.7.7
|
image: dessalines/torrents-csv:v0.0.7.8
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8902:8080"
|
- "8902:8080"
|
||||||
|
|
|
@ -22,6 +22,8 @@ use std::cmp;
|
||||||
use std::io;
|
use std::io;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
|
const DEFAULT_SIZE: usize = 25;
|
||||||
|
|
||||||
#[actix_rt::main]
|
#[actix_rt::main]
|
||||||
async fn main() -> io::Result<()> {
|
async fn main() -> io::Result<()> {
|
||||||
println!("Access me at {}", endpoint());
|
println!("Access me at {}", endpoint());
|
||||||
|
@ -124,7 +126,7 @@ fn search_query(
|
||||||
}
|
}
|
||||||
|
|
||||||
let page = query.page.unwrap_or(1);
|
let page = query.page.unwrap_or(1);
|
||||||
let size = cmp::min(100, query.size.unwrap_or(10));
|
let size = cmp::min(100, query.size.unwrap_or(DEFAULT_SIZE));
|
||||||
let type_ = query.type_.as_ref().map_or("torrent", String::deref);
|
let type_ = query.type_.as_ref().map_or("torrent", String::deref);
|
||||||
let offset = size * (page - 1);
|
let offset = size * (page - 1);
|
||||||
|
|
||||||
|
@ -150,7 +152,7 @@ fn new_query(
|
||||||
) -> Result<Value, Error> {
|
) -> Result<Value, Error> {
|
||||||
|
|
||||||
let page = query.page.unwrap_or(1);
|
let page = query.page.unwrap_or(1);
|
||||||
let size = cmp::min(100, query.size.unwrap_or(10));
|
let size = cmp::min(100, query.size.unwrap_or(DEFAULT_SIZE));
|
||||||
let type_ = query.type_.as_ref().map_or("torrent", String::deref);
|
let type_ = query.type_.as_ref().map_or("torrent", String::deref);
|
||||||
let offset = size * (page - 1);
|
let offset = size * (page - 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue