Fix recursive search at the root, cleanup video generation return

This commit is contained in:
Cameron
2024-12-06 09:47:21 -05:00
parent 8bc9c5585e
commit 787d1fd5d0
2 changed files with 20 additions and 6 deletions

View File

@@ -156,12 +156,16 @@ impl Handler<ScanDirectoryMessage> for VideoPlaylistManager {
.await
.expect("Failed to send generate playlist message")
{
Ok(_) => {}
Ok(_) => {
debug!(
"Successfully generated playlist for file: '{}'",
path_as_str
);
}
Err(e) => {
warn!("Failed to generate playlist for path '{:?}'. {:?}", path, e);
}
}
// .expect("Failed to generate video playlist");
}
info!(
@@ -180,7 +184,7 @@ pub struct ScanDirectoryMessage {
}
#[derive(Message)]
#[rtype(result = "Result<String>")]
#[rtype(result = "Result<()>")]
struct GeneratePlaylistMessage {
video_path: PathBuf,
playlist_path: String,
@@ -203,7 +207,7 @@ impl Actor for PlaylistGenerator {
}
impl Handler<GeneratePlaylistMessage> for PlaylistGenerator {
type Result = ResponseFuture<Result<String>>;
type Result = ResponseFuture<Result<()>>;
fn handle(&mut self, msg: GeneratePlaylistMessage, _ctx: &mut Self::Context) -> Self::Result {
let video_file = msg.video_path.to_str().unwrap().to_owned();
@@ -266,7 +270,7 @@ impl Handler<GeneratePlaylistMessage> for PlaylistGenerator {
ffmpeg_result
});
Ok("meeee".to_string())
Ok(())
})
}
}