@@ -101,7 +101,7 @@ static function FetchStaleJobs()
101
101
foreach ($ worker as $ job )
102
102
{
103
103
$ fn =$ job ->getFilename ();
104
- if (subst ($ fn ,-4 )!==".job " )
104
+ if (substr ($ fn ,-4 )!==".job " )
105
105
{
106
106
if ($ job ->getCTime ()<$ cutoff )
107
107
{
@@ -114,22 +114,22 @@ static function FetchStaleJobs()
114
114
115
115
static function NukeJob ($ jobid )
116
116
{
117
- unlink (self ::$ jobpath . "/ " . $ jobid );
118
- unlink (self ::$ jobpath . "/ " . $ jobid .".job " );
117
+ @ unlink (self ::$ jobpath . "/ " . $ jobid );
118
+ @ unlink (self ::$ jobpath . "/ " . $ jobid .".job " );
119
119
120
120
$ remover =new FilesystemIterator (self ::$ dl_dir_common ."/ " .$ jobid );
121
121
foreach ($ remover as $ item )
122
122
{
123
- unlink (self ::$ dl_dir_common ."/ " .$ jobid ."/ " .$ item ->getFilename ());
123
+ @ unlink (self ::$ dl_dir_common ."/ " .$ jobid ."/ " .$ item ->getFilename ());
124
124
}
125
- unlink (self ::$ dl_dir_common ."/ " .$ jobid );
125
+ @ unlink (self ::$ dl_dir_common ."/ " .$ jobid );
126
126
127
127
$ remover =new FilesystemIterator (self ::$ dl_dir_mp3 ."/ " .$ jobid );
128
128
foreach ($ remover as $ item )
129
129
{
130
- unlink (self ::$ dl_dir_mp3 ."/ " .$ jobid ."/ " .$ item ->getFilename ());
130
+ @ unlink (self ::$ dl_dir_mp3 ."/ " .$ jobid ."/ " .$ item ->getFilename ());
131
131
}
132
- unlink (self ::$ dl_dir_mp3 ."/ " .$ jobid );
132
+ @ unlink (self ::$ dl_dir_mp3 ."/ " .$ jobid );
133
133
}
134
134
135
135
static function SetupDir ($ dirname )
@@ -156,6 +156,8 @@ static function Init()
156
156
157
157
self ::$ args ['tmp ' ]=self ::$ yt_dl_temp_path ;
158
158
self ::$ args ['out-tpl ' ]=self ::$ output_format ;
159
+
160
+ self ::FetchStaleJobs ();
159
161
self ::LoadDownloader ();
160
162
return $ dirs_present ;
161
163
}
0 commit comments