File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,20 +117,26 @@ static function NukeJob($jobid)
117117 {
118118 @unlink (self ::$ jobpath . "/ " . $ jobid );
119119 @unlink (self ::$ jobpath . "/ " . $ jobid .".job " );
120-
121- $ remover =new FilesystemIterator (self ::$ dl_dir_common ."/ " .$ jobid );
122- foreach ($ remover as $ item )
120+ if (file_exists (self ::$ dl_dir_common ."/ " .$ jobid ))
123121 {
124- @unlink (self ::$ dl_dir_common ."/ " .$ jobid ."/ " .$ item ->getFilename ());
125- }
122+ $ remover =new FilesystemIterator (self ::$ dl_dir_common ."/ " .$ jobid );
123+ foreach ($ remover as $ item )
124+ {
125+ @unlink (self ::$ dl_dir_common ."/ " .$ jobid ."/ " .$ item ->getFilename ());
126+ }
126127 @rmdir (self ::$ dl_dir_common ."/ " .$ jobid );
127-
128- $ remover =new FilesystemIterator (self ::$ dl_dir_mp3 ."/ " .$ jobid );
129- foreach ($ remover as $ item )
130- {
131- @unlink (self ::$ dl_dir_mp3 ."/ " .$ jobid ."/ " .$ item ->getFilename ());
128+ @rmdir (self ::$ yt_dl_temp_path ."/ " .self ::$ dl_dir_common ."/ " .$ jobid );
132129 }
130+ if (file_exists (self ::$ dl_dir_mp3 ."/ " .$ jobid ))
131+ {
132+ $ remover =new FilesystemIterator (self ::$ dl_dir_mp3 ."/ " .$ jobid );
133+ foreach ($ remover as $ item )
134+ {
135+ @unlink (self ::$ dl_dir_mp3 ."/ " .$ jobid ."/ " .$ item ->getFilename ());
136+ }
133137 @rmdir (self ::$ dl_dir_mp3 ."/ " .$ jobid );
138+ @rmdir (self ::$ yt_dl_temp_path ."/ " .self ::$ dl_dir_mp3 ."/ " .$ jobid );
139+ }
134140 }
135141
136142 static function SetupDir ($ dirname )
You can’t perform that action at this time.
0 commit comments