- bugfix for Sharp/Dyon/... .csv file formats with less than 52 colums

- improved reference list channel matching: if multiple channels match the same name, then the candidates are narrowed
  down by service type (TV/radio/data - if known), case sensitivity (upper/lowercase), encryption (unencrypted first)
This commit is contained in:
Horst Beham
2021-03-17 07:01:05 +01:00
parent 40f963ee69
commit 1f809bd571
3 changed files with 54 additions and 23 deletions

View File

@@ -72,6 +72,8 @@ namespace ChanSort.Loader.Sharp
var content = File.ReadAllBytes(this.FileName);
this.encoding = Tools.IsUtf8(content) ? new UTF8Encoding(false) : Encoding.GetEncoding(1252);
this.lines = this.encoding.GetString(content).Replace("\r", "").Split('\n');
if (lines.Length > 2)
this.cols = lines[2].ToLowerInvariant().Split(',');
this.formatVersion = DetectFormatVersion();
this.AdjustVisibleColumns();
@@ -194,7 +196,6 @@ namespace ChanSort.Loader.Sharp
return FormatVersion.Sharp7Columns;
// fallback for formats with more information, as long as they contain the required columns
this.cols = lines[2].ToLowerInvariant().Split(',');
var dict = new HashSet<string>();
foreach (var col in cols)
dict.Add(col);