fn img_list(comic: String) -> Json {
    let mut path = CONFIG.img_folder.clone();
    path.push(comic);
    let mut files = fs::read_dir(path)
        .unwrap()
        .filter_map(|el| Some(el.ok()?.file_name().to_string_lossy().into_owned()))
        .collect::<Vec<_>>();
    files.sort_by(|a, b| smart_cmp::smart_cmp(a, b));
    let mut response = serde_json::json!({
        "pages": files,
    });
    if let Some(mirror_url) = CONFIG.mirror.as_ref() {
        response["mirror"] = serde_json::Value::from(&**mirror_url);
    };
    warp::reply::json(&response)
}
// Endpoint for getting a list of all of the pages for a comic.
Endpoint for getting a list of all of the pages for a comic.
Endpoint for getting a list of all of the pages for a comic .
fn img_list(comic: String) -> Json {
    let mut path = CONFIG.img_folder.clone();
    path.push(comic);
    let mut files = fs::read_dir(path)
        .unwrap()
        .filter_map(|el| Some(el.ok()?.file_name().to_string_lossy().into_owned()))
        .collect::<Vec<_>>();
    files.sort_by(|a, b| smart_cmp::smart_cmp(a, b));
    let mut response = serde_json::json!({
        "pages": files,
    });
    if let Some(mirror_url) = CONFIG.mirror.as_ref() {
        response["mirror"] = serde_json::Value::from(&**mirror_url);
    };
    warp::reply::json(&response)
}
fn img_list ( comic : String ) -> Json { let mut path = CONFIG . img_folder . clone ( ) ; path . push ( comic ) ; let mut files = fs :: read_dir ( path ) . unwrap ( ) . filter_map ( | el | Some ( el . ok ( ) ? . file_name ( ) . to_string_lossy ( ) . into_owned ( ) ) ) . collect :: < Vec < _ > > ( ) ; files . sort_by ( | a , b | smart_cmp :: smart_cmp ( a , b ) ) ; let mut response = serde_json :: json ! ( { " " files } ) ; if let Some ( mirror_url ) = CONFIG . mirror . as_ref ( ) { response [ " " ] = serde_json :: Value :: from ( & * * mirror_url ) ; } ; warp :: reply :: json ( & response ) }
Endpoint for getting a list of all of the pages for a comic.
Endpoint for getting a list of all of the pages for a comic .
comic
String
comic
String