Compare commits

..
8 Commits
Author SHA1 Message Date
phoenix 57eaf61254 Let it go
pr CI / Test Suite (pull_request) Failing after 3m34s
2026-08-14 16:13:34 -04:00
phoenix 2ec2e2471c sql fix 2026-08-14 16:13:15 -04:00
phoenix aea8b14e14 Saving changes
pr CI / Test Suite (pull_request) Failing after 2m2s
2026-08-14 11:55:19 -04:00
phoenix b3055a2521 Changed it
pr CI / Test Suite (pull_request) Failing after 3m23s
2026-08-14 10:17:36 -04:00
phoenix d20bc830f3 Go
pr CI / Test Suite (pull_request) Failing after 2m30s
2026-08-14 10:12:03 -04:00
phoenix ffe293d955 Adding code for saving to bucket
pr CI / Test Suite (pull_request) Failing after 2m50s
2026-08-14 09:33:57 -04:00
phoenix c88c8fe74b bump: simodels 2026-08-14 09:33:35 -04:00
phoenix 5b292a021c Added migrations 2026-08-14 09:33:28 -04:00
10 changed files with 375 additions and 382 deletions
Generated
+236 -249
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "soaricarus_api" name = "soaricarus_api"
version = "0.5.7" version = "0.5.5"
edition = "2024" edition = "2024"
rust-version = "1.95" rust-version = "1.95"
license = "MIT" license = "MIT"
@@ -10,26 +10,26 @@ description = "Core API for interacting with soaricarus"
axum = { version = "0.8.9", features = ["multipart"] } axum = { version = "0.8.9", features = ["multipart"] }
axum-extra = { version = "0.12.6", features = ["cookie"] } axum-extra = { version = "0.12.6", features = ["cookie"] }
openssl = { version = "0.10.81", features = ["vendored"] } openssl = { version = "0.10.81", features = ["vendored"] }
serde = { version = "1.0.229", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.151" } serde_json = { version = "1.0.150" }
tokio = { version = "1.53.1", features = ["full"] } tokio = { version = "1.52.3", features = ["full"] }
tokio-util = { version = "0.7.19", features = ["io"] } tokio-util = { version = "0.7.18", features = ["io"] }
tower = { version = "0.5.3", features = ["full"] } tower = { version = "0.5.3", features = ["full"] }
tower-http = { version = "0.7.0", features = ["cors", "timeout"] } tower-http = { version = "0.7.0", features = ["cors", "timeout"] }
tracing-subscriber = "0.3.23" tracing-subscriber = "0.3.23"
futures = { version = "0.3.34" } futures = { version = "0.3.32" }
mime_guess = { version = "2.0.5" } mime_guess = { version = "2.0.5" }
uuid = { version = "1.24.1", features = ["v4", "serde"] } uuid = { version = "1.23.5", features = ["v4", "serde"] }
sqlx = { version = "0.9.0", features = ["postgres", "runtime-tokio", "tls-native-tls", "time", "uuid"] } sqlx = { version = "0.9.0", features = ["postgres", "runtime-tokio", "tls-native-tls", "time", "uuid"] }
time = { version = "0.3.55", features = ["formatting", "macros", "parsing", "serde"] } time = { version = "0.3.53", features = ["formatting", "macros", "parsing", "serde"] }
jsonwebtoken = { version = "10.3.0", features = ["rust_crypto"] } jsonwebtoken = { version = "10.3.0", features = ["rust_crypto"] }
josekit = { version = "0.10.3" } josekit = { version = "0.10.3" }
utoipa = { version = "5.5.0", features = ["axum_extras"] } utoipa = { version = "5.5.0", features = ["axum_extras"] }
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] }
simeta = { git = "ssh://git@git.kundeng.us/phoenix/simeta.git", tag = "v0.6.2" } simeta = { git = "ssh://git@git.kundeng.us/phoenix/simeta.git", tag = "v0.6.1-main-b690995806-680" }
simodels = { git = "ssh://git@git.kundeng.us/phoenix/simodels.git", tag = "v0.11.5-main-94d97cb81d-111" } simodels = { git = "ssh://git@git.kundeng.us/phoenix/simodels.git", tag = "v0.11.4-4-2c1998242f-111" }
sienvy = { git = "ssh://git@git.kundeng.us/phoenix/sienvy.git", tag = "v0.8.1" } sienvy = { git = "ssh://git@git.kundeng.us/phoenix/sienvy.git", tag = "v0.8.0-main-d06c8fdf49-006" }
labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.5" } labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.4" }
[dev-dependencies] [dev-dependencies]
common-multipart-rfc7578 = { version = "0.7.0" } common-multipart-rfc7578 = { version = "0.7.0" }
@@ -74,6 +74,5 @@ CREATE TABLE IF NOT EXISTS "coverart" (
directory TEXT NOT NULL, directory TEXT NOT NULL,
filename TEXT NOT NULL, filename TEXT NOT NULL,
file_type TEXT NOT NULL, file_type TEXT NOT NULL,
file_key TEXT NOT NULL,
song_id UUID NOT NULL song_id UUID NOT NULL
); );
+31 -17
View File
@@ -99,7 +99,7 @@ pub mod endpoint {
raw_data: data, raw_data: data,
..Default::default() ..Default::default()
}; };
let new_file_key = format!("processed/coverart/{filename}"); let new_file_key = format!("processed/song/{filename}");
match lr.upload(&new_file_key, &data).await { match lr.upload(&new_file_key, &data).await {
Ok(_resp) => { Ok(_resp) => {
@@ -127,24 +127,41 @@ pub mod endpoint {
coverart.title = song.album.clone(); coverart.title = song.album.clone();
coverart.file_type = file_type.file_type; coverart.file_type = file_type.file_type;
coverart.data = data.raw_data; coverart.data = data.raw_data;
coverart.file_key = new_file_key;
match repo::coverart::create(&pool, &coverart, &payload.song_id) match coverart.save_to_filesystem() {
.await Ok(_) => {
{ match repo::coverart::create(
Ok(id) => { &pool,
coverart.song_id = payload.song_id; &coverart,
coverart.id = id; &payload.song_id,
println!("Cover Art created"); )
.await
{
Ok(id) => {
coverart.song_id = payload.song_id;
coverart.id = id;
println!("Cover Art created");
response.message = String::from("Successful"); response.message = String::from("Successful");
response.data.push(coverart); response.data.push(coverart);
(axum::http::StatusCode::OK, axum::Json(response)) (axum::http::StatusCode::OK, axum::Json(response))
}
Err(err) => {
response.message = err.to_string();
(
axum::http::StatusCode::BAD_REQUEST,
axum::Json(response),
)
}
}
} }
Err(err) => { Err(err) => {
response.message = err.to_string(); response.message = err.to_string();
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) (
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
axum::Json(response),
)
} }
} }
} }
@@ -232,11 +249,8 @@ pub mod endpoint {
axum::Extension(pool): axum::Extension<sqlx::PgPool>, axum::Extension(pool): axum::Extension<sqlx::PgPool>,
axum::extract::Path(id): axum::extract::Path<uuid::Uuid>, axum::extract::Path(id): axum::extract::Path<uuid::Uuid>,
) -> (axum::http::StatusCode, axum::response::Response) { ) -> (axum::http::StatusCode, axum::response::Response) {
let lab_config = crate::util::maze::get_config();
let lr = labyrinth::Labyrinth { config: lab_config };
match repo::coverart::get_coverart(&pool, &id).await { match repo::coverart::get_coverart(&pool, &id).await {
Ok(coverart) => match lr.download(&coverart.file_key).await { Ok(coverart) => match simodels::coverart::io::to_data(&coverart) {
Ok(data) => { Ok(data) => {
let (file_type, img_type) = let (file_type, img_type) =
match simeta::detection::coverart::file_type_from_data(&data) { match simeta::detection::coverart::file_type_from_data(&data) {
+1 -1
View File
@@ -182,7 +182,7 @@ pub mod endpoint {
let lr = labyrinth::Labyrinth { config: lab_config }; let lr = labyrinth::Labyrinth { config: lab_config };
let data = labyrinth::Data { let data = labyrinth::Data {
raw_data, raw_data: raw_data,
..Default::default() ..Default::default()
}; };
+38 -1
View File
@@ -137,14 +137,19 @@ pub mod endpoint {
song.filename = song.filename =
simodels::song::generate_filename(simodels::types::MusicType::FlacExtension, true) simodels::song::generate_filename(simodels::types::MusicType::FlacExtension, true)
.unwrap(); .unwrap();
// Will no longer be needed with s3
song.directory = sienvy::environment::get_root_directory().value; song.directory = sienvy::environment::get_root_directory().value;
let lab_config = crate::util::maze::get_config(); let lab_config = crate::util::maze::get_config();
let lr = labyrinth::Labyrinth { config: lab_config }; let lr = labyrinth::Labyrinth { config: lab_config };
println!("Wut?");
match repo_queue::data::get_with_song_queue_id(&pool, &payload.song_queue_id).await { match repo_queue::data::get_with_song_queue_id(&pool, &payload.song_queue_id).await {
Ok((_id, file_key, _bucket, _region, _)) => match lr.download(&file_key).await { Ok((_id, file_key, _bucket, _region, _)) => match lr.download(&file_key).await {
Ok(data) => { Ok(data) => {
println!("Okay!");
println!("File key: {:?}", file_key);
song.data = data; song.data = data;
let dir = std::path::Path::new(&song.directory); let dir = std::path::Path::new(&song.directory);
if !dir.exists() { if !dir.exists() {
@@ -160,6 +165,7 @@ pub mod endpoint {
} }
song.file_key = format!("processed/song/{}", song.filename); song.file_key = format!("processed/song/{}", song.filename);
println!("Processed file key: {:?}", song.file_key);
let data_of_song = labyrinth::Data { let data_of_song = labyrinth::Data {
raw_data: song.data.clone(), raw_data: song.data.clone(),
..Default::default() ..Default::default()
@@ -176,12 +182,14 @@ pub mod endpoint {
(axum::http::StatusCode::OK, axum::Json(response)) (axum::http::StatusCode::OK, axum::Json(response))
} }
Err(err) => { Err(err) => {
eprintln!("Error inserting");
response.message = response.message =
format!("{:?} song {:?}", err.to_string(), song); format!("{:?} song {:?}", err.to_string(), song);
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) (axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
} }
}, },
Err(err) => { Err(err) => {
eprintln!("Error uploading");
eprintln!("Error: {err:?}"); eprintln!("Error: {err:?}");
( (
axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::http::StatusCode::INTERNAL_SERVER_ERROR,
@@ -189,6 +197,34 @@ pub mod endpoint {
) )
} }
} }
/*
match song.save_to_filesystem() {
Ok(_) =>
match repo::song::insert(&pool, &song).await {
Ok((date_created, id)) => {
song.id = id;
song.date_created = Some(date_created);
response.message = String::from("Successful");
response.data.push(song);
(axum::http::StatusCode::OK, axum::Json(response))
}
Err(err) => {
response.message =
format!("{:?} song {:?}", err.to_string(), song);
(axum::http::StatusCode::BAD_REQUEST, axum::Json(response))
}
},
Err(err) => {
response.message = err.to_string();
(
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
axum::Json(response),
)
}
}
*/
} }
Err(err) => { Err(err) => {
eprintln!("Error: {err:?}"); eprintln!("Error: {err:?}");
@@ -307,7 +343,7 @@ pub mod endpoint {
true, true,
) )
.unwrap(); .unwrap();
// TODO: At some point, directory will no longer be needed with s3 // Will no longer be needed with s3
song.directory = sienvy::environment::get_root_directory().value; song.directory = sienvy::environment::get_root_directory().value;
song.data = data; song.data = data;
@@ -481,6 +517,7 @@ pub mod endpoint {
match repo::coverart::delete_coverart(&pool, &coverart.id).await match repo::coverart::delete_coverart(&pool, &coverart.id).await
{ {
Ok(deleted_coverart) => { Ok(deleted_coverart) => {
// match song.remove_from_filesystem() {
match lr.delete(&song.file_key).await { match lr.delete(&song.file_key).await {
Ok(_) => match coverart.remove_from_filesystem() { Ok(_) => match coverart.remove_from_filesystem() {
Ok(_) => { Ok(_) => {
+22 -46
View File
@@ -500,23 +500,19 @@ mod tests {
} }
mod sequence_flow { mod sequence_flow {
use std::io::Read;
pub const TEST_SONG_01_FILE_KEY: &str = "processed/song/track01.flac"; pub const TEST_SONG_01_FILE_KEY: &str = "processed/song/track01.flac";
pub const TEST_SONG_02_FILE_KEY: &str = "processed/song/track02.flac"; pub const TEST_SONG_02_FILE_KEY: &str = "processed/song/track02.flac";
pub const TEST_COVERART_01_FILE_KEY: &str = "processed/coverart/Coverart-1.jpg";
pub const TEST_COVERART_02_FILE_KEY: &str = "processed/coverart/Coverart-2.jpg";
pub struct SongBucket { pub struct SongBucket {
pub file_key: String, pub file_key: String,
pub path: String, pub path: String,
} }
pub struct CoverArtBucket {
pub file_key: String,
pub path: String,
}
pub async fn upload_test_songs_to_bucket() { pub async fn upload_test_songs_to_bucket() {
let lab_config = soaricarus_api::util::maze::get_config();
let songs = vec![ let songs = vec![
SongBucket { SongBucket {
file_key: TEST_SONG_01_FILE_KEY.to_string(), file_key: TEST_SONG_01_FILE_KEY.to_string(),
@@ -528,14 +524,15 @@ mod tests {
}, },
]; ];
let lab_config = soaricarus_api::util::maze::get_config();
let lr = labyrinth::Labyrinth { config: lab_config }; let lr = labyrinth::Labyrinth { config: lab_config };
for song in &songs { for song in &songs {
let p = std::path::Path::new(&song.path); let p = std::path::Path::new(&song.path);
// match std::fs::File::open(p) {
match tokio::fs::File::open(p).await { match tokio::fs::File::open(p).await {
Ok(mut _file) => { Ok(mut _file) => {
let data = labyrinth::Data { let data = labyrinth::Data {
// raw_data: buffer,
filepath: song.path.clone(), filepath: song.path.clone(),
..Default::default() ..Default::default()
}; };
@@ -546,44 +543,21 @@ mod tests {
assert!(false, "Error: {err:?}"); assert!(false, "Error: {err:?}");
} }
} }
}
Err(err) => {
assert!(false, "Error: {err:?}");
}
};
}
}
pub async fn upload_test_coverarts_to_bucket() { /*
let coverarts = vec![ let mut buffer: Vec<u8> = Vec::new();
CoverArtBucket { match file.read_to_end(&mut buffer) {
file_key: TEST_COVERART_01_FILE_KEY.to_string(), Ok(_) => {
path: "tests/I/Coverart-1.jpg".to_string(), if buffer.is_empty() {
},
CoverArtBucket {
file_key: TEST_COVERART_02_FILE_KEY.to_string(),
path: "tests/I/Coverart-2.jpg".to_string(),
},
];
let lab_config = soaricarus_api::util::maze::get_config(); } else {
let lr = labyrinth::Labyrinth { config: lab_config }; }
}
for coverart in &coverarts {
let p = std::path::Path::new(&coverart.path);
match tokio::fs::File::open(p).await {
Ok(mut _file) => {
let data = labyrinth::Data {
filepath: coverart.path.clone(),
..Default::default()
};
match lr.upload(&coverart.file_key, &data).await {
Ok(_) => {}
Err(err) => { Err(err) => {
assert!(false, "Error: {err:?}"); assert!(false, "Error: {err:?}");
} }
} }
*/
} }
Err(err) => { Err(err) => {
assert!(false, "Error: {err:?}"); assert!(false, "Error: {err:?}");
@@ -592,7 +566,9 @@ mod tests {
} }
} }
pub async fn delete_test_songs_from_bucket() { pub async fn delete_test_songs_to_bucket() {
let lab_config = soaricarus_api::util::maze::get_config();
let songs = vec![ let songs = vec![
SongBucket { SongBucket {
file_key: TEST_SONG_01_FILE_KEY.to_string(), file_key: TEST_SONG_01_FILE_KEY.to_string(),
@@ -604,7 +580,6 @@ mod tests {
}, },
]; ];
let lab_config = soaricarus_api::util::maze::get_config();
let lr = labyrinth::Labyrinth { config: lab_config }; let lr = labyrinth::Labyrinth { config: lab_config };
for song in &songs { for song in &songs {
@@ -679,7 +654,6 @@ mod tests {
app: &axum::Router, app: &axum::Router,
song_queue_id: &uuid::Uuid, song_queue_id: &uuid::Uuid,
) -> Result<axum::response::Response, axum::http::Error> { ) -> Result<axum::response::Response, axum::http::Error> {
upload_test_coverarts_to_bucket().await;
match super::request::upload_coverart_queue_req(&app).await { match super::request::upload_coverart_queue_req(&app).await {
Ok(response) => { Ok(response) => {
let resp = super::util::get_resp_data::< let resp = super::util::get_resp_data::<
@@ -741,6 +715,7 @@ mod tests {
soaricarus_api::callers::song::response::create_metadata::Response, soaricarus_api::callers::song::response::create_metadata::Response,
>(response) >(response)
.await; .await;
assert_eq!(false, resp.data.is_empty(), "Node");
assert_eq!( assert_eq!(
false, false,
resp.data.is_empty(), resp.data.is_empty(),
@@ -756,6 +731,8 @@ mod tests {
song song
); );
// eprintln!("Song: {:?}", song);
match queue_coverart_flow(&app, &song_queue_id).await { match queue_coverart_flow(&app, &song_queue_id).await {
Ok(response) => Ok((response, song_queue_id)), Ok(response) => Ok((response, song_queue_id)),
Err(err) => { Err(err) => {
@@ -894,7 +871,6 @@ mod tests {
}; };
let _ = db_mgr::drop_database(&tm_pool, &db_name).await; let _ = db_mgr::drop_database(&tm_pool, &db_name).await;
sequence_flow::delete_test_songs_from_bucket().await;
} }
#[tokio::test] #[tokio::test]
+31 -50
View File
@@ -7,14 +7,13 @@ pub async fn create(
) -> Result<uuid::Uuid, sqlx::Error> { ) -> Result<uuid::Uuid, sqlx::Error> {
let result = sqlx::query( let result = sqlx::query(
r#" r#"
INSERT INTO "coverart" (title, directory, filename, file_type, file_key, song_id) VALUES($1, $2, $3, $4, $5, $6) RETURNING id; INSERT INTO "coverart" (title, directory, filename, file_type, song_id) VALUES($1, $2, $3, $4, $5) RETURNING id;
"#, "#,
) )
.bind(&coverart.title) .bind(&coverart.title)
.bind(&coverart.directory) .bind(&coverart.directory)
.bind(&coverart.filename) .bind(&coverart.filename)
.bind(&coverart.file_type) .bind(&coverart.file_type)
.bind(&coverart.file_key)
.bind(song_id) .bind(song_id)
.fetch_one(pool) .fetch_one(pool)
.await .await
@@ -40,7 +39,7 @@ pub async fn get_coverart(
) -> Result<simodels::coverart::CoverArt, sqlx::Error> { ) -> Result<simodels::coverart::CoverArt, sqlx::Error> {
let result = sqlx::query( let result = sqlx::query(
r#" r#"
SELECT id, title, directory, filename, file_type, file_key, song_id FROM "coverart" WHERE id = $1; SELECT id, title, directory, filename, file_type, song_id FROM "coverart" WHERE id = $1;
"#, "#,
) )
.bind(id) .bind(id)
@@ -72,10 +71,6 @@ pub async fn get_coverart(
.try_get("file_type") .try_get("file_type")
.map_err(|_e| sqlx::Error::RowNotFound) .map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(), .unwrap(),
file_key: row
.try_get("file_key")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
song_id: row song_id: row
.try_get("song_id") .try_get("song_id")
.map_err(|_e| sqlx::Error::RowNotFound) .map_err(|_e| sqlx::Error::RowNotFound)
@@ -92,7 +87,7 @@ pub async fn get_coverart_with_song_id(
) -> Result<simodels::coverart::CoverArt, sqlx::Error> { ) -> Result<simodels::coverart::CoverArt, sqlx::Error> {
let result = sqlx::query( let result = sqlx::query(
r#" r#"
SELECT id, title, directory, filename, file_type, file_key, song_id FROM "coverart" WHERE song_id = $1; SELECT id, title, directory, filename, file_type, song_id FROM "coverart" WHERE song_id = $1;
"#, "#,
) )
.bind(song_id) .bind(song_id)
@@ -124,10 +119,6 @@ pub async fn get_coverart_with_song_id(
.try_get("file_type") .try_get("file_type")
.map_err(|_e| sqlx::Error::RowNotFound) .map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(), .unwrap(),
file_key: row
.try_get("file_key")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
data: Vec::new(), data: Vec::new(),
song_id: row song_id: row
.try_get("song_id") .try_get("song_id")
@@ -146,7 +137,7 @@ pub async fn delete_coverart(
r#" r#"
DELETE FROM "coverart" DELETE FROM "coverart"
WHERE id = $1 WHERE id = $1
RETURNING id, title, directory, filename, file_type, file_key, song_id RETURNING id, title, directory, filename, file_type, song_id
"#, "#,
) )
.bind(id) .bind(id)
@@ -157,43 +148,33 @@ pub async fn delete_coverart(
}); });
match result { match result {
Ok(row) => parse_row(&row).await, Ok(row) => Ok(simodels::coverart::CoverArt {
id: row
.try_get("id")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
title: row
.try_get("title")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
directory: row
.try_get("directory")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
filename: row
.try_get("filename")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
file_type: row
.try_get("file_type")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
song_id: row
.try_get("song_id")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
data: Vec::new(),
}),
Err(_err) => Err(sqlx::Error::RowNotFound), Err(_err) => Err(sqlx::Error::RowNotFound),
} }
} }
async fn parse_row(
row: &sqlx::postgres::PgRow,
) -> Result<simodels::coverart::CoverArt, sqlx::Error> {
Ok(simodels::coverart::CoverArt {
id: row
.try_get("id")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
title: row
.try_get("title")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
directory: row
.try_get("directory")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
filename: row
.try_get("filename")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
file_type: row
.try_get("file_type")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
file_key: row
.try_get("file_key")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
song_id: row
.try_get("song_id")
.map_err(|_e| sqlx::Error::RowNotFound)
.unwrap(),
data: Vec::new(),
})
}
-1
View File
@@ -72,6 +72,5 @@ CREATE TABLE IF NOT EXISTS "coverart" (
directory TEXT NOT NULL, directory TEXT NOT NULL,
filename TEXT NOT NULL, filename TEXT NOT NULL,
file_type TEXT NOT NULL, file_type TEXT NOT NULL,
file_key TEXT NOT NULL,
song_id UUID NOT NULL song_id UUID NOT NULL
); );
@@ -2,10 +2,10 @@
INSERT INTO "song" (id, title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, date_created, filename, directory, file_key, user_id) INSERT INTO "song" (id, title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, date_created, filename, directory, file_key, user_id)
VALUES('44cf7940-34ff-489f-9124-d0ec90a55af9', 'Hypocrite Like The Rest', 'Kuoth', 'Kuoth', 'I', 'Alternative Hip-Hop', 2020, 1, 1, 9, 1, 139, 'flac', '2020-01-01 13:00:00-05', 'track01.flac', 'tests/I', 'processed/song/track01.flac', '47491f9b-725a-4ba4-b9a5-711e1be46670'); VALUES('44cf7940-34ff-489f-9124-d0ec90a55af9', 'Hypocrite Like The Rest', 'Kuoth', 'Kuoth', 'I', 'Alternative Hip-Hop', 2020, 1, 1, 9, 1, 139, 'flac', '2020-01-01 13:00:00-05', 'track01.flac', 'tests/I', 'processed/song/track01.flac', '47491f9b-725a-4ba4-b9a5-711e1be46670');
INSERT INTO "coverart" (id, title, directory, filename, file_type, file_key, song_id) INSERT INTO "coverart" (id, title, directory, filename, file_type, song_id)
VALUES('996122cd-5ae9-4013-9934-60768d3006ed', 'I', 'tests/I', 'Coverart-1.jpg', 'jpeg', 'processed/coverart/Coverart-1.jpg', '44cf7940-34ff-489f-9124-d0ec90a55af9'); VALUES('996122cd-5ae9-4013-9934-60768d3006ed', 'I', 'tests/I', 'Coverart-1.jpg', 'jpeg', '44cf7940-34ff-489f-9124-d0ec90a55af9');
INSERT INTO "song" (id, title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, date_created, filename, directory, file_key, user_id) INSERT INTO "song" (id, title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, date_created, filename, directory, file_key, user_id)
VALUES('94cf7940-34ff-489f-9124-d0ec90a55af4', 'It''s Too Late', 'Kuoth', 'Kuoth', 'I', 'Alternative Hip-Hop', 2020, 2, 1, 9, 1, 116, 'flac', '2020-01-01 13:01:00-05', 'track02.flac', 'tests/I', 'processed/song/track02.flac', '47491f9b-725a-4ba4-b9a5-711e1be46670'); VALUES('94cf7940-34ff-489f-9124-d0ec90a55af4', 'It''s Too Late', 'Kuoth', 'Kuoth', 'I', 'Alternative Hip-Hop', 2020, 2, 1, 9, 1, 116, 'flac', '2020-01-01 13:01:00-05', 'track02.flac', 'tests/I', 'processed/song/track02.flac', '47491f9b-725a-4ba4-b9a5-711e1be46670');
INSERT INTO "coverart" (id, title, directory, filename, file_type, file_key, song_id) INSERT INTO "coverart" (id, title, directory, filename, file_type, song_id)
VALUES('d96122cd-5ae9-4013-9934-60768d3006e9', 'I', 'tests/I', 'Coverart-2.jpg', 'jpeg', 'processed/coverart/Coverart-2.jpg', '94cf7940-34ff-489f-9124-d0ec90a55af4'); VALUES('d96122cd-5ae9-4013-9934-60768d3006e9', 'I', 'tests/I', 'Coverart-2.jpg', 'jpeg', '94cf7940-34ff-489f-9124-d0ec90a55af4');