Merge branch 'master' of github.com:kdeng00/IcarusDownloadManager into update_packages
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "icarus-dm"
|
||||
version = "0.4.0"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
pub const WAV_FILE_EXTENSION: &str = ".wav";
|
||||
pub const FLAC_FILE_EXTENSION: &str = ".flac";
|
||||
pub const _MP3_FILE_EXTENSION: &str = ".mp3";
|
||||
pub const JPG_FILE_EXTENSION: &str = ".jpg";
|
||||
|
||||
@@ -339,7 +339,7 @@ impl CommitManager {
|
||||
filenames.push(s.clone());
|
||||
fp = s.clone();
|
||||
dir = song_file.parent().unwrap().display().to_string();
|
||||
song.filepath = Some(s.clone());
|
||||
song.filename = Some(s.clone());
|
||||
song.directory = Some(dir.clone());
|
||||
self.initialize_disc_and_track(&mut song);
|
||||
}
|
||||
@@ -354,7 +354,7 @@ impl CommitManager {
|
||||
let album = self.retrieve_metadata(&meta_path);
|
||||
let trck = i32::from_str(track_id).unwrap();
|
||||
let mut s = album.retrieve_song(trck, 1).unwrap();
|
||||
s.filepath = Some(fp);
|
||||
s.filename = Some(fp);
|
||||
s.directory = Some(dir);
|
||||
s.genre = Some(album.genre.clone());
|
||||
s.year = Some(album.year.clone());
|
||||
@@ -433,7 +433,7 @@ impl CommitManager {
|
||||
match fname {
|
||||
Ok(s) => {
|
||||
filenames.push(s.clone());
|
||||
song.filepath = Some(s.clone());
|
||||
song.filename = Some(s.clone());
|
||||
song.directory = Some(sourcepath.clone());
|
||||
song.data = Some(song.to_data().unwrap());
|
||||
self.initialize_disc_and_track(&mut song);
|
||||
@@ -513,7 +513,7 @@ impl CommitManager {
|
||||
let mut index = 0;
|
||||
for song in &mut album.songs {
|
||||
let filename = filenames[index].clone();
|
||||
song.filepath = Some(filename);
|
||||
song.filename = Some(filename);
|
||||
index += 1;
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ impl CommitManager {
|
||||
let mut track = 1;
|
||||
let mut mode = 0;
|
||||
let filename =
|
||||
&<std::option::Option<std::string::String> as Clone>::clone(&song.filepath).unwrap();
|
||||
&<std::option::Option<std::string::String> as Clone>::clone(&song.filename).unwrap();
|
||||
|
||||
let trd = filename.contains("trackd");
|
||||
let tr = filename.contains("track");
|
||||
|
||||
+14
-4
@@ -12,13 +12,18 @@ pub struct Song {
|
||||
pub title: Option<String>,
|
||||
pub artist: Option<String>,
|
||||
pub album: Option<String>,
|
||||
pub album_artist: Option<String>,
|
||||
pub genre: Option<String>,
|
||||
pub year: Option<i32>,
|
||||
pub duration: Option<f64>,
|
||||
pub track: Option<i32>,
|
||||
pub disc: Option<i32>,
|
||||
pub disc_count: Option<i32>,
|
||||
pub track_count: Option<i32>,
|
||||
pub date_created: Option<String>,
|
||||
pub filename: Option<String>,
|
||||
pub user_id: Option<i32>,
|
||||
pub data: Option<Vec<u8>>,
|
||||
pub filepath: Option<String>,
|
||||
pub directory: Option<String>,
|
||||
}
|
||||
|
||||
@@ -56,13 +61,18 @@ impl Default for Song {
|
||||
title: None,
|
||||
artist: None,
|
||||
album: None,
|
||||
album_artist: None,
|
||||
genre: None,
|
||||
year: None,
|
||||
duration: None,
|
||||
track: None,
|
||||
disc: None,
|
||||
disc_count: None,
|
||||
track_count: None,
|
||||
date_created: None,
|
||||
filename: None,
|
||||
user_id: None,
|
||||
data: None,
|
||||
filepath: None,
|
||||
directory: None,
|
||||
}
|
||||
}
|
||||
@@ -86,7 +96,7 @@ impl Song {
|
||||
}
|
||||
|
||||
let filename =
|
||||
&<std::option::Option<std::string::String> as Clone>::clone(&self.filepath).unwrap();
|
||||
&<std::option::Option<std::string::String> as Clone>::clone(&self.filename).unwrap();
|
||||
buffer += filename;
|
||||
|
||||
return buffer;
|
||||
@@ -122,7 +132,7 @@ impl Song {
|
||||
filename += constants::file_extensions::WAV_FILE_EXTENSION;
|
||||
}
|
||||
|
||||
self.filepath = Some(filename);
|
||||
self.filename = Some(filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user