mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-01-23 23:59:03 +01:00
CsvFileSerializer and RefSerializer are now back in the .Api project. CSV, TXT and CHL files can now be loaded and edited like any other supported channel list.
Eleminated redundant code that was used for loading/applying reference lists in CSV or TXT/CHL format.
This commit is contained in:
20
source/ChanSort.Api/Controller/RefSerializerPlugin.cs
Normal file
20
source/ChanSort.Api/Controller/RefSerializerPlugin.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.IO;
|
||||
|
||||
namespace ChanSort.Api
|
||||
{
|
||||
public class RefSerializerPlugin : ISerializerPlugin
|
||||
{
|
||||
public string PluginName => "ChanSort Reference List";
|
||||
|
||||
public string FileFilter => "*.txt;*.chl;*.csv";
|
||||
|
||||
public SerializerBase CreateSerializer(string inputFile)
|
||||
{
|
||||
var ext = (Path.GetExtension(inputFile) ?? "").ToLower();
|
||||
if (ext == ".csv")
|
||||
return new CsvFileSerializer(inputFile);
|
||||
else
|
||||
return new RefSerializer(inputFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user