Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ddboline committed Sep 15, 2023
1 parent 64d8445 commit 8f2d81e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion movie_collection_http/src/movie_queue_elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,13 @@ fn movie_queue_element(
}
};

let offset = offset.unwrap_or(0);
let order_by = order_by.unwrap_or(OrderBy::Desc);
let remove_button = rsx! {
button {
"type": "submit",
id: "{file_name}",
"onclick": "delete_show('{file_name}');",
"onclick": "delete_show('{file_name}', {offset}, '{order_by}');",
"remove",
}
};
Expand Down
16 changes: 14 additions & 2 deletions movie_collection_http/src/movie_queue_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,26 @@ pub async fn movie_queue_delete(
let mock_stdout = MockStdout::new();
let stdout = StdoutChannel::with_mock_stdout(mock_stdout.clone(), mock_stdout.clone());

if path::Path::new(path.as_str()).exists() {
let collection = MovieCollection::new(&state.config, &state.db, &stdout);

let mut output = StackString::new();
if path::Path::new(path.as_str()).exists()
|| collection
.get_collection_index(&path)
.await
.map_err(Into::<Error>::into)?
.is_some()
{
MovieQueueDB::new(&state.config, &state.db, &stdout)
.remove_from_queue_by_path(&path)
.await
.map_err(Into::<Error>::into)?;
write!(&mut output, "success {path}").map_err(Into::<Error>::into)?;
} else {
write!(&mut output, "failure").map_err(Into::<Error>::into)?;
}
task.await.ok();
Ok(HtmlBase::new(path).into())
Ok(HtmlBase::new(output).into())
}

async fn transcode_worker(
Expand Down

0 comments on commit 8f2d81e

Please sign in to comment.