Compare commits
2 Commits
dev-v0.1.1
...
dev-v0.1.1
Author | SHA1 | Date | |
---|---|---|---|
47f336d04d | |||
e497ce11e0 |
@@ -1,5 +1,5 @@
|
||||
pub const DEFAULT_MUSIC_EXTENSION: &str = FLAC_EXTENSION;
|
||||
pub const FLAC_EXTENSION: &str = ".flac";
|
||||
pub const WAV_EXTENSION: &str = ".wav";
|
||||
pub const MPTHREE_EXTENSION: &str = ".mp3";
|
||||
pub const JPG_EXTENSION: &str = ".jpg";
|
||||
pub const DEFAULTMUSICEXTENSION: &str = FLACEXTENSION;
|
||||
pub const FLACEXTENSION: &str = ".flac";
|
||||
pub const WAVEXTENSION: &str = ".wav";
|
||||
pub const MPTHREEEXTENSION: &str = ".mp3";
|
||||
pub const JPGEXTENSION: &str = ".jpg";
|
||||
|
16
src/song.rs
16
src/song.rs
@@ -108,9 +108,9 @@ impl Song {
|
||||
|
||||
let directory = &self.directory;
|
||||
let mut buffer: String = String::from(directory.clone());
|
||||
let lastIndex = directory.len() - 1;
|
||||
let last_index = directory.len() - 1;
|
||||
|
||||
if let Some(character) = directory.chars().nth(lastIndex) {
|
||||
if let Some(character) = directory.chars().nth(last_index) {
|
||||
if character != '/' {
|
||||
buffer += "/";
|
||||
}
|
||||
@@ -127,9 +127,9 @@ impl Song {
|
||||
}
|
||||
|
||||
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
|
||||
let pathResult = self.song_path();
|
||||
let path_result = self.song_path();
|
||||
|
||||
match pathResult {
|
||||
match path_result {
|
||||
Ok(path) => {
|
||||
let mut file = std::fs::File::open(path)?;
|
||||
let mut buffer: Vec<u8> = Vec::new();
|
||||
@@ -175,9 +175,9 @@ mod embedded {
|
||||
|
||||
let directory = &self.directory;
|
||||
let mut buffer: String = String::from(directory.clone());
|
||||
let lastIndex = directory.len() - 1;
|
||||
let last_index = directory.len() - 1;
|
||||
|
||||
if let Some(character) = directory.chars().nth(lastIndex) {
|
||||
if let Some(character) = directory.chars().nth(last_index) {
|
||||
if character != '/' {
|
||||
buffer += "/";
|
||||
}
|
||||
@@ -194,9 +194,9 @@ mod embedded {
|
||||
}
|
||||
|
||||
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
|
||||
let pathResult = self.song_path();
|
||||
let path_result = self.song_path();
|
||||
|
||||
match pathResult {
|
||||
match path_result {
|
||||
Ok(path) => {
|
||||
let mut file = std::fs::File::open(path)?;
|
||||
let mut buffer: Vec<u8> = Vec::new();
|
||||
|
@@ -58,7 +58,13 @@ impl Token {
|
||||
}
|
||||
|
||||
// TODO: Implement
|
||||
pub fn contains_scope(&self, des_scope: String) -> bool {
|
||||
pub fn contains_scope(&self, des_scope: &String) -> bool {
|
||||
let extracted_token: String = String::from("Token");
|
||||
|
||||
if extracted_token == *des_scope {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,8 @@
|
||||
use std::default::Default;
|
||||
|
||||
mod types {
|
||||
pub enum Types {
|
||||
WAV_EXTENSION,
|
||||
FLAC_EXTENSION,
|
||||
MP_EXTENSION,
|
||||
WavExtension,
|
||||
FlacExtension,
|
||||
MPThreeExtension,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user