Compare commits
9
Commits
main
...
459b25ce3e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
459b25ce3e
|
||
|
|
57eaf61254
|
||
|
|
2ec2e2471c
|
||
|
|
aea8b14e14
|
||
|
|
b3055a2521
|
||
|
|
d20bc830f3
|
||
|
|
ffe293d955
|
||
|
|
c88c8fe74b
|
||
|
|
5b292a021c
|
Generated
+2
-2
@@ -2981,8 +2981,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "simodels"
|
name = "simodels"
|
||||||
version = "0.11.3"
|
version = "0.11.4"
|
||||||
source = "git+ssh://git@git.kundeng.us/phoenix/simodels.git?tag=v0.11.3-main-fe9d101bd0-111#fe9d101bd019f91fe8c99c29721ccb0e6e90c92c"
|
source = "git+ssh://git@git.kundeng.us/phoenix/simodels.git?tag=v0.11.4-4-2c1998242f-111#2c1998242fb6c1e79b14f34f40b33f5e9f90a35d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"josekit",
|
"josekit",
|
||||||
"rand 0.10.2",
|
"rand 0.10.2",
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ 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.1-main-b690995806-680" }
|
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.3-main-fe9d101bd0-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.0-main-d06c8fdf49-006" }
|
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.4" }
|
labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.4" }
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ CREATE TABLE IF NOT EXISTS "song" (
|
|||||||
date_created timestamptz DEFAULT now(),
|
date_created timestamptz DEFAULT now(),
|
||||||
filename TEXT NOT NULL,
|
filename TEXT NOT NULL,
|
||||||
directory TEXT NOT NULL,
|
directory TEXT NOT NULL,
|
||||||
|
file_key TEXT NOT NULL,
|
||||||
user_id UUID NULL
|
user_id UUID NULL
|
||||||
-- TODO: Add coverart id later. This will allow multiple songs to be linked to a single cover art
|
-- TODO: Add coverart id later. This will allow multiple songs to be linked to a single cover art
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+97
-36
@@ -159,8 +159,14 @@ pub mod endpoint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match song.save_to_filesystem() {
|
song.file_key = format!("processed/song/{}", song.filename);
|
||||||
Ok(_) => match repo::song::insert(&pool, &song).await {
|
let data_of_song = labyrinth::Data {
|
||||||
|
raw_data: song.data.clone(),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
match lr.upload(&song.file_key, &data_of_song).await {
|
||||||
|
Ok(_resp) => match repo::song::insert(&pool, &song).await {
|
||||||
Ok((date_created, id)) => {
|
Ok((date_created, id)) => {
|
||||||
song.id = id;
|
song.id = id;
|
||||||
song.date_created = Some(date_created);
|
song.date_created = Some(date_created);
|
||||||
@@ -176,7 +182,7 @@ pub mod endpoint {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
response.message = err.to_string();
|
eprintln!("Error: {err:?}");
|
||||||
(
|
(
|
||||||
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
axum::Json(response),
|
axum::Json(response),
|
||||||
@@ -290,40 +296,90 @@ pub mod endpoint {
|
|||||||
axum::extract::Path(id): axum::extract::Path<uuid::Uuid>,
|
axum::extract::Path(id): axum::extract::Path<uuid::Uuid>,
|
||||||
) -> impl IntoResponse {
|
) -> impl IntoResponse {
|
||||||
match repo::song::get_song(&pool, &id).await {
|
match repo::song::get_song(&pool, &id).await {
|
||||||
Ok(song) => {
|
Ok(mut song) => {
|
||||||
let song_path = song.song_path().unwrap();
|
let lab_config = crate::util::maze::get_config();
|
||||||
let path = std::path::Path::new(&song_path);
|
let lr = labyrinth::Labyrinth { config: lab_config };
|
||||||
|
|
||||||
if !path.starts_with(&song.directory) || !path.exists() {
|
match lr.download(&song.file_key).await {
|
||||||
return Err((axum::http::StatusCode::NOT_FOUND, "File not found"));
|
Ok(data) => {
|
||||||
}
|
song.filename = simodels::song::generate_filename(
|
||||||
|
simodels::types::MusicType::FlacExtension,
|
||||||
|
true,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
// TODO: At some point, directory will no longer be needed with s3
|
||||||
|
song.directory = sienvy::environment::get_root_directory().value;
|
||||||
|
song.data = data;
|
||||||
|
|
||||||
let file = match tokio::fs::File::open(&path).await {
|
match song.save_to_filesystem() {
|
||||||
Ok(file) => file,
|
Ok(_) => {
|
||||||
Err(_) => return Err((axum::http::StatusCode::NOT_FOUND, "File not found")),
|
let song_path = song.song_path().unwrap();
|
||||||
};
|
let path = std::path::Path::new(&song_path);
|
||||||
|
|
||||||
let file_size = match file.metadata().await {
|
if !path.starts_with(&song.directory) || !path.exists() {
|
||||||
Ok(meta) => meta.len(),
|
return Err((
|
||||||
Err(_) => {
|
axum::http::StatusCode::NOT_FOUND,
|
||||||
return Err((
|
"File not found",
|
||||||
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
));
|
||||||
"Could not read file",
|
}
|
||||||
));
|
|
||||||
|
let file = match tokio::fs::File::open(&path).await {
|
||||||
|
Ok(file) => file,
|
||||||
|
Err(_) => {
|
||||||
|
return Err((
|
||||||
|
axum::http::StatusCode::NOT_FOUND,
|
||||||
|
"File not found",
|
||||||
|
));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let file_size = match file.metadata().await {
|
||||||
|
Ok(meta) => meta.len(),
|
||||||
|
Err(_) => {
|
||||||
|
return Err((
|
||||||
|
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
|
"Could not read file",
|
||||||
|
));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let mime = mime_guess::from_path(path).first_or_octet_stream();
|
||||||
|
let stream = tokio_util::io::ReaderStream::new(file);
|
||||||
|
|
||||||
|
let rep = axum::response::Response::builder()
|
||||||
|
.header("content-type", mime.to_string())
|
||||||
|
.header("accept-ranges", "bytes")
|
||||||
|
.header("content-length", file_size.to_string())
|
||||||
|
.body(axum::body::Body::from_stream(stream))
|
||||||
|
.unwrap();
|
||||||
|
match song.remove_from_filesystem() {
|
||||||
|
Ok(_) => Ok(rep),
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("Error: {err:?}");
|
||||||
|
Err((
|
||||||
|
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
|
"Could not read file",
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("Error: {err:?}");
|
||||||
|
Err((
|
||||||
|
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
|
"Could not find file",
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
Err(err) => {
|
||||||
|
eprintln!("Error: {err:?}");
|
||||||
let mime = mime_guess::from_path(path).first_or_octet_stream();
|
Err((
|
||||||
let stream = tokio_util::io::ReaderStream::new(file);
|
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
|
"Could not find file",
|
||||||
let rep = axum::response::Response::builder()
|
))
|
||||||
.header("content-type", mime.to_string())
|
}
|
||||||
.header("accept-ranges", "bytes")
|
}
|
||||||
.header("content-length", file_size.to_string())
|
|
||||||
.body(axum::body::Body::from_stream(stream))
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
Ok(rep)
|
|
||||||
}
|
}
|
||||||
Err(_err) => Err((
|
Err(_err) => Err((
|
||||||
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
@@ -347,8 +403,11 @@ 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::song::get_song(&pool, &id).await {
|
match repo::song::get_song(&pool, &id).await {
|
||||||
Ok(song) => match simodels::song::io::to_data(&song) {
|
Ok(song) => match lr.download(&song.file_key).await {
|
||||||
Ok(data) => {
|
Ok(data) => {
|
||||||
let bytes = axum::body::Bytes::from(data);
|
let bytes = axum::body::Bytes::from(data);
|
||||||
let mut response = bytes.into_response();
|
let mut response = bytes.into_response();
|
||||||
@@ -397,6 +456,8 @@ pub mod endpoint {
|
|||||||
axum::Json<super::response::delete_song::Response>,
|
axum::Json<super::response::delete_song::Response>,
|
||||||
) {
|
) {
|
||||||
let mut response = super::response::delete_song::Response::default();
|
let mut response = super::response::delete_song::Response::default();
|
||||||
|
let lab_config = crate::util::maze::get_config();
|
||||||
|
let lr = labyrinth::Labyrinth { config: lab_config };
|
||||||
|
|
||||||
match repo::song::get_song(&pool, &id).await {
|
match repo::song::get_song(&pool, &id).await {
|
||||||
Ok(song) => {
|
Ok(song) => {
|
||||||
@@ -420,7 +481,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 {
|
||||||
Ok(_) => match coverart.remove_from_filesystem() {
|
Ok(_) => match coverart.remove_from_filesystem() {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
response.message = String::from(
|
response.message = String::from(
|
||||||
@@ -438,7 +499,7 @@ pub mod endpoint {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
response.message = err.to_string();
|
eprintln!("Error: {err:?}");
|
||||||
(axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response))
|
(axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+73
-2
@@ -500,10 +500,82 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod sequence_flow {
|
mod sequence_flow {
|
||||||
|
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 struct SongBucket {
|
||||||
|
pub file_key: String,
|
||||||
|
pub path: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn upload_test_songs_to_bucket() {
|
||||||
|
let songs = vec![
|
||||||
|
SongBucket {
|
||||||
|
file_key: TEST_SONG_01_FILE_KEY.to_string(),
|
||||||
|
path: "tests/I/track01.flac".to_string(),
|
||||||
|
},
|
||||||
|
SongBucket {
|
||||||
|
file_key: TEST_SONG_02_FILE_KEY.to_string(),
|
||||||
|
path: "tests/I/track02.flac".to_string(),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
let lab_config = soaricarus_api::util::maze::get_config();
|
||||||
|
let lr = labyrinth::Labyrinth { config: lab_config };
|
||||||
|
|
||||||
|
for song in &songs {
|
||||||
|
let p = std::path::Path::new(&song.path);
|
||||||
|
match tokio::fs::File::open(p).await {
|
||||||
|
Ok(mut _file) => {
|
||||||
|
let data = labyrinth::Data {
|
||||||
|
filepath: song.path.clone(),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
match lr.upload(&song.file_key, &data).await {
|
||||||
|
Ok(_) => {}
|
||||||
|
Err(err) => {
|
||||||
|
assert!(false, "Error: {err:?}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
assert!(false, "Error: {err:?}");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn delete_test_songs_from_bucket() {
|
||||||
|
let songs = vec![
|
||||||
|
SongBucket {
|
||||||
|
file_key: TEST_SONG_01_FILE_KEY.to_string(),
|
||||||
|
path: "tests/I/track01.flac".to_string(),
|
||||||
|
},
|
||||||
|
SongBucket {
|
||||||
|
file_key: TEST_SONG_02_FILE_KEY.to_string(),
|
||||||
|
path: "tests/I/track02.flac".to_string(),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
let lab_config = soaricarus_api::util::maze::get_config();
|
||||||
|
let lr = labyrinth::Labyrinth { config: lab_config };
|
||||||
|
|
||||||
|
for song in &songs {
|
||||||
|
match lr.delete(&song.file_key).await {
|
||||||
|
Ok(_) => {}
|
||||||
|
Err(err) => {
|
||||||
|
assert!(false, "Error: {err:?}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Flow for queueing song
|
// Flow for queueing song
|
||||||
pub async fn queue_song_flow(
|
pub async fn queue_song_flow(
|
||||||
app: &axum::Router,
|
app: &axum::Router,
|
||||||
) -> Result<(axum::response::Response, uuid::Uuid), axum::http::Error> {
|
) -> Result<(axum::response::Response, uuid::Uuid), axum::http::Error> {
|
||||||
|
upload_test_songs_to_bucket().await;
|
||||||
match super::request::song_queue_req(&app).await {
|
match super::request::song_queue_req(&app).await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
let resp = super::util::get_resp_data::<
|
let resp = super::util::get_resp_data::<
|
||||||
@@ -637,8 +709,6 @@ 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) => {
|
||||||
@@ -777,6 +847,7 @@ 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]
|
||||||
|
|||||||
+16
-3
@@ -6,8 +6,8 @@ pub async fn insert(
|
|||||||
) -> Result<(time::OffsetDateTime, uuid::Uuid), sqlx::Error> {
|
) -> Result<(time::OffsetDateTime, uuid::Uuid), sqlx::Error> {
|
||||||
let result = sqlx::query(
|
let result = sqlx::query(
|
||||||
r#"
|
r#"
|
||||||
INSERT INTO "song" (title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, filename, directory, user_id)
|
INSERT INTO "song" (title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, filename, directory, file_key, user_id)
|
||||||
VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) RETURNING date_created, id;
|
VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) RETURNING date_created, id;
|
||||||
"#
|
"#
|
||||||
)
|
)
|
||||||
.bind(&song.title)
|
.bind(&song.title)
|
||||||
@@ -24,6 +24,7 @@ pub async fn insert(
|
|||||||
.bind(&song.audio_type)
|
.bind(&song.audio_type)
|
||||||
.bind(&song.filename)
|
.bind(&song.filename)
|
||||||
.bind(&song.directory)
|
.bind(&song.directory)
|
||||||
|
.bind(&song.file_key)
|
||||||
.bind(song.user_id)
|
.bind(song.user_id)
|
||||||
.fetch_one(pool)
|
.fetch_one(pool)
|
||||||
.await
|
.await
|
||||||
@@ -133,6 +134,10 @@ pub async fn get_song(
|
|||||||
.try_get("directory")
|
.try_get("directory")
|
||||||
.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(),
|
||||||
date_created: Some(date_created_time),
|
date_created: Some(date_created_time),
|
||||||
user_id: row
|
user_id: row
|
||||||
.try_get("user_id")
|
.try_get("user_id")
|
||||||
@@ -228,6 +233,10 @@ pub async fn get_all_songs(pool: &sqlx::PgPool) -> Result<Vec<simodels::song::So
|
|||||||
.try_get("directory")
|
.try_get("directory")
|
||||||
.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(),
|
||||||
date_created: Some(date_created_time),
|
date_created: Some(date_created_time),
|
||||||
user_id: row
|
user_id: row
|
||||||
.try_get("user_id")
|
.try_get("user_id")
|
||||||
@@ -254,7 +263,7 @@ pub async fn delete_song(
|
|||||||
r#"
|
r#"
|
||||||
DELETE FROM "song"
|
DELETE FROM "song"
|
||||||
WHERE id = $1
|
WHERE id = $1
|
||||||
RETURNING id, title, artist, album, album_artist, genre, year, disc, track, track_count, disc_count, duration, audio_type, date_created, filename, directory, user_id
|
RETURNING id, title, artist, album, album_artist, genre, year, disc, track, track_count, disc_count, duration, audio_type, date_created, filename, directory, file_key, user_id
|
||||||
"#,
|
"#,
|
||||||
)
|
)
|
||||||
.bind(id)
|
.bind(id)
|
||||||
@@ -332,6 +341,10 @@ pub async fn delete_song(
|
|||||||
.try_get("directory")
|
.try_get("directory")
|
||||||
.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(),
|
||||||
date_created: Some(date_created_time),
|
date_created: Some(date_created_time),
|
||||||
user_id: row
|
user_id: row
|
||||||
.try_get("user_id")
|
.try_get("user_id")
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ CREATE TABLE IF NOT EXISTS "song" (
|
|||||||
date_created timestamptz DEFAULT now(),
|
date_created timestamptz DEFAULT now(),
|
||||||
filename TEXT NOT NULL,
|
filename TEXT NOT NULL,
|
||||||
directory TEXT NOT NULL,
|
directory TEXT NOT NULL,
|
||||||
|
file_key TEXT NOT NULL,
|
||||||
user_id UUID NULL
|
user_id UUID NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
-- Add migration script here
|
-- Add migration script here
|
||||||
INSERT INTO "song" (id, title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, date_created, filename, directory, 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', '47491f9b-725a-4ba4-b9a5-711e1be46670');
|
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 "coverart" (id, title, directory, filename, file_type, song_id) VALUES('996122cd-5ae9-4013-9934-60768d3006ed', 'I', 'tests/I', 'Coverart-1.jpg', 'jpeg', '44cf7940-34ff-489f-9124-d0ec90a55af9');
|
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 "song" (id, title, artist, album_artist, album, genre, year, track, disc, track_count, disc_count, duration, audio_type, date_created, filename, directory, 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', '47491f9b-725a-4ba4-b9a5-711e1be46670');
|
INSERT INTO "coverart" (id, title, directory, filename, file_type, 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', '94cf7940-34ff-489f-9124-d0ec90a55af4');
|
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)
|
||||||
|
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, song_id)
|
||||||
|
VALUES('d96122cd-5ae9-4013-9934-60768d3006e9', 'I', 'tests/I', 'Coverart-2.jpg', 'jpeg', '94cf7940-34ff-489f-9124-d0ec90a55af4');
|
||||||
|
|||||||
Reference in New Issue
Block a user