Language Migration (#21)

* Blank slate

* Added gitignore

* Updated gitignore

* Added rust code

* Added modules

* Fixed build issues

* rustfmt

* Updated models

* Added parsers module

* Updated utilities module

* Updated main.rs

* Updated api_parser and song model

* Updated icarus_action model

* Updated structs in managers module

* Updated main.rs

* More changes

* Saving changes

* Added new struct and methods

* More changes. Not functional yet

* Changed name of the project

* Removed cmake workflow

* Adding rust workflow

* Adding code to the syncers module

* Cargo formatting

* Continuing work

* Adding code to the syncers module

* Added dependencies

* Adding more code to the syncers module

* Added more code to the syncers module

It's not 100 percent done yet, I'll work on other modules

* Added more code to the managers module

* Added code to request a token

* Cargo formatting

* Adding more code to multi target upload

* Adding more multi-target upload code and formatted code

* Added more multi-upload code

* cargo fmt

* Got uploading functional and cargo fmt-ing

* Uploading multi target works, but is buggy

Not all of the songs are being uploaded

* Added single target upload

* Single target upload is functional but need to revisit multi-target upload

Multi-target upload is broken now. Needs to be revisited

* Fixed multi target upload

* Can now retrieve songs

* Downloading functionality is working

* Delete functionality is operational

* Updated README

* More cleanup

* Added test
This commit was merged in pull request #21.
This commit is contained in:
Kun Deng
2024-06-15 12:22:17 -04:00
committed by GitHub
parent 5e9e7bc46a
commit ee4469b385
79 changed files with 2148 additions and 3376 deletions
+42
View File
@@ -0,0 +1,42 @@
use std::default::Default;
use serde::{Deserialize, Serialize};
use crate::models::{self};
#[derive(Debug, Deserialize, Serialize)]
pub struct UserManager {
pub user: models::user::User,
pub ica_action: models::icarus_action::IcarusAction,
}
impl Default for UserManager {
fn default() -> Self {
UserManager {
user: models::user::User::default(),
ica_action: models::icarus_action::IcarusAction::default(),
}
}
}
impl UserManager {
pub fn retrieve_user(&self) -> models::user::User {
return self.user.clone();
}
pub fn parse_user_from_actions(&mut self) {
let args = &self.ica_action.flags;
for arg in args {
let flag = &arg.flag;
if flag == "-u" {
self.user.username = String::from(&arg.value);
}
if flag == "-p" {
self.user.password = String::from(&arg.value);
}
}
}
}