2021-09-04 22:24:56 +02:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using ChanSort.Api;
|
2021-09-03 02:26:57 +02:00
|
|
|
|
|
|
|
|
|
|
namespace ChanSort.Loader.CmdbBin
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CmdbPlugin : ISerializerPlugin
|
|
|
|
|
|
{
|
|
|
|
|
|
public string DllName { get; set; }
|
|
|
|
|
|
public string PluginName => "cmdb .bin";
|
|
|
|
|
|
public string FileFilter => "*.bin";
|
|
|
|
|
|
|
|
|
|
|
|
public SerializerBase CreateSerializer(string inputFile)
|
|
|
|
|
|
{
|
2021-09-04 22:24:56 +02:00
|
|
|
|
var dir = Path.GetDirectoryName(inputFile);
|
|
|
|
|
|
|
|
|
|
|
|
// ignore Philips ChannelMap_100 channel lists which don't have atv_cmdb.bin and dtv_cmdb_2.bin in the same folder
|
|
|
|
|
|
|
|
|
|
|
|
var anchorFile = Path.Combine(dir, "dtv_cmdb_2.bin");
|
2024-02-25 17:59:34 +01:00
|
|
|
|
if (File.Exists(anchorFile) || File.Exists(Path.Combine(dir, "atv_cmdb.bin")))
|
2021-09-04 22:24:56 +02:00
|
|
|
|
return new CmdbFileSerializer(anchorFile);
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
2021-09-03 02:26:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|