From ce457fbd178d0c750085a6600ea8cda98e0e5981 Mon Sep 17 00:00:00 2001 From: "Ethan J. Hadley" Date: Fri, 21 Aug 2026 12:47:38 -0600 Subject: [PATCH] Fixed leading underscore issue --- src/utils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index d49b187..bacfe86 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -26,6 +26,7 @@ auto ytdlp(const std::string& args) -> bool { auto metadata(const std::string& file, const std::string& artist, const std::string& album, size_t index) -> void { std::string name = std::filesystem::path(file).filename().string(); name = std::regex_replace(name, std::regex(".mp3"), ""); + name.erase(0, 1); // Remove leading underscore system(std::format("{} " "-hide_banner -loglevel error " @@ -39,7 +40,7 @@ auto metadata(const std::string& file, const std::string& artist, const std::str "-metadata artist=\"{}\" " "-metadata album=\"{}\" " "-metadata track=\"{}\" " - "\"{}/_{}.mp3\"", + "\"{}/{}.mp3\"", BIN_FFMPEG, file, TMP_DOWNLOAD_FOLDER, name, artist, album, index, TMP_DOWNLOAD_FOLDER, name) .c_str()); } @@ -100,7 +101,7 @@ auto downloadVideo(const std::string& url) -> bool { "--quiet " "-f \"bestaudio/best\" " "-x --audio-format mp3 " - "-o \"{}/%(title)s.%(ext)s\" " + "-o \"{}/_%(title)s.%(ext)s\" " "{}", BIN_DENO, TMP_DOWNLOAD_FOLDER, url)); @@ -178,7 +179,6 @@ auto writeMetadataToTmpFolder(const std::string& artist, const std::string& albu metadata(entry.path().string(), artist, album, index); printf("Finished writting metadata for %s.\n", entry.path().string().c_str()); std::filesystem::remove(entry.path().string()); - // TODO rename without underscore index++; } }