Compare commits

..

1 Commits

Author SHA1 Message Date
e3895b6d1a devel (#7)
All checks were successful
Release Tagging / release (push) Successful in 29s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 28s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 27s
Reviewed-on: #7
2025-03-30 18:01:52 +00:00
8 changed files with 12 additions and 1860 deletions

View File

@@ -1,2 +0,0 @@
ROOT_DIRECTORY=/home/songparser/mydata
ICARUS_BASE_API_URL=http://localhost:3000

View File

@@ -1,2 +0,0 @@
ROOT_DIRECTORY=/home/songparser/mydata
ICARUS_BASE_API_URL=http://localhost:3000

View File

@@ -5,6 +5,8 @@ on:
branches:
- main
- devel
tags:
- 'v*' # Trigger on tags matching v*
jobs:
release:
@@ -18,7 +20,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.86.0
toolchain: 1.85.0
components: cargo
- name: Extract Version from Cargo.toml

View File

@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.86.0
toolchain: 1.85.0
- run: |
mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
@@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.86.0
toolchain: 1.85.0
- run: |
mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key
@@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.86.0
toolchain: 1.85.0
- run: rustup component add rustfmt
- run: |
mkdir -p ~/.ssh
@@ -73,7 +73,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.86.0
toolchain: 1.85.0
- run: rustup component add clippy
- run: |
mkdir -p ~/.ssh
@@ -92,7 +92,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.86.0
toolchain: 1.85.0
- run: |
mkdir -p ~/.ssh
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/gitlab_deploy_key

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
/target
.env
Cargo.lock

1796
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,10 +2,6 @@
name = "songparser"
version = "0.1.0"
edition = "2024"
rust-version = "1.86"
[dependencies]
tokio = { version = "1.44.1", features = ["full"] }
reqwest = { version = "0.12.19" }
dotenvy = { version = "0.15.7" }
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.4.3" }
icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.2.0" }

View File

@@ -1,49 +1,3 @@
// use std::error::Error;
// use tokio::io::AsyncReadExt;
// use tokio::net::{TcpListener, TcpStream};
// use tokio::spawn;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let app_base_url = get_icarus_url().await;
loop {
println!("Base URL: {}", app_base_url);
// TODO: Update the api/v2/song/queue/next endpoint to only retrieve queued song that is
// ready to be processed. Make necessary changes to other endpoints
let api_url = format!("{}/api/v2/song/queue/next", app_base_url);
match client.get(api_url).send().await {
Ok(response) => {
let body = response.text().await?;
println!("API response: {}", body);
// Process data here...
// TODO: Parse the response body to a struct
// TODO: Get queued song data
// TODO: Get queued song's metadata
// TODO: Get queued coverart
// TODO: Get queued coverart's data
// TODO: Apply metadata to the queued song
// TODO: Update the queued song with the updated queued song
// TODO: Create song
// TODO: Create coverart
// TODO: Wipe data from queued song
// TODO: Wipe data from queued coverart
}
Err(e) => eprintln!("API call failed: {}", e),
}
println!("Sleeping");
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
}
// Ok(())
}
async fn get_icarus_url() -> String {
dotenvy::dotenv().ok();
std::env::var("ICARUS_BASE_API_URL").expect("Could not find url")
fn main() {
println!("Hello, world!");
}