Beispiel #1
0
        public void FolderButtonClick()
        {
            var pathToAudioFolder = ApplicationPaths.GetAudioPath();

            Directory.CreateDirectory(pathToAudioFolder);
            Process.Start(pathToAudioFolder);
        }
Beispiel #2
0
        private static string GenerateConstantCommand(string date, string escapedDownloadLink, string quality, string selectedQuatiy)
        {
            var metadata               = " --ignore-errors --no-mtime --add-metadata ";
            var title                  = "-%(playlist_index)s-%(title)s-%(id)s.%(ext)s ";
            var pathToAudioFolder      = ApplicationPaths.GetAudioPath();
            var pathToAudioVideoFolder = ApplicationPaths.AudioVideoPath;

            if (selectedQuatiy != null)
            {
                return(metadata + "--restrict-filenames -o " + pathToAudioVideoFolder + date + title + escapedDownloadLink);
            }
            if (quality == null)
            {
                return(metadata + "--restrict-filenames -o " + pathToAudioFolder + date + title + escapedDownloadLink);
            }
            return(metadata + "--audio-quality " + quality + " --restrict-filenames -o " + pathToAudioFolder + date + "Q" + quality + title + escapedDownloadLink);
        }
Beispiel #3
0
        private (string fileName, double fileSize) GetFileNameAndSize(string selectedQuality)
        {
            string path      = selectedQuality.Contains("video") ? ApplicationPaths.AudioVideoPath : ApplicationPaths.GetAudioPath();
            var    directory = new DirectoryInfo(path);
            var    myFile    = directory.GetFiles()
                               .OrderByDescending(f => f.LastWriteTime)
                               .FirstOrDefault();

            var length = new FileInfo(path + myFile.ToString()).Length;

            return(fileName : myFile.ToString(), fileSize : ConvertBytesToMegabytes(length));
        }