Skip to content

Commit

Permalink
more verbose check for valid files in findsong
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacherr committed Oct 30, 2024
1 parent ec05eaf commit 16df4b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ anyhow = "1.0.75"
serde = { version = "1.0.123", features = ["derive"] }
tokio = { version = "1.34.0", features = ["full"] }
tracing = "0.1.37"
twilight-gateway = { git = "https://github.com/twilight-rs/twilight", branch = "erk/user-apps" }
twilight-http = { git = "https://github.com/twilight-rs/twilight", branch = "erk/user-apps", features = [
twilight-gateway = { git = "https://github.com/twilight-rs/twilight" }
twilight-http = { git = "https://github.com/twilight-rs/twilight", features = [
"rustls-ring",
] }
twilight-model = { git = "https://github.com/twilight-rs/twilight", branch = "erk/user-apps" }
twilight-util = { git = "https://github.com/twilight-rs/twilight", branch = "erk/user-apps", features = [
twilight-model = { git = "https://github.com/twilight-rs/twilight" }
twilight-util = { git = "https://github.com/twilight-rs/twilight", features = [
"builder",
] }
4 changes: 2 additions & 2 deletions assyst-core/src/command/fun/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pub mod translation;
context_menu_message_command = "Find Song"
)]
pub async fn findsong(ctxt: CommandCtxt<'_>, audio: ImageUrl) -> anyhow::Result<()> {
const VALID_FILES: &[&str] = &["mp3", "mp4", "webm", "ogg", "wav"];
const VALID_FILES: &[&str] = &[".mp3", ".mp4", ".webm", ".ogg", ".wav", ".mov", ".mkv"];

if VALID_FILES.iter().all(|x| !audio.0.ends_with(x)) {
if VALID_FILES.iter().all(|x| !audio.0.contains(x)) {
bail!("Finding audio is only supported on audio and video files.");
}

Expand Down

0 comments on commit 16df4b9

Please sign in to comment.