Upping version.

This commit is contained in:
Dessalines 2020-06-21 16:20:20 -04:00
parent 6c9210db42
commit 5f4d6b4493
2 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,7 @@ version: '3.7'
services:
torrents-csv:
image: dessalines/torrents-csv:v0.0.7.7
image: dessalines/torrents-csv:v0.0.7.8
restart: always
ports:
- "8902:8080"

View File

@ -22,6 +22,8 @@ use std::cmp;
use std::io;
use serde_json::Value;
const DEFAULT_SIZE: usize = 25;
#[actix_rt::main]
async fn main() -> io::Result<()> {
println!("Access me at {}", endpoint());
@ -124,7 +126,7 @@ fn search_query(
}
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 offset = size * (page - 1);
@ -150,7 +152,7 @@ fn new_query(
) -> Result<Value, Error> {
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 offset = size * (page - 1);