diff --git a/TODO.txt b/TODO.txt index 0b7535c..7cb966e 100644 --- a/TODO.txt +++ b/TODO.txt @@ -11,4 +11,5 @@ key: + = to add, - = to remove, x = completed, # = comment +Replace spaces in file name with dashes/underscores +Make cancel button exit in url dialog +Create dialog asking to play finished file or not ++Display current action in progressbar instead of youtube link itself #possibly more later diff --git a/mandy.lua b/mandy.lua index e5a9fad..4a60f7a 100644 --- a/mandy.lua +++ b/mandy.lua @@ -33,7 +33,8 @@ end function set_dir() getPath = iup.filedlg{dialogtype = "SAVE", title="Save file...", filter="*.mp3", filterinfo="mp3", - directory="~/Music"} + directory="Music/", + file="*.mp3"} getPath:popup(iup.ANYWHERE, iup.ANYWHERE) @@ -78,9 +79,17 @@ end function ffmpeg(tmpPath, dirD) - mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..dirD..".mp3" - os.execute(mp3) - io.popen("vlc "..dirD..".mp3") + if dirD == dirD..".mp3" then + dirD = dirD + mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y "..dirD.."" + os.execute(mp3) + io.popen("vlc "..dirD) + elseif dirD ~= dirD..".mp3" then + dirD = dirD..".mp3" + mp3 = "ffmpeg -i "..tmpPath.." -acodec libmp3lame -ac 2 -ab 192k -vn -y"..dirD.."" + os.execute(mp3) + io.popen("vlc "..dirD) + end end --put everything into a table to use local functions globally