2024-10-02 22:08:20 +02:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using ChanSort.Api;
|
2019-07-14 22:54:46 +02:00
|
|
|
|
|
|
|
|
|
|
namespace ChanSort.Loader.Sony
|
|
|
|
|
|
{
|
2021-01-23 14:22:18 +01:00
|
|
|
|
public class SonyPlugin : ISerializerPlugin
|
2019-07-14 22:54:46 +02:00
|
|
|
|
{
|
|
|
|
|
|
public string DllName { get; set; }
|
2021-01-23 14:22:18 +01:00
|
|
|
|
public string PluginName => "Sony (sdb.xml)";
|
2019-07-20 14:54:01 +02:00
|
|
|
|
public string FileFilter => "*.xml";
|
2019-07-14 22:54:46 +02:00
|
|
|
|
|
|
|
|
|
|
public SerializerBase CreateSerializer(string inputFile)
|
|
|
|
|
|
{
|
2025-06-05 18:35:10 +02:00
|
|
|
|
// Bravia 7 (and 8?) from 2024 onward use the same sdb.xml filename, but it contains Mediatek's XML
|
2024-10-02 22:08:20 +02:00
|
|
|
|
using (var rdr = new StreamReader(inputFile))
|
|
|
|
|
|
{
|
|
|
|
|
|
var line1 = rdr.ReadLine() ?? "";
|
|
|
|
|
|
var line2 = rdr.ReadLine() ?? "";
|
|
|
|
|
|
if (line1.Contains("<service_list_transfer>") || line2.Contains("<service_list_transfer>"))
|
2025-06-05 18:35:10 +02:00
|
|
|
|
return new MediaTek.Serializer(inputFile);
|
2024-10-02 22:08:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-05 18:35:10 +02:00
|
|
|
|
// older versions use Sony's proprietary XML
|
2019-07-14 22:54:46 +02:00
|
|
|
|
return new Serializer(inputFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|