fix some bugs & update

This commit is contained in:
OMGeeky
2024-04-20 18:31:28 +02:00
parent 93f8ea2bd1
commit 9e362e7549
5 changed files with 64 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ async fn run() -> Result<()> {
let conf = Conf::builder()
.env()
.file("./settings.toml")
.file("/home/omgeeky/twba/config.toml")
.file(shellexpand::tilde("~/twba/config.toml").to_string())
.load()
.map_err(|e| {
error!("Failed to load config: {:?}", e);

View File

@@ -36,12 +36,13 @@ impl TwitchClient {
#[tracing::instrument(skip(self))]
pub async fn download_video<VideoId: DIntoString, QUALITY: DIntoString>(
&self,
id: i32,
video_id: VideoId,
quality: QUALITY,
output_folder: &Path,
) -> Result<PathBuf> {
let video_id = video_id.into();
let folder_path = output_folder.join(&video_id);
let folder_path = output_folder.join(id.to_string());
let final_path = output_folder.join(format!("{}.mp4", video_id));
if final_path.exists() {
return Err(DownloadFileError::TargetAlreadyExists(final_path).into());