Made /api/Redownload not add Completed videos to queue
This commit is contained in:
parent
2155d045ef
commit
e6c095b125
|
@ -7,7 +7,7 @@
|
|||
<File FileName="TYTD.Api/Server/Models/SavedVideo.cs" Line="8" Column="1" />
|
||||
<File FileName="TYTD.Api/Server/Models/InfomationQueueItem.cs" Line="280" Column="42" />
|
||||
<File FileName="TYTD.Api/Server/Functions/ffmpeg.cs" Line="5" Column="15" />
|
||||
<File FileName="Program.cs" Line="122" Column="350" />
|
||||
<File FileName="Program.cs" Line="122" Column="88" />
|
||||
<File FileName="TYTD.Api/MyClass.cs" Line="80" Column="14" />
|
||||
<File FileName="TYTD.Api/Server/Models/SavedChannel.cs" Line="6" Column="10" />
|
||||
<File FileName="TYTD.Api/Server/Models/SavedPlaylist.cs" Line="7" Column="1" />
|
||||
|
|
20
Program.cs
20
Program.cs
|
@ -264,7 +264,11 @@ namespace TYTD
|
|||
foreach (var item in Directory.GetFiles(Downloader.DL.GetPath(true, "Info"), "*.json"))
|
||||
{
|
||||
string id =Path.GetFileNameWithoutExtension(item);
|
||||
Downloader.DownloadVideo(id, Resolution.NoConvert);
|
||||
if(!File.Exists(Path.Combine("NotConverted",$"{id}.mp4")))
|
||||
{
|
||||
Downloader.DownloadVideo(id, Resolution.NoConvert);
|
||||
}
|
||||
|
||||
}
|
||||
rq.RedirectIt(rp);
|
||||
|
||||
|
@ -272,10 +276,20 @@ namespace TYTD
|
|||
|
||||
public static void RedownloadRes(HttpListenerRequest rq, HttpListenerResponse rp, Dictionary<string, string> args)
|
||||
{
|
||||
int res=int.Parse(args["R"]);
|
||||
if(res > 2)
|
||||
{
|
||||
rq.RedirectIt(rp);
|
||||
return;
|
||||
}
|
||||
string res_str = new[]{"Converted","NotConverted","Audio"}[res];
|
||||
foreach (var item in Directory.GetFiles(Downloader.DL.GetPath(true, "Info"), "*.json"))
|
||||
{
|
||||
string id = System.IO.Path.GetFileNameWithoutExtension(item);
|
||||
Downloader.DownloadVideo(id, (Resolution)int.Parse(args["R"]));
|
||||
string id = Path.GetFileNameWithoutExtension(item);
|
||||
if (!File.Exists(Path.Combine(res_str, $"{id}.mp4")))
|
||||
{
|
||||
Downloader.DownloadVideo(id, (Resolution)res);
|
||||
}
|
||||
}
|
||||
rq.RedirectIt(rp);
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue