Compare commits

...

12 Commits

Author SHA1 Message Date
569fb632e5 Merge pull request 'v0.5.X release' (#41) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 30s
Rust Build / Rustfmt (push) Successful in 30s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 27s
Reviewed-on: #41
2025-07-23 21:59:40 +00:00
7839c64561 Version bump (#48)
All checks were successful
Rust Build / build (push) Successful in 30s
Rust Build / Test Suite (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 25s
Release Tagging / release (push) Successful in 28s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 26s
Reviewed-on: #48
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-23 21:54:10 +00:00
655d05dabb Coverart ignore data for json usage (#47)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 25s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Rust Build / build (pull_request) Successful in 29s
Rust Build / Check (pull_request) Successful in 29s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 27s
Reviewed-on: #47
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-07-14 23:57:00 +00:00
7958b89abc Update readme (#46)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 28s
Rust Build / Rustfmt (push) Successful in 27s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 38s
Rust Build / Test Suite (pull_request) Successful in 40s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Successful in 52s
Rust Build / build (pull_request) Successful in 43s
Reviewed-on: #46
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 18:14:18 +00:00
c0d23e0640 Version bump (#45)
All checks were successful
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 29s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 28s
Release Tagging / release (push) Successful in 31s
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Successful in 27s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 28s
Reviewed-on: #45
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 18:02:23 +00:00
1a64b512f4 Removing some code (#44)
All checks were successful
Release Tagging / release (push) Successful in 30s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 27s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Rust Build / Check (pull_request) Successful in 28s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 28s
Rust Build / build (pull_request) Successful in 26s
Taking out code that wasn't being used and was commented.

Reviewed-on: #44
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-06-29 17:54:23 +00:00
6aa4c3d741 Merge pull request 'Next release' (#38) from devel into main
All checks were successful
Release Tagging / release (push) Successful in 42s
Rust Build / Check (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 39s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 37s
Rust Build / build (push) Successful in 30s
Rust Build / Check (pull_request) Successful in 27s
Rust Build / Test Suite (pull_request) Successful in 25s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 27s
Rust Build / build (pull_request) Successful in 26s
Reviewed-on: #38
2025-04-10 23:49:19 +00:00
97853a42c1 Merge pull request 'workflow_tag_fix (#33)' (#34) from devel into main
All checks were successful
Release Tagging / release (push) Successful in 32s
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 32s
Rust Build / Rustfmt (push) Successful in 32s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 33s
Reviewed-on: #34
2025-04-07 01:09:43 +00:00
fdae8056b1 Merge pull request 'Next release' (#30) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 30s
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 29s
Rust Build / Clippy (push) Successful in 30s
Rust Build / build (push) Successful in 30s
Release Tagging / release (push) Successful in 34s
Reviewed-on: #30
2025-04-05 18:38:37 +00:00
24aa60cb48 Merge pull request 'Next release' (#25) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 28s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 30s
Release Tagging / release (push) Successful in 34s
Reviewed-on: #25
2025-04-04 04:08:03 +00:00
d8eadb8187 Merge pull request 'v0.2.0 Release' (#20) from devel into main
Some checks failed
Rust Build / Check (push) Successful in 28s
Rust Build / Test Suite (push) Successful in 31s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 28s
Rust Build / build (push) Successful in 27s
Release Tagging / release (push) Failing after 34s
Reviewed-on: phoenix/icarus-models#20
2025-03-30 17:21:27 +00:00
2b2e96c02d Merge pull request 'devel' (#16) from devel into main
All checks were successful
Rust Build / Check (push) Successful in 26s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 26s
Rust Build / build (push) Successful in 26s
Release Tagging / release (push) Successful in 28s
Reviewed-on: phoenix/icarus-models#16
2025-03-22 21:24:15 +00:00
6 changed files with 6 additions and 154 deletions

View File

@@ -3,7 +3,6 @@ name: Release Tagging
on: on:
push: push:
branches: branches:
- main
- devel - devel
jobs: jobs:
@@ -50,6 +49,3 @@ jobs:
release_name: Release ${{ steps.version.outputs.project_tag_release }} release_name: Release ${{ steps.version.outputs.project_tag_release }}
body: | body: |
Release of version ${{ steps.version.outputs.project_tag_release }} Release of version ${{ steps.version.outputs.project_tag_release }}
# draft: false
# prerelease: ${{ startsWith(github.ref, 'v') == false }} # prerelease if not a valid release tag

2
Cargo.lock generated
View File

@@ -60,7 +60,7 @@ dependencies = [
[[package]] [[package]]
name = "icarus_models" name = "icarus_models"
version = "0.4.3" version = "0.5.0"
dependencies = [ dependencies = [
"rand", "rand",
"serde", "serde",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "icarus_models" name = "icarus_models"
version = "0.4.3" version = "0.5.0"
edition = "2024" edition = "2024"
rust-version = "1.88" rust-version = "1.88"
description = "models used for the icarus project" description = "models used for the icarus project"

View File

@@ -0,0 +1,2 @@
A library containing commonly used models and functions that is used throughout
icarus projects. This reduces the amount of duplicated code without a benefit.

View File

@@ -7,6 +7,7 @@ pub struct CoverArt {
pub id: uuid::Uuid, pub id: uuid::Uuid,
pub title: String, pub title: String,
pub path: String, pub path: String,
#[serde(skip)]
pub data: Vec<u8>, pub data: Vec<u8>,
} }

View File

@@ -46,6 +46,7 @@ pub struct Song {
pub data: Vec<u8>, pub data: Vec<u8>,
#[serde(skip)] #[serde(skip)]
pub directory: String, pub directory: String,
// TODO: Think about what to do with this
// #[serde(skip)] // #[serde(skip)]
// pub album_id: i32, // pub album_id: i32,
// #[serde(skip)] // #[serde(skip)]
@@ -150,151 +151,3 @@ impl Song {
filename filename
} }
} }
/*
mod embedded {
use std::io::Read;
use serde::{Deserialize, Serialize};
impl Song {
pub fn to_metadata_json(&self, pretty: bool) -> Result<String, serde_json::Error> {
if pretty {
serde_json::to_string_pretty(&self)
} else {
serde_json::to_string(&self)
}
}
pub fn song_path(&self) -> Result<String, std::io::Error> {
if self.directory.is_empty() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Directory does not exist",
));
}
let directory = &self.directory;
let mut buffer: String = directory.clone();
let last_index = directory.len() - 1;
if let Some(character) = directory.chars().nth(last_index) {
if character != '/' {
buffer += "/";
}
buffer += &self.filename.clone();
Ok(buffer)
} else {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Could not access last character of directory",
))
}
}
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
let path_result = self.song_path();
match path_result {
Ok(path) => {
let mut file = std::fs::File::open(path)?;
let mut buffer: Vec<u8> = Vec::new();
file.read_to_end(&mut buffer)?;
if buffer.is_empty() {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"File is empty",
))
} else {
Ok(buffer)
}
}
Err(er) => Err(er),
}
}
}
// The song's duration is a floating point in seconds
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Song {
#[serde(skip_serializing_if = "init::is_uuid_nil")]
#[serde(alias = "id")]
pub id: uuid::Uuid,
#[serde(skip_serializing_if = "String::is_empty")]
pub title: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub artist: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub album_artist: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub genre: String,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub year: i32,
#[serde(skip_serializing_if = "init::is_embed_dur_not_set")]
pub duration: f64,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub track: i32,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub disc: i32,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub disc_count: i32,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub track_count: i32,
#[serde(skip_serializing_if = "String::is_empty")]
pub audio_type: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub date_created: String,
#[serde(skip_serializing_if = "String::is_empty")]
pub filename: String,
#[serde(skip_serializing_if = "init::is_embed_zero")]
pub user_id: i32,
#[serde(skip)]
pub data: Vec<u8>,
#[serde(skip)]
pub directory: String,
// #[serde(skip)]
// pub album_id: i32,
// #[serde(skip)]
// pub artist_id: i32,
// #[serde(skip)]
// pub genre_id: i32,
// #[serde(skip)]
// pub coverart_id: i32,
}
impl Default for Song {
fn default() -> Self {
Song {
id: uuid::Uuid::nil(),
title: String::new(),
artist: String::new(),
album: String::new(),
album_artist: String::new(),
genre: String::new(),
year: 0,
duration: 0.0,
track: 0,
disc: 0,
disc_count: 0,
track_count: 0,
audio_type: String::new(),
date_created: String::new(),
filename: String::new(),
user_id: 0,
data: Vec::new(),
directory: String::new(),
// album_id: 0,
// artist_id: 0,
// genre_id: 0,
// coverart_id: 0,
}
}
}
}
*/