Fixed errors in foobar reader

This commit is contained in:
G2-Games 2023-12-11 02:30:03 -06:00
parent cab60e1560
commit 5000d24a77
3 changed files with 5 additions and 4 deletions

View file

@ -6,6 +6,7 @@ pub mod music_storage {
pub mod db_reader {
pub mod foobar {
pub mod reader;
pub mod utils;
}
pub mod musicbee {
pub mod reader;

View file

@ -36,7 +36,7 @@ impl ExternalLibrary for FoobarPlaylist {
}
let meta_size = i32::from_le_bytes(get_bytes(&mut buf_iter)) as usize;
let metadata = get_bytes_vec(&mut buf_iter, meta_size);
let metadata = &get_bytes_vec(&mut buf_iter, meta_size);
let track_count = i32::from_le_bytes(get_bytes(&mut buf_iter));
// Read all the track fields
@ -135,7 +135,7 @@ impl ExternalLibrary for FoobarPlaylist {
Self {
songs: retrieved_songs,
metadata,
metadata: metadata.clone(),
}
}
@ -161,7 +161,7 @@ pub struct FoobarPlaylistTrack {
impl FoobarPlaylistTrack {
fn find_song(&self) -> Song {
let location = URI::Local(self.file_name.into());
let location = URI::Local(self.file_name.clone().into());
Song {
location,

View file

@ -1,4 +1,4 @@
pub fn meta_offset(metadata: Vec<u8>, offset: usize) -> String {
pub fn meta_offset(metadata: &Vec<u8>, offset: usize) -> String {
let mut result_vec = Vec::new();
let mut i = offset;