2024-10-15 10:37:57 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
2024-10-01 10:05:48 +02:00
|
|
|
|
using ChanSort.Api;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ChanSort.Loader.MediaTek;
|
|
|
|
|
|
|
|
|
|
|
|
public class MediatekPlugin : ISerializerPlugin
|
|
|
|
|
|
{
|
|
|
|
|
|
public string DllName { get; set; }
|
2024-10-15 10:37:57 +02:00
|
|
|
|
public string PluginName => "MediaTek (Mtk*.xml)";
|
2024-10-01 10:05:48 +02:00
|
|
|
|
public string FileFilter => "Mtk*.xml";
|
|
|
|
|
|
|
|
|
|
|
|
public SerializerBase CreateSerializer(string inputFile)
|
|
|
|
|
|
{
|
2024-10-15 10:37:57 +02:00
|
|
|
|
var dir = Path.GetDirectoryName(inputFile) ?? "";
|
2024-10-01 10:05:48 +02:00
|
|
|
|
|
|
|
|
|
|
// if there is a chanLst.bin file, let the Philips module handle the channel list
|
2024-10-15 10:37:57 +02:00
|
|
|
|
if (StringComparer.InvariantCultureIgnoreCase.Equals(Path.GetFileName(inputFile), "MtkChannelList.xml") && File.Exists(Path.Combine(dir, "chanLst.bin")))
|
|
|
|
|
|
return null;
|
2024-10-01 10:05:48 +02:00
|
|
|
|
|
|
|
|
|
|
return new Serializer(inputFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|