This commit is contained in:
2024-02-14 15:53:14 +01:00
parent c53b2bba49
commit 96f5e4e063
4 changed files with 33 additions and 2 deletions

18
.drone.yml Normal file
View File

@@ -0,0 +1,18 @@
kind: pipeline
type: docker
name: default
steps:
- name: pre-commit
image: iamthefij/drone-pre-commit:latest
commands:
- apt-get update && apt-get install -y cmake
- curl https://sh.rustup.rs -sSf | bash -s -- -y
- export PATH="/root/.cargo/bin:$${PATH}"
- pre-commit run --all-files
- name: test
image: rust:latest
commands:
- apt-get update && apt-get install -y cmake
- cargo build --verbose --all
- cargo test --verbose --all

13
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check

View File

@@ -19,4 +19,4 @@ twilight-http = "0.15"
twilight-model = "0.15"
twilight-standby = "0.15"
twilight-cache-inmemory = "0.15"
dotenv = "0.15.0"
dotenv = "0.15.0"

View File

@@ -192,7 +192,7 @@ async fn play(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
let mut src = YoutubeDl::new(reqwest::Client::new(), url);
if let Ok(metadata) = src.aux_metadata().await {
info!("metadata: {:?}", metadata);
let content = format!(
"Playing **{:?}** by **{:?}**",
metadata.title.as_ref().unwrap_or(&"<UNKNOWN>".to_string()),