AlexxEG/YouTube-Downloader

Delete part downloaded video

Closed this issue · 10 comments

Need to delete part downloaded single video when stoped.

How do I check for file existence while downloading playlist

What do you mean?

i mean checking for video if already exists in the download directory for the playlist

Ah, currently the program just overwrites without asking the user.

I'm thinking about appending a number instead, so if there already is a file with the same name the new file will be named "File (1)" for example.

what i suggest is, if video already exists it should not be list in playlist listview

Oh I understand now. That is a good idea. I'll implement that.

I think i found the solution for this

?

right now i am too busy, i will let u know tommorrow

this is my approach under _backgroundWorkerPlaylist_RunWorkerCompleted
`bool result = (bool)e.Result;

            _playlistCancel = false;
            btnGetPlaylist.Text = "Get";
            btnPlaylistDownloadAll.Enabled = result;
            btnPlaylistDownloadSelected.Enabled = result;
            lvPlaylistVideos.UseWaitCursor = false;

                foreach (string file in Directory.GetFiles(cbPlaylistSaveTo.Text))
                {
                    FileInfo f = new FileInfo(Path.GetFileNameWithoutExtension(file));
                    foreach (ListViewItem item in lvPlaylistVideos.Items)
                    {
                        FileInfo ff = new FileInfo(Path.GetFileNameWithoutExtension(item.Text));
                        if (f.Name == ff.Name)
                            lvPlaylistVideos.Items.Remove(item);
                    }
                }

            if (!result)
            {
                lvPlaylistVideos.Items.Clear();
            }`