Compare commits

...
3 Commits
Author SHA1 Message Date
phoenix 41481effe3 Updating license year
pr CI / Test Suite (pull_request) Successful in 2m48s
2026-08-13 14:17:16 -04:00
phoenix 49da44b5e4 bump: soaricarus_api 2026-08-13 14:17:06 -04:00
phoenix b786a8c616 Oooooh yeah 2026-08-13 14:16:13 -04:00
5 changed files with 5 additions and 66 deletions
Generated
+1 -1
View File
@@ -3022,7 +3022,7 @@ dependencies = [
[[package]]
name = "soaricarus_api"
version = "0.5.3"
version = "0.5.4"
dependencies = [
"axum",
"axum-extra",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "soaricarus_api"
version = "0.5.3"
version = "0.5.4"
edition = "2024"
rust-version = "1.95"
license = "MIT"
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2025 Kun Deng
Copyright (c) 2026 Kun Deng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+2 -13
View File
@@ -160,7 +160,6 @@ pub mod endpoint {
match super::is_song_valid(&raw_data).await {
Ok(valid) => {
if valid {
println!("Go");
match repo::song::insert(
&pool,
&file_name,
@@ -179,23 +178,13 @@ pub mod endpoint {
raw_data: copied_raw_data,
..Default::default()
};
/*
let filename = simodels::song::generate_filename(
simodels::types::MusicType::FlacExtension,
true,
)
.unwrap();
*/
println!("Filename: {file_name:?}");
let file_path = format!("queued/song/{file_name}");
println!("Path: {file_path:?}");
match lr.upload(&file_path, &data).await {
Ok(res) => {
println!("Result: {res:?}");
println!("Saving to db");
Ok(_res) => {
match repo::data::insert(
&pool,
&file_path,
-50
View File
@@ -251,53 +251,3 @@ pub async fn get_song_queue(
Err(_err) => Err(sqlx::Error::RowNotFound),
}
}
/*
pub async fn wipe_data(pool: &sqlx::PgPool, id: &uuid::Uuid) -> Result<uuid::Uuid, sqlx::Error> {
let result = sqlx::query(
r#"
UPDATE "songQueue" SET data = NULL WHERE id = $1 RETURNING id;
"#,
)
.bind(id)
.fetch_one(pool)
.await
.map_err(|e| {
eprintln!("Error updating record: {e}");
});
match result {
Ok(row) => Ok(row
.try_get("id")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap()),
Err(_) => Err(sqlx::Error::RowNotFound),
}
}
pub async fn get_data(pool: &sqlx::PgPool, id: &uuid::Uuid) -> Result<Vec<u8>, sqlx::Error> {
let result = sqlx::query(
r#"
SELECT data FROM "songQueue"
WHERE id = $1;
"#,
)
.bind(id)
.fetch_one(pool)
.await
.map_err(|e| {
eprintln!("Error inserting: {e}");
});
match result {
Ok(row) => {
let data = row
.try_get("data")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap();
Ok(data)
}
Err(_err) => Err(sqlx::Error::RowNotFound),
}
}
*/