Dependency name change #3
+1
-1
@@ -14,5 +14,5 @@ serde_json = { version = "1.0.150" }
|
||||
time = { version = "0.3.53", features = ["macros", "serde"] }
|
||||
uuid = { version = "1.23.4", features = ["v4", "serde"] }
|
||||
icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.6.1" }
|
||||
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.11.3" }
|
||||
simodels = { git = "ssh://git@git.kundeng.us/phoenix/simodels.git", tag = "v0.11.3-main-fe9d101bd0-111" }
|
||||
icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.8.0" }
|
||||
|
||||
+5
-5
@@ -162,7 +162,7 @@ pub mod service_token {
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Response {
|
||||
pub message: String,
|
||||
pub data: Vec<icarus_models::login_result::LoginResult>,
|
||||
pub data: Vec<simodels::login_result::LoginResult>,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ pub mod refresh_token {
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Response {
|
||||
pub message: String,
|
||||
pub data: Vec<icarus_models::login_result::LoginResult>,
|
||||
pub data: Vec<simodels::login_result::LoginResult>,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,7 +253,7 @@ pub mod create_song {
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Response {
|
||||
pub message: String,
|
||||
pub data: Vec<icarus_models::song::Song>,
|
||||
pub data: Vec<simodels::song::Song>,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@ pub mod create_song {
|
||||
pub mod create_coverart {
|
||||
pub async fn create(
|
||||
app: &crate::config::App,
|
||||
song: &icarus_models::song::Song,
|
||||
song: &simodels::song::Song,
|
||||
queued_coverart: &crate::queued_item::QueuedCoverArt,
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::builder().build()?;
|
||||
@@ -284,7 +284,7 @@ pub mod create_coverart {
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Response {
|
||||
pub message: String,
|
||||
pub data: Vec<icarus_models::coverart::CoverArt>,
|
||||
pub data: Vec<simodels::coverart::CoverArt>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
pub async fn get_token(
|
||||
app: &crate::config::App,
|
||||
) -> Result<icarus_models::login_result::LoginResult, std::io::Error> {
|
||||
) -> Result<simodels::login_result::LoginResult, std::io::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
let endpoint = String::from("api/v2/service/login");
|
||||
let api_url = format!("{}/{endpoint}", app.auth_uri);
|
||||
@@ -29,7 +29,7 @@ pub async fn get_token(
|
||||
|
||||
pub async fn get_refresh_token(
|
||||
app: &crate::config::App,
|
||||
) -> Result<icarus_models::login_result::LoginResult, std::io::Error> {
|
||||
) -> Result<simodels::login_result::LoginResult, std::io::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
let endpoint = String::from("api/v2/token/refresh");
|
||||
let api_url = format!("{}/{endpoint}", app.auth_uri);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
pub struct App {
|
||||
pub uri: String,
|
||||
pub auth_uri: String,
|
||||
pub token: icarus_models::login_result::LoginResult,
|
||||
pub token: simodels::login_result::LoginResult,
|
||||
pub root_directory: String,
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -4,8 +4,8 @@ pub async fn some_work(
|
||||
user_id: &uuid::Uuid,
|
||||
) -> Result<
|
||||
(
|
||||
icarus_models::song::Song,
|
||||
icarus_models::coverart::CoverArt,
|
||||
simodels::song::Song,
|
||||
simodels::coverart::CoverArt,
|
||||
crate::api::get_metadata_queue::response::Metadata,
|
||||
crate::queued_item::QueuedSong,
|
||||
crate::queued_item::QueuedCoverArt,
|
||||
@@ -104,10 +104,10 @@ pub async fn prep_song(
|
||||
// Process data here...
|
||||
match crate::api::parsing::parse_response_into_bytes(response).await {
|
||||
Ok(song_bytes) => {
|
||||
let song = icarus_models::song::Song {
|
||||
let song = simodels::song::Song {
|
||||
directory: icarus_envy::environment::get_root_directory().value,
|
||||
filename: icarus_models::song::generate_filename(
|
||||
icarus_models::types::MusicType::FlacExtension,
|
||||
filename: simodels::song::generate_filename(
|
||||
simodels::types::MusicType::FlacExtension,
|
||||
true,
|
||||
)
|
||||
.unwrap(),
|
||||
@@ -224,17 +224,17 @@ async fn init_queued_coverart(
|
||||
) -> crate::queued_item::QueuedCoverArt {
|
||||
// TODO: Consider separating song and coverart when saving to the filesystem
|
||||
let covart_type = if file_type == icarus_meta::detection::coverart::constants::PNG_TYPE {
|
||||
icarus_models::types::CoverArtType::PngExtension
|
||||
simodels::types::CoverArtType::PngExtension
|
||||
} else if file_type == icarus_meta::detection::coverart::constants::JPEG_TYPE {
|
||||
icarus_models::types::CoverArtType::JpegExtension
|
||||
simodels::types::CoverArtType::JpegExtension
|
||||
} else if file_type == icarus_meta::detection::coverart::constants::JPG_TYPE {
|
||||
icarus_models::types::CoverArtType::JpgExtension
|
||||
simodels::types::CoverArtType::JpgExtension
|
||||
} else {
|
||||
icarus_models::types::CoverArtType::None
|
||||
simodels::types::CoverArtType::None
|
||||
};
|
||||
let coverart = icarus_models::coverart::CoverArt {
|
||||
let coverart = simodels::coverart::CoverArt {
|
||||
directory: icarus_envy::environment::get_root_directory().value,
|
||||
filename: match icarus_models::coverart::generate_filename(covart_type, true) {
|
||||
filename: match simodels::coverart::generate_filename(covart_type, true) {
|
||||
Ok(filename) => filename,
|
||||
Err(err) => {
|
||||
eprintln!("Error generating CoverArt filename: {err:?}");
|
||||
@@ -255,8 +255,8 @@ async fn init_queued_coverart(
|
||||
}
|
||||
|
||||
pub async fn cleanup(
|
||||
song: &icarus_models::song::Song,
|
||||
coverart: &icarus_models::coverart::CoverArt,
|
||||
song: &simodels::song::Song,
|
||||
coverart: &simodels::coverart::CoverArt,
|
||||
) -> Result<(), std::io::Error> {
|
||||
match song.remove_from_filesystem() {
|
||||
Ok(_) => {}
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct QueuedSong {
|
||||
pub id: uuid::Uuid,
|
||||
pub song: icarus_models::song::Song,
|
||||
pub song: simodels::song::Song,
|
||||
pub path: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct QueuedCoverArt {
|
||||
pub id: uuid::Uuid,
|
||||
pub coverart: icarus_models::coverart::CoverArt,
|
||||
pub coverart: simodels::coverart::CoverArt,
|
||||
pub path: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user