Add - Additional checks for missing files

Fix - Video quality check typo
This commit is contained in:
Elwador 2024-06-19 11:09:55 +02:00
parent 1f6a33c3f7
commit f78df5b07f
1 changed files with 23 additions and 1 deletions

View File

@ -550,6 +550,17 @@ public class Crunchyroll{
}; };
} }
if (!File.Exists(CfgManager.PathMKVMERGE)){
Console.Error.WriteLine("Missing Mkvmerge");
MainWindow.Instance.ShowError("Mkvmerge not found");
return new DownloadResponse{
Data = new List<DownloadedMedia>(),
Error = true,
FileName = "./unknown",
ErrorText = "Missing Mkvmerge"
};
}
if (!_widevine.canDecrypt){ if (!_widevine.canDecrypt){
Console.Error.WriteLine("L3 key files missing"); Console.Error.WriteLine("L3 key files missing");
MainWindow.Instance.ShowError("Can't find CDM files in widevine folder "); MainWindow.Instance.ShowError("Can't find CDM files in widevine folder ");
@ -561,6 +572,17 @@ public class Crunchyroll{
}; };
} }
if (!File.Exists(CfgManager.PathMP4Decrypt)){
Console.Error.WriteLine("mp4decrypt not found");
MainWindow.Instance.ShowError("Can't find mp4decrypt in lib folder ");
return new DownloadResponse{
Data = new List<DownloadedMedia>(),
Error = true,
FileName = "./unknown",
ErrorText = "Missing mp4decrypt"
};
}
string mediaName = $"{data.SeasonTitle} - {data.EpisodeNumber} - {data.EpisodeTitle}"; string mediaName = $"{data.SeasonTitle} - {data.EpisodeNumber} - {data.EpisodeTitle}";
string fileName = ""; string fileName = "";
var variables = new List<Variable>(); var variables = new List<Variable>();
@ -864,7 +886,7 @@ public class Crunchyroll{
} else if (options.QualityVideo == "worst"){ } else if (options.QualityVideo == "worst"){
chosenVideoQuality = 1; chosenVideoQuality = 1;
} else{ } else{
var tempIndex = videos.FindIndex(a => a.quality.height + "" == options.QualityAudio); var tempIndex = videos.FindIndex(a => a.quality.height + "" == options.QualityVideo);
if (tempIndex < 0){ if (tempIndex < 0){
chosenVideoQuality = videos.Count; chosenVideoQuality = videos.Count;
} else{ } else{