mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-04-22 22:23:11 +00:00
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
#if NET40_OR_GREATER || NETCOREAPP
|
|
using System.Collections.Concurrent;
|
|
#endif
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using BinaryObjectScanner.Interfaces;
|
|
|
|
namespace BinaryObjectScanner.Protection
|
|
{
|
|
// TODO: Figure out how to use path check framework here
|
|
public class ProtectDVDVideo : IPathCheck
|
|
{
|
|
/// <inheritdoc/>
|
|
#if NET20 || NET35
|
|
public Queue<string> CheckDirectoryPath(string path, IEnumerable<string>? files)
|
|
#else
|
|
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string>? files)
|
|
#endif
|
|
{
|
|
#if NET20 || NET35
|
|
var protections = new Queue<string>();
|
|
#else
|
|
var protections = new ConcurrentQueue<string>();
|
|
#endif
|
|
if (files == null)
|
|
return protections;
|
|
|
|
if (Directory.Exists(Path.Combine(path, "VIDEO_TS")))
|
|
{
|
|
string[] ifofiles = files.Where(s => s.EndsWith(".ifo")).ToArray();
|
|
for (int i = 0; i < ifofiles.Length; i++)
|
|
{
|
|
var ifofile = new FileInfo(ifofiles[i]);
|
|
if (ifofile.Length == 0)
|
|
{
|
|
protections.Enqueue("Protect DVD-Video (Unconfirmed - Please report to us on Github)");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
return protections;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public string? CheckFilePath(string path)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|