2021-07-18 09:44:23 -07:00
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
|
using System.Collections.Generic;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
2022-05-01 17:41:50 -07:00
|
|
|
|
using BurnOutSharp.Interfaces;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
|
|
|
|
|
namespace BurnOutSharp.ProtectionType
|
|
|
|
|
|
{
|
2021-03-22 23:02:01 -07:00
|
|
|
|
// TODO: Figure out how to use path check framework here
|
2021-02-26 00:32:09 -08:00
|
|
|
|
public class DVDMoviePROTECT : IPathCheck
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-02-26 00:32:09 -08:00
|
|
|
|
/// <inheritdoc/>
|
2021-07-18 09:44:23 -07:00
|
|
|
|
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string> files)
|
2019-09-27 23:52:24 -07:00
|
|
|
|
{
|
2021-07-18 09:44:23 -07:00
|
|
|
|
var protections = new ConcurrentQueue<string>();
|
|
|
|
|
|
|
2019-09-27 23:52:24 -07:00
|
|
|
|
if (Directory.Exists(Path.Combine(path, "VIDEO_TS")))
|
|
|
|
|
|
{
|
|
|
|
|
|
string[] bupfiles = files.Where(s => s.EndsWith(".bup")).ToArray();
|
|
|
|
|
|
for (int i = 0; i < bupfiles.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
FileInfo bupfile = new FileInfo(bupfiles[i]);
|
2021-07-17 22:31:29 -07:00
|
|
|
|
FileInfo ifofile = new FileInfo(Path.Combine(bupfile.DirectoryName, bupfile.Name.Substring(0, bupfile.Name.Length - bupfile.Extension.Length) + ".ifo"));
|
2019-09-27 23:52:24 -07:00
|
|
|
|
if (bupfile.Length != ifofile.Length)
|
2021-07-18 09:44:23 -07:00
|
|
|
|
{
|
|
|
|
|
|
protections.Enqueue("DVD-Movie-PROTECT");
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-18 09:44:23 -07:00
|
|
|
|
return protections;
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
2021-03-19 15:41:49 -07:00
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public string CheckFilePath(string path)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2019-09-27 23:52:24 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|