|
@@ -28,7 +28,6 @@ pub async fn get_directory(
|
|
state.base_path.clone()
|
|
state.base_path.clone()
|
|
} else {
|
|
} else {
|
|
let path = urlencoding::decode(path)?;
|
|
let path = urlencoding::decode(path)?;
|
|
- let path = &path[1..];
|
|
|
|
format!("{}/{path}", state.base_path)
|
|
format!("{}/{path}", state.base_path)
|
|
};
|
|
};
|
|
|
|
|
|
@@ -45,7 +44,7 @@ pub async fn get_directory(
|
|
let Some((_, path)) = dir.path.split_once(&state.base_path) else {
|
|
let Some((_, path)) = dir.path.split_once(&state.base_path) else {
|
|
return acc;
|
|
return acc;
|
|
};
|
|
};
|
|
- dir.path = path.to_string();
|
|
|
|
|
|
+ dir.path = path[1..].to_string();
|
|
let dir: DirHtmx = dir.into();
|
|
let dir: DirHtmx = dir.into();
|
|
let _ = write!(acc, "{}", dir.to_htmx());
|
|
let _ = write!(acc, "{}", dir.to_htmx());
|
|
}
|
|
}
|
|
@@ -53,7 +52,7 @@ pub async fn get_directory(
|
|
let Some((_, path)) = file.path.split_once(&state.base_path) else {
|
|
let Some((_, path)) = file.path.split_once(&state.base_path) else {
|
|
return acc;
|
|
return acc;
|
|
};
|
|
};
|
|
- file.path = path.to_string();
|
|
|
|
|
|
+ file.path = path[1..].to_string();
|
|
let file = FileHtmx::new(i, file);
|
|
let file = FileHtmx::new(i, file);
|
|
let _ = write!(acc, "{}", file.to_htmx());
|
|
let _ = write!(acc, "{}", file.to_htmx());
|
|
}
|
|
}
|
|
@@ -85,7 +84,7 @@ pub async fn search_subtitles(
|
|
state: axum::extract::State<State>,
|
|
state: axum::extract::State<State>,
|
|
query: axum::extract::Query<SubtitleSearch>,
|
|
query: axum::extract::Query<SubtitleSearch>,
|
|
) -> Result<String, NtitledError> {
|
|
) -> Result<String, NtitledError> {
|
|
- let path = format!("{}{}", state.base_path, &query.path);
|
|
|
|
|
|
+ let path = format!("{}/{}", state.base_path, &query.path);
|
|
|
|
|
|
info!("Computing hash for {}", &path);
|
|
info!("Computing hash for {}", &path);
|
|
|
|
|