Exemplo n.º 1
0
        public void AddEntry <T>(T download, DownloadSettings settings, string fileName) where T : IDownloadable, IMusicInformation
        {
            HasEntries = true;
            var entry = new DownloadEntry
            {
                IsWaiting         = true,
                DownloadFilename  = fileName,
                Trackname         = download.DownloadFilename,
                DownloadParameter = download.DownloadParameter,
                DownloadMethod    = download.DownloadMethod,
                MusicInformation  = download,
                DownloadSettings  = settings.Clone()
            };

            Entries.Add(entry);
            _hasToCheck = true;
            DownloadTracks();
        }
Exemplo n.º 2
0
        public void AddEntry <T>(T download) where T : IDownloadable, IMusicInformation
        {
            HasEntries = true;
            var downloadDirectory = new DirectoryInfo(DownloadDirectory);

            if (!downloadDirectory.Exists)
            {
                downloadDirectory.Create();
            }
            var entry = new DownloadEntry
            {
                IsWaiting         = true,
                DownloadFilename  = Path.Combine(downloadDirectory.FullName, Utilities.GeneralHelper.EscapeFilename(download.DownloadFilename)),
                Trackname         = download.DownloadFilename,
                DownloadParameter = download.DownloadParameter,
                DownloadMethod    = download.DownloadMethod,
                MusicInformation  = download
            };

            Entries.Add(entry);
            _hasToCheck = true;
            DownloadTracks();
        }