Compare commits
3 Commits
v0.1.0-dev
...
v0.2.0-dev
Author | SHA1 | Date | |
---|---|---|---|
fe61fe3efb | |||
f9f3dbda36 | |||
59ce1c294c |
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.88.0
|
||||
toolchain: 1.86.0
|
||||
components: cargo
|
||||
|
||||
- name: Extract Version from Cargo.toml
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
BRANCH_REF="${GITHUB_REF}"
|
||||
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
||||
PROJECT_TAG_RELEASE="v$VERSION-$BRANCH_NAME-$PROJECT_COMMIT_HASH"
|
||||
echo "::set-output name=project_tag_release::$PROJECT_TAG_RELEASE-431"
|
||||
echo "::set-output name=project_tag_release::$PROJECT_TAG_RELEASE-372"
|
||||
echo "Version: $VERSION"
|
||||
echo "Hash: $PROJECT_COMMIT_HASH"
|
||||
echo "Branch: $BRANCH_NAME"
|
||||
|
25
Cargo.lock
generated
25
Cargo.lock
generated
@@ -501,8 +501,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "icarus_envy"
|
||||
version = "0.2.2"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.2.2-devel-84ea6e4c22-006#84ea6e4c223f19ff96f6b7cae944e831ef4aa831"
|
||||
version = "0.3.0"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.3.0-devel-d73fba9899-006#d73fba9899372b0655a90cb426645930135152da"
|
||||
dependencies = [
|
||||
"const_format",
|
||||
"dotenvy",
|
||||
@@ -510,16 +510,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "icarus_meta"
|
||||
version = "0.2.2"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_meta.git?tag=v0.2.2-devel-565d361b64-680#565d361b64f23c2a0100b33fceeebacfad3331c4"
|
||||
version = "0.3.0"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_meta.git?tag=v0.3.0-devel-f4b71de969-680#f4b71de9692029a706b1ce82c39f6715c560158e"
|
||||
dependencies = [
|
||||
"lofty",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icarus_models"
|
||||
version = "0.4.3"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.4.3#6aa4c3d74142f5fceb4a6e95078bb3ae0a2d99c5"
|
||||
version = "0.5.0"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.0-devel-7958b89abc-111#7958b89abc56bc9262015b3e201ea2906cc8a9ff"
|
||||
dependencies = [
|
||||
"rand",
|
||||
"serde",
|
||||
@@ -973,13 +973,12 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.9.0"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
|
||||
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
|
||||
dependencies = [
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1012,9 +1011,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.12.19"
|
||||
version = "0.12.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2f8e5513d63f2e5b386eb5106dc67eaf3f84e95258e210489136b8b92ad6119"
|
||||
checksum = "eabf4c97d9130e2bf606614eb937e86edac8292eaa6f422f995d7e8de1eb1813"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bytes",
|
||||
@@ -1029,13 +1028,11 @@ dependencies = [
|
||||
"hyper-rustls",
|
||||
"hyper-tls",
|
||||
"hyper-util",
|
||||
"ipnet",
|
||||
"js-sys",
|
||||
"log",
|
||||
"mime",
|
||||
"mime_guess",
|
||||
"native-tls",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rustls-pki-types",
|
||||
@@ -1258,7 +1255,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "songparser"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"icarus_envy",
|
||||
|
20
Cargo.toml
20
Cargo.toml
@@ -1,18 +1,18 @@
|
||||
[package]
|
||||
name = "songparser"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
edition = "2024"
|
||||
rust-version = "1.88"
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.44.1", features = ["full"] }
|
||||
tokio = { version = "1.45.1", features = ["full"] }
|
||||
futures = { version = "0.3.31" }
|
||||
reqwest = { version = "0.12.19", features = ["json", "stream", "multipart"] }
|
||||
serde = { version = "1.0.218", features = ["derive"] }
|
||||
serde_json = { version = "1.0.139" }
|
||||
reqwest = { version = "0.12.20", features = ["json", "stream", "multipart"] }
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
serde_json = { version = "1.0.140" }
|
||||
time = { version = "0.3.41", features = ["macros", "serde"] }
|
||||
uuid = { version = "1.16.0", features = ["v4", "serde"] }
|
||||
rand = { version = "0.9" }
|
||||
icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.2.2-devel-565d361b64-680" }
|
||||
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.4.3" }
|
||||
icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.2.2-devel-84ea6e4c22-006" }
|
||||
uuid = { version = "1.17.0", features = ["v4", "serde"] }
|
||||
rand = { version = "0.9.1" }
|
||||
icarus_meta = { git = "ssh://git@git.kundeng.us/phoenix/icarus_meta.git", tag = "v0.3.0-devel-f4b71de969-680" }
|
||||
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.0-devel-7958b89abc-111" }
|
||||
icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.0-devel-d73fba9899-006" }
|
||||
|
34
src/main.rs
34
src/main.rs
@@ -11,20 +11,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let app_base_url = icarus_envy::environment::get_icarus_base_api_url().await;
|
||||
|
||||
loop {
|
||||
println!("Base URL: {}", app_base_url);
|
||||
println!("Base URL: {app_base_url}");
|
||||
|
||||
match is_queue_empty(&app_base_url).await {
|
||||
Ok((empty, song_queue_item)) => {
|
||||
if !empty {
|
||||
println!("Queue is not empty");
|
||||
println!("SongQueueItem: {:?}", song_queue_item);
|
||||
println!("SongQueueItem: {song_queue_item:?}");
|
||||
let song_queue_id = song_queue_item.data[0].id;
|
||||
|
||||
// TODO: Do something with the result later
|
||||
match some_work(&app_base_url, &song_queue_id).await {
|
||||
Ok(_) => {}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {:?}", err);
|
||||
eprintln!("Error: {err:?}");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -32,7 +32,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error checking if queue is empty: {:?}", err);
|
||||
eprintln!("Error checking if queue is empty: {err:?}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ async fn some_work(
|
||||
.await
|
||||
{
|
||||
Ok(_inner_response) => {
|
||||
println!("Response: {:?}", _inner_response);
|
||||
println!("Response: {_inner_response:?}");
|
||||
Ok(())
|
||||
}
|
||||
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||
@@ -113,7 +113,7 @@ async fn prep_song(
|
||||
let (directory, filename) = generate_song_queue_dir_and_filename().await;
|
||||
let song_queue_path = save_file_to_fs(&directory, &filename, &song_bytes).await;
|
||||
|
||||
println!("Saved at: {:?}", song_queue_path);
|
||||
println!("Saved at: {song_queue_path:?}");
|
||||
|
||||
match api::get_metadata_queue::get(api_url, song_queue_id).await {
|
||||
Ok(response) => {
|
||||
@@ -125,9 +125,9 @@ async fn prep_song(
|
||||
let id = &response.data[0].id;
|
||||
let created_at = &response.data[0].created_at;
|
||||
let metadata = &response.data[0].metadata;
|
||||
println!("Id: {:?}", id);
|
||||
println!("Metadata: {:?}", metadata);
|
||||
println!("Created at: {:?}", created_at);
|
||||
println!("Id: {id:?}");
|
||||
println!("Metadata: {metadata:?}");
|
||||
println!("Created at: {created_at:?}");
|
||||
|
||||
println!("Getting coverart queue");
|
||||
match api::get_coverart_queue::get(api_url, song_queue_id).await
|
||||
@@ -136,7 +136,7 @@ async fn prep_song(
|
||||
match response.json::<api::get_coverart_queue::response::Response>().await {
|
||||
Ok(response) => {
|
||||
let coverart_queue_id = &response.data[0].id;
|
||||
println!("Coverart queue Id: {:?}", coverart_queue_id);
|
||||
println!("Coverart queue Id: {coverart_queue_id:?}");
|
||||
|
||||
match api::get_coverart_queue::get_data(api_url, coverart_queue_id).await {
|
||||
Ok(response) => match api::parsing::parse_response_into_bytes(response).await {
|
||||
@@ -144,7 +144,7 @@ async fn prep_song(
|
||||
let (directory, filename) = generate_coverart_queue_dir_and_filename().await;
|
||||
let coverart_queue_path = save_file_to_fs(&directory, &filename, &coverart_queue_bytes).await;
|
||||
|
||||
println!("Saved coverart queue file at: {:?}", coverart_queue_path);
|
||||
println!("Saved coverart queue file at: {coverart_queue_path:?}");
|
||||
|
||||
let c_path = util::path_buf_to_string(&coverart_queue_path);
|
||||
let s_path = util::path_buf_to_string(&song_queue_path);
|
||||
@@ -350,7 +350,7 @@ pub async fn apply_metadata(
|
||||
match icarus_meta::meta::coverart::contains_coverart(song_queue_path) {
|
||||
Ok((exists, size)) => {
|
||||
if exists {
|
||||
println!("Coverart exists: {:?} size", size);
|
||||
println!("Coverart exists: {size:?} size");
|
||||
match icarus_meta::meta::coverart::remove_coverart(song_queue_path) {
|
||||
Ok(_data) => {}
|
||||
Err(err) => {
|
||||
@@ -401,7 +401,7 @@ mod api {
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
let fetch_endpoint = String::from("api/v2/song/queue/next");
|
||||
let api_url = format!("{}/{}", base_url, fetch_endpoint);
|
||||
let api_url = format!("{base_url}/{fetch_endpoint}");
|
||||
client.get(api_url).send().await
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ mod api {
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
let endpoint = String::from("api/v2/song/queue");
|
||||
let api_url = format!("{}/{}/{}", base_url, endpoint, id);
|
||||
let api_url = format!("{base_url}/{endpoint}/{id}");
|
||||
client.get(api_url).send().await
|
||||
}
|
||||
}
|
||||
@@ -444,7 +444,7 @@ mod api {
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
let endpoint = String::from("api/v2/song/metadata/queue");
|
||||
let api_url = format!("{}/{}", base_url, endpoint);
|
||||
let api_url = format!("{base_url}/{endpoint}");
|
||||
client
|
||||
.get(api_url)
|
||||
.query(&[("song_queue_id", song_queue_id)])
|
||||
@@ -495,7 +495,7 @@ mod api {
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
let endpoint = String::from("api/v2/coverart/queue");
|
||||
let api_url = format!("{}/{}", base_url, endpoint);
|
||||
let api_url = format!("{base_url}/{endpoint}");
|
||||
client
|
||||
.get(api_url)
|
||||
.query(&[("song_queue_id", song_queue_id)])
|
||||
@@ -509,7 +509,7 @@ mod api {
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
let endpoint = String::from("api/v2/coverart/queue/data");
|
||||
let api_url = format!("{}/{}/{}", base_url, endpoint, coverart_queue_id);
|
||||
let api_url = format!("{base_url}/{endpoint}/{coverart_queue_id}");
|
||||
client.get(api_url).send().await
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ pub async fn update_queued_song(
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::builder().build()?;
|
||||
|
||||
println!("Song path: {:?}", song_path);
|
||||
println!("Song path: {song_path:?}");
|
||||
|
||||
// TODO: Make the filename random
|
||||
let form = reqwest::multipart::Form::new().part(
|
||||
@@ -14,8 +14,8 @@ pub async fn update_queued_song(
|
||||
.file_name("track01.flac"),
|
||||
);
|
||||
|
||||
let url = format!("{}/api/v2/song/queue/{}", base_url, song_queue_id);
|
||||
println!("Url: {:?}", url);
|
||||
let url = format!("{base_url}/api/v2/song/queue/{song_queue_id}");
|
||||
println!("Url: {url:?}");
|
||||
|
||||
let request = client.patch(url).multipart(form);
|
||||
|
||||
|
Reference in New Issue
Block a user