Actually usable????????//

This commit is contained in:
2024-11-21 05:02:30 +02:00
parent b1c8417b0f
commit 4ee4ca1add
26 changed files with 2339 additions and 356 deletions

View File

@@ -108,11 +108,12 @@ impl SongCacheDl {
}
let mut from = song_p.clone();
from.pop();
from.push("{song_format}.{song_format}");
from.push(format!("{song_format}.{song_format}"));
let mut to = song_p.clone();
to.pop();
to.set_extension(&song_format);
log::debug!("from: {from:?} to: {to:?}");
std::fs::copy(&from, &to).unwrap();
from.pop();
std::fs::remove_dir_all(from).unwrap();

View File

@@ -1,6 +1,5 @@
use std::{collections::HashMap, str::FromStr, sync::{mpsc::{self, Receiver, Sender}, Arc, Mutex, MutexGuard}, time::Duration};
use downloader::song::SongStatus;
use log::warn;
use xmpd_manifest::song::Song;
pub mod downloader;
@@ -106,7 +105,6 @@ fn start_cache_mv_thread(tx: Sender<Message>) {
song_p.push("songs");
song_p.push(sid.clone().to_string());
let song_p = song_p.with_extension(&song_format);
log::debug!("Found done: {:?}: {}", song_p, song_p.exists());
if song_p.exists() {
let _ = tx.send(Message::DownloadDone(sid.clone()));
cache.song_cache.insert(sid.clone(), DlStatus::Done(song_p));