Fixed build issues
This commit is contained in:
@@ -3,6 +3,9 @@ name = "IcarusDownloadManager"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
+8
-9
@@ -4,11 +4,6 @@ mod models;
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
||||||
// use managers::{ActionManager};
|
|
||||||
use crate::src::managers::{ActionManager, CommitManager};
|
|
||||||
// use models::{user, upload_form};
|
|
||||||
|
|
||||||
// use models::
|
|
||||||
|
|
||||||
|
|
||||||
fn exit_program(code: i32) {
|
fn exit_program(code: i32) {
|
||||||
@@ -65,19 +60,23 @@ fn main() {
|
|||||||
exit_program(-1);
|
exit_program(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let act_mgr = ActionManager {
|
let act_mgr = managers::action_managers::ActionManager {
|
||||||
// let act_mgr = crate::src::managers::ActionManager {
|
|
||||||
action: String::from(""),
|
action: String::from(""),
|
||||||
flags: Vec::new(),
|
flags: Vec::new(),
|
||||||
params: args,
|
params: args,
|
||||||
param_count: args.len(),
|
param_count: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
let chosen_act = act_mgr.retrieve_icarus_action();
|
let chosen_act = act_mgr.retrieve_icarus_action();
|
||||||
|
|
||||||
chosen_act.print_action_and_flags();
|
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();
|
cmt_mgr.commit_action();
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod managers {
|
use crate::models;
|
||||||
|
|
||||||
|
// mod managers {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct ActionManager {
|
pub struct ActionManager {
|
||||||
action: String,
|
pub action: String,
|
||||||
flags: Vec<models::Flags>,
|
pub flags: Vec<models::flags::Flags>,
|
||||||
params: Vec<String>,
|
pub params: Vec<String>,
|
||||||
param_count: i32,
|
pub param_count: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ActionManager {
|
impl ActionManager {
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
pub fn retrieve_icarus_action(&self) -> models::IcarusAction {
|
pub fn retrieve_icarus_action(&self) -> models::icarus_action::IcarusAction {
|
||||||
return models::IcarusAction {
|
return models::icarus_action::IcarusAction {
|
||||||
action: String::from(""),
|
action: String::from(""),
|
||||||
flags: Vec::new(),
|
flags: Vec::new(),
|
||||||
};
|
};
|
||||||
@@ -52,4 +54,4 @@ impl ActionManager {
|
|||||||
return Vec::new();
|
return Vec::new();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -2,15 +2,17 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod managers {
|
use crate::models;
|
||||||
|
|
||||||
|
// mod managers {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct CommitManager {
|
pub struct CommitManager {
|
||||||
action: String,
|
pub action: String,
|
||||||
flags: Vec<models::Flags>,
|
pub flags: Vec<models::flags::Flags>,
|
||||||
params: Vec<String>,
|
pub params: Vec<String>,
|
||||||
param_count: i32,
|
pub param_count: i32,
|
||||||
ica_action: models::IcarusAction,
|
pub ica_action: models::icarus_action::IcarusAction,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Album {
|
pub struct Album {
|
||||||
@@ -20,7 +22,7 @@ pub struct Album {
|
|||||||
pub year: i32,
|
pub year: i32,
|
||||||
pub track_count: i32,
|
pub track_count: i32,
|
||||||
pub disc_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
|
// TODO: Implement
|
||||||
fn parse_token(&self, api: &models::API) {
|
fn parse_token(&self, api: &models::api::API) {
|
||||||
}
|
}
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
fn upload_song_with_metadata(&self) {
|
fn upload_song_with_metadata(&self) {
|
||||||
@@ -66,17 +68,17 @@ impl CommitManager {
|
|||||||
fn multi_target_upload(&self, sourcepath: &String) {
|
fn multi_target_upload(&self, sourcepath: &String) {
|
||||||
}
|
}
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
fn initialize_disc_and_track(&self, song: &Song) {
|
fn initialize_disc_and_track(&self, song: &models::song::Song) {
|
||||||
}
|
}
|
||||||
// TODO: Implement
|
// 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
|
// TODO: Implement
|
||||||
fn check_for_no_confirm(&self) -> bool {
|
fn check_for_no_confirm(&self) -> bool {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
fn retrieve_metadata(&self, path: &String) -> models::Album {
|
fn retrieve_metadata(&self, path: &String) -> Album {
|
||||||
return Album {
|
return Album {
|
||||||
title: String::from(""),
|
title: String::from(""),
|
||||||
album_artist: String::from(""),
|
album_artist: String::from(""),
|
||||||
@@ -92,4 +94,4 @@ impl CommitManager {
|
|||||||
return String::from("");
|
return String::from("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
pub mod action_managers;
|
||||||
|
pub mod commit_manager;
|
||||||
|
pub mod user_manager;
|
||||||
@@ -1,17 +1,19 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod managers {
|
use crate::models;
|
||||||
|
|
||||||
|
// mod managers {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct UserManager {
|
pub struct UserManager {
|
||||||
user: models::User,
|
user: models::user::User,
|
||||||
ica_action: models::IcarusAction,
|
ica_action: models::icarus_action::IcarusAction,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UserManager {
|
impl UserManager {
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
pub fn retrieve_user(&self) -> models::User {
|
pub fn retrieve_user(&self) -> models::user::User {
|
||||||
return models::User {
|
return models::user::User {
|
||||||
username: String::from(""),
|
username: String::from(""),
|
||||||
password: String::from(""),
|
password: String::from(""),
|
||||||
};
|
};
|
||||||
@@ -21,4 +23,4 @@ impl UserManager {
|
|||||||
fn parse_user_from_actions(&self) {
|
fn parse_user_from_actions(&self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod models {
|
// mod models {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct API {
|
pub struct API {
|
||||||
@@ -8,4 +8,4 @@ pub struct API {
|
|||||||
pub endpoint: String,
|
pub endpoint: String,
|
||||||
pub version: String,
|
pub version: String,
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod models {
|
// mod models {
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct Flags {
|
pub struct Flags {
|
||||||
pub flag: String,
|
pub flag: String,
|
||||||
pub value: String,
|
pub value: String,
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod models {
|
use crate::models;
|
||||||
|
|
||||||
|
// mod models {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct IcarusAction {
|
pub struct IcarusAction {
|
||||||
pub action: String,
|
pub action: String,
|
||||||
pub flags: Vec<models::Flags>,
|
pub flags: Vec<models::flags::Flags>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IcarusAction {
|
impl IcarusAction {
|
||||||
@@ -18,4 +20,4 @@ impl IcarusAction {
|
|||||||
pub fn print_action_and_flags(&self) {
|
pub fn print_action_and_flags(&self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -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
@@ -1,6 +1,6 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod models {
|
// mod models {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct Song {
|
pub struct Song {
|
||||||
@@ -9,7 +9,7 @@ pub struct Song {
|
|||||||
pub artist: String,
|
pub artist: String,
|
||||||
pub album: String,
|
pub album: String,
|
||||||
pub genre: String,
|
pub genre: String,
|
||||||
pub year: int,
|
pub year: i32,
|
||||||
pub duration: f64,
|
pub duration: f64,
|
||||||
pub track: i32,
|
pub track: i32,
|
||||||
pub disc: i32,
|
pub disc: i32,
|
||||||
@@ -48,4 +48,4 @@ pub struct CoverArt {
|
|||||||
pub title: String,
|
pub title: String,
|
||||||
pub path: String,
|
pub path: String,
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod models {
|
// mod models {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct Token {
|
pub struct Token {
|
||||||
@@ -8,4 +8,4 @@ pub struct Token {
|
|||||||
pub token_type: String,
|
pub token_type: String,
|
||||||
pub expiration: i32,
|
pub expiration: i32,
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod models {
|
// mod models {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct UploadForm {
|
pub struct UploadForm {
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub filepath: String,
|
pub filepath: String,
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
+2
-3
@@ -1,10 +1,9 @@
|
|||||||
|
// mod models {
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod models {
|
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
pub mod api_parser;
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
pub mod delete;
|
||||||
|
pub mod download;
|
||||||
|
pub mod retrieve_records;
|
||||||
|
pub mod syncer_base;
|
||||||
|
pub mod upload;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod utilities {
|
// mod utilities {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct Checks {
|
pub struct Checks {
|
||||||
@@ -24,4 +24,4 @@ impl Checks {
|
|||||||
return String::from("");
|
return String::from("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod utilities {
|
// mod utilities {
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct Conversions {
|
pub struct Conversions {
|
||||||
@@ -20,4 +20,4 @@ impl Conversions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
// }
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
pub mod checks;
|
||||||
|
pub mod conversions;
|
||||||
Reference in New Issue
Block a user