mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-02-02 04:29:04 +01:00
- correctly detecting LG hospitality TV files named "xx....TLL" as GlobalClone/XML text files
This commit is contained in:
@@ -45,6 +45,8 @@ namespace ChanSort.Loader.GlobalClone
|
||||
{
|
||||
this.doc = new XmlDocument();
|
||||
string textContent = File.ReadAllText(this.FileName, Encoding.UTF8);
|
||||
if (textContent[0] != '<')
|
||||
throw new FileLoadException("Invalid GlobalClone/XML file format. Maybe a binary xx*.TLL file?", this.FileName);
|
||||
textContent = ReplaceInvalidXmlCharacters(textContent);
|
||||
var settings = new XmlReaderSettings { CheckCharacters = false };
|
||||
using (var reader = XmlReader.Create(new StringReader(textContent), settings))
|
||||
@@ -109,7 +111,7 @@ namespace ChanSort.Loader.GlobalClone
|
||||
// ask whether binary TLL file should be deleted
|
||||
var dir = Path.GetDirectoryName(this.FileName) ?? ".";
|
||||
var binTlls = Directory.GetFiles(dir, "xx" + series + "*.tll");
|
||||
if (binTlls.Length > 0)
|
||||
if (binTlls.Length > 0 && !(binTlls.Length == 1 && Path.GetFileName(binTlls[0]).ToLower() == Path.GetFileName(this.FileName).ToLower()))
|
||||
{
|
||||
var txt = Resources.GcSerializer_ReadModelInfo_ModelWarning;
|
||||
if (MessageBox.Show(txt, "LG GlobalClone", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace ChanSort.Loader.GlobalClone
|
||||
public class GcSerializerPlugin : ISerializerPlugin
|
||||
{
|
||||
public string DllName { get; set; }
|
||||
public string PluginName { get { return "LG GlobalClone"; } }
|
||||
public string FileFilter { get { return "*Clone*.tll;xx*.xml"; } }
|
||||
|
||||
public string PluginName => "LG GlobalClone";
|
||||
public string FileFilter => "*Clone*.tll;xx*.xml;xx*.tll";
|
||||
|
||||
public SerializerBase CreateSerializer(string inputFile)
|
||||
{
|
||||
return new GcSerializer(inputFile);
|
||||
|
||||
@@ -149,9 +149,12 @@ namespace ChanSort.Loader.LG
|
||||
|
||||
long fileSize = new FileInfo(this.FileName).Length;
|
||||
if (fileSize > MaxFileSize)
|
||||
throw new FileLoadException(string.Format(ERR_fileTooBig, fileSize, MaxFileSize));
|
||||
throw new FileLoadException(string.Format(ERR_fileTooBig, fileSize, MaxFileSize), this.FileName);
|
||||
|
||||
this.fileContent = File.ReadAllBytes(this.FileName);
|
||||
if (this.fileContent[0] == '<')
|
||||
throw new FileLoadException("Invalid binary TLL file format. Maybe a GlobalClone/XML file?", this.FileName);
|
||||
|
||||
int off = 0;
|
||||
|
||||
this.ReadFileHeader(ref off);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
ChanSort Change Log
|
||||
===================
|
||||
|
||||
2019-11-11
|
||||
- LG hospitality TVs using files names like xx[modelname].TLL can now be loaded
|
||||
(They use the naming pattern of binary TLL files, but contain GlobalClone/XML text data)
|
||||
|
||||
2019-11-10
|
||||
- Sony: added support for independent favorite list ordering for Android channel lists (n)
|
||||
- fixed: failed to save Sony lists which contain channel numbers above 8000
|
||||
|
||||
Reference in New Issue
Block a user