fix
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2024-12-12 20:28:11 +01:00
parent 4d32422bd6
commit ce9351d9a6
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 574 additions and 271 deletions

View file

@ -12,6 +12,7 @@ use std::path::PathBuf;
pub struct YouTubeMeta {
pub id: String,
pub title: String,
pub description: String,
pub uploader_name: String,
pub uploader_id: String,
pub views: i64,
@ -70,6 +71,13 @@ impl Video {
.unwrap()
}
pub async fn youtube_meta(&self) -> Option<YouTubeMeta> {
if let Some(meta) = self.youtube_id.as_ref().map(|id| YouTubeMeta::get(id)) {
return meta.await;
}
None
}
pub async fn has_path(path: &str) -> bool {
sqlx::query("SELECT id FROM videos WHERE path = $1")
.bind(path)