Fixed build issues

This commit is contained in:
kdeng00
2024-04-07 22:41:46 -04:00
parent 0e76c6d4c7
commit 2377178492
19 changed files with 89 additions and 62 deletions
+8 -9
View File
@@ -4,11 +4,6 @@ mod models;
use std::env;
use std::process;
// use managers::{ActionManager};
use crate::src::managers::{ActionManager, CommitManager};
// use models::{user, upload_form};
// use models::
fn exit_program(code: i32) {
@@ -65,19 +60,23 @@ fn main() {
exit_program(-1);
}
let act_mgr = ActionManager {
// let act_mgr = crate::src::managers::ActionManager {
let act_mgr = managers::action_managers::ActionManager {
action: String::from(""),
flags: Vec::new(),
params: args,
param_count: args.len(),
param_count: 2,
};
let chosen_act = act_mgr.retrieve_icarus_action();
chosen_act.print_action_and_flags();
let cmt_mgr = CommitManager {
let cmt_mgr = managers::commit_manager::CommitManager {
action: String::from(""),
flags: Vec::new(),
params: Vec::new(),
param_count: 1,
ica_action: chosen_act,
};
cmt_mgr.commit_action();
+10 -8
View File
@@ -1,19 +1,21 @@
use serde::{Deserialize, Serialize};
mod managers {
use crate::models;
// mod managers {
#[derive(Debug, Deserialize, Serialize)]
pub struct ActionManager {
action: String,
flags: Vec<models::Flags>,
params: Vec<String>,
param_count: i32,
pub action: String,
pub flags: Vec<models::flags::Flags>,
pub params: Vec<String>,
pub param_count: i32,
}
impl ActionManager {
// TODO: Implement
pub fn retrieve_icarus_action(&self) -> models::IcarusAction {
return models::IcarusAction {
pub fn retrieve_icarus_action(&self) -> models::icarus_action::IcarusAction {
return models::icarus_action::IcarusAction {
action: String::from(""),
flags: Vec::new(),
};
@@ -52,4 +54,4 @@ impl ActionManager {
return Vec::new();
}
}
}
// }
+14 -12
View File
@@ -2,15 +2,17 @@ use std::collections::HashMap;
use serde::{Deserialize, Serialize};
mod managers {
use crate::models;
// mod managers {
#[derive(Debug, Deserialize, Serialize)]
pub struct CommitManager {
action: String,
flags: Vec<models::Flags>,
params: Vec<String>,
param_count: i32,
ica_action: models::IcarusAction,
pub action: String,
pub flags: Vec<models::flags::Flags>,
pub params: Vec<String>,
pub param_count: i32,
pub ica_action: models::icarus_action::IcarusAction,
}
pub struct Album {
@@ -20,7 +22,7 @@ pub struct Album {
pub year: i32,
pub track_count: i32,
pub disc_count: i32,
pub songs: Vec<models::Song>,
pub songs: Vec<models::song::Song>,
}
@@ -53,7 +55,7 @@ impl CommitManager {
}
// TODO: Implement
fn parse_token(&self, api: &models::API) {
fn parse_token(&self, api: &models::api::API) {
}
// TODO: Implement
fn upload_song_with_metadata(&self) {
@@ -66,17 +68,17 @@ impl CommitManager {
fn multi_target_upload(&self, sourcepath: &String) {
}
// TODO: Implement
fn initialize_disc_and_track(&self, song: &Song) {
fn initialize_disc_and_track(&self, song: &models::song::Song) {
}
// TODO: Implement
fn parse_disc_and_track(&self, song: &Song, track_id: &String) {
fn parse_disc_and_track(&self, song: &models::song::Song, track_id: &String) {
}
// TODO: Implement
fn check_for_no_confirm(&self) -> bool {
return false;
}
// TODO: Implement
fn retrieve_metadata(&self, path: &String) -> models::Album {
fn retrieve_metadata(&self, path: &String) -> Album {
return Album {
title: String::from(""),
album_artist: String::from(""),
@@ -92,4 +94,4 @@ impl CommitManager {
return String::from("");
}
}
}
// }
+3
View File
@@ -0,0 +1,3 @@
pub mod action_managers;
pub mod commit_manager;
pub mod user_manager;
+8 -6
View File
@@ -1,17 +1,19 @@
use serde::{Deserialize, Serialize};
mod managers {
use crate::models;
// mod managers {
#[derive(Debug, Deserialize, Serialize)]
pub struct UserManager {
user: models::User,
ica_action: models::IcarusAction,
user: models::user::User,
ica_action: models::icarus_action::IcarusAction,
}
impl UserManager {
// TODO: Implement
pub fn retrieve_user(&self) -> models::User {
return models::User {
pub fn retrieve_user(&self) -> models::user::User {
return models::user::User {
username: String::from(""),
password: String::from(""),
};
@@ -21,4 +23,4 @@ impl UserManager {
fn parse_user_from_actions(&self) {
}
}
}
// }
+2 -2
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
mod models {
// mod models {
#[derive(Debug, Deserialize, Serialize)]
pub struct API {
@@ -8,4 +8,4 @@ pub struct API {
pub endpoint: String,
pub version: String,
}
}
// }
+2 -2
View File
@@ -1,9 +1,9 @@
use serde::{Deserialize, Serialize};
mod models {
// mod models {
#[derive(Debug, Deserialize, Serialize)]
pub struct Flags {
pub flag: String,
pub value: String,
}
}
// }
+5 -3
View File
@@ -1,11 +1,13 @@
use serde::{Deserialize, Serialize};
mod models {
use crate::models;
// mod models {
#[derive(Debug, Deserialize, Serialize)]
pub struct IcarusAction {
pub action: String,
pub flags: Vec<models::Flags>,
pub flags: Vec<models::flags::Flags>,
}
impl IcarusAction {
@@ -18,4 +20,4 @@ impl IcarusAction {
pub fn print_action_and_flags(&self) {
}
}
}
// }
+7
View File
@@ -0,0 +1,7 @@
pub mod api;
pub mod flags;
pub mod icarus_action;
pub mod song;
pub mod token;
pub mod upload_form;
pub mod user;
+3 -3
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
mod models {
// mod models {
#[derive(Debug, Deserialize, Serialize)]
pub struct Song {
@@ -9,7 +9,7 @@ pub struct Song {
pub artist: String,
pub album: String,
pub genre: String,
pub year: int,
pub year: i32,
pub duration: f64,
pub track: i32,
pub disc: i32,
@@ -48,4 +48,4 @@ pub struct CoverArt {
pub title: String,
pub path: String,
}
}
// }
+2 -2
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
mod models {
// mod models {
#[derive(Debug, Deserialize, Serialize)]
pub struct Token {
@@ -8,4 +8,4 @@ pub struct Token {
pub token_type: String,
pub expiration: i32,
}
}
// }
+2 -2
View File
@@ -1,10 +1,10 @@
use serde::{Deserialize, Serialize};
mod models {
// mod models {
#[derive(Debug, Deserialize, Serialize)]
pub struct UploadForm {
pub url: String,
pub filepath: String,
}
}
// }
+8 -9
View File
@@ -1,10 +1,9 @@
use serde::{Deserialize, Serialize};
// mod models {
use serde::{Deserialize, Serialize};
mod models {
#[derive(Debug, Deserialize, Serialize)]
pub struct User {
pub username: String,
pub password: String,
}
}
#[derive(Debug, Deserialize, Serialize)]
pub struct User {
pub username: String,
pub password: String,
}
// }
+1
View File
@@ -0,0 +1 @@
pub mod api_parser;
+5
View File
@@ -0,0 +1,5 @@
pub mod delete;
pub mod download;
pub mod retrieve_records;
pub mod syncer_base;
pub mod upload;
+2 -2
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
mod utilities {
// mod utilities {
#[derive(Debug, Deserialize, Serialize)]
pub struct Checks {
@@ -24,4 +24,4 @@ impl Checks {
return String::from("");
}
}
}
// }
+2 -2
View File
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
mod utilities {
// mod utilities {
#[derive(Debug, Deserialize, Serialize)]
pub struct Conversions {
@@ -20,4 +20,4 @@ impl Conversions {
}
}
}
// }
+2
View File
@@ -0,0 +1,2 @@
pub mod checks;
pub mod conversions;