mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-03-13 07:20:17 +01:00
2020-12-26
- LG WebOS 5: added warning that support is only experimental. - Panasonic: Channel name editing is now supported for svl.bin files (unless there is no indicator what encoding to use) - Hungarian translation: added missing files to .zip
This commit is contained in:
@@ -17,24 +17,28 @@ namespace Spike.LgWebOs5
|
||||
{
|
||||
basedir = args.Length > 0 ? args[0] : @"d:\sources\chansort\testfiles_lg";
|
||||
|
||||
using var stream = new FileStream("c:\\temp\\lg.csv", FileMode.Create);
|
||||
using var stream = new FileStream(@"d:\sources\chansort\testfiles_lg\__webOS5\lg.csv", FileMode.Create);
|
||||
using var csv = new StreamWriter(stream, Encoding.UTF8);
|
||||
|
||||
var sources = new[] { "All", "Analog", "DVB-T", "DVB-C", "DVB-S", "Others" };
|
||||
var fields = ChanListStats.ColumnHeaders;
|
||||
|
||||
csv.Write("\t\t\t\t\t\t\t\t");
|
||||
string skip = "";
|
||||
for (int i = 0; i < fields.Length - 1; i++)
|
||||
skip += "\t";
|
||||
foreach(var src in sources)
|
||||
csv.Write("\t" + src + skip);
|
||||
bool detailed = true;
|
||||
foreach (var src in sources)
|
||||
{
|
||||
csv.Write("\t" + src + Dup("\t", (detailed ? ChanListStats.ColumnHeadersLong.Length : ChanListStats.ColumnHeadersShort.Length) - 1));
|
||||
detailed = false;
|
||||
}
|
||||
|
||||
csv.WriteLine();
|
||||
csv.Write("Path\tStatus\tModelName\tVersion\tDTVInfo\tBroadcastCountrySettings\tcountry\tFW info\t#channels");
|
||||
detailed = true;
|
||||
foreach (var source in sources)
|
||||
{
|
||||
foreach(var field in fields)
|
||||
var fields = detailed ? ChanListStats.ColumnHeadersLong : ChanListStats.ColumnHeadersShort;
|
||||
foreach (var field in fields)
|
||||
csv.Write("\t" + field);
|
||||
detailed = false;
|
||||
}
|
||||
csv.WriteLine();
|
||||
|
||||
@@ -183,10 +187,18 @@ namespace Spike.LgWebOs5
|
||||
all += entry.Value;
|
||||
}
|
||||
|
||||
sb.Append(all.ToString() + a + t + c + s + o);
|
||||
sb.Append(all.ToString(true) + a + t + c + s + o);
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
private static string Dup(string str, int count)
|
||||
{
|
||||
var sb = new StringBuilder(str.Length * count);
|
||||
for (int i = 0; i < count; i++)
|
||||
sb.Append(str);
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#region class ChanListStats
|
||||
@@ -204,20 +216,56 @@ namespace Spike.LgWebOs5
|
||||
public bool deletedMajor0 = false;
|
||||
public bool deletedMajorNon0 = false;
|
||||
|
||||
public static readonly string[] ColumnHeaders = {
|
||||
public int UserEditChNumber;
|
||||
public int UserSelChNo;
|
||||
public int FactoryDefault;
|
||||
public int Disabled;
|
||||
public int Skipped;
|
||||
public int Invisible;
|
||||
public int Locked;
|
||||
public int Deleted;
|
||||
public int Discarded;
|
||||
public int UserCustomize;
|
||||
public int NumUnSel;
|
||||
public int Lcn;
|
||||
|
||||
public static readonly string[] ColumnHeadersLong = {
|
||||
"TV", "Radio",
|
||||
// "Rad 0/4K", "BadSvcType",
|
||||
"InOrder",
|
||||
"InOrder/Gaps",
|
||||
"Del0/!0",
|
||||
"UserEdit",
|
||||
"FactDef",
|
||||
"LCN",
|
||||
"DelDisbDisc",
|
||||
"SLHU"
|
||||
};
|
||||
|
||||
public static readonly string[] ColumnHeadersShort = {
|
||||
"TV", "Radio",
|
||||
// "Rad 0/4K", "BadSvcType",
|
||||
"InOrder/Gaps",
|
||||
"Del0/!0"
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
public override string ToString() => ToString(false);
|
||||
public string ToString(bool full)
|
||||
{
|
||||
return
|
||||
var part1 =
|
||||
"\t" + Tv + "\t" + Radio
|
||||
// + "\t" + Radio0 + "/" + Radio4k + "\t" + RadioMaskServiceTypeMismatch
|
||||
+ "\t" + (inMajorOrder ? "J" : "N") + "/" + (hasGap ? "J" : "N")
|
||||
+ "\t" + (deletedMajor0 ? "J" : "N") + "/" + (deletedMajorNon0 ? "J" : "N");
|
||||
if (!full)
|
||||
return part1;
|
||||
|
||||
return
|
||||
part1
|
||||
+ "\t" + UserEditChNumber + "/" + UserSelChNo
|
||||
+ "\t" + FactoryDefault
|
||||
+ "\t" + Lcn
|
||||
+ "\t" + Deleted + "/" + Disabled + "/" + Discarded
|
||||
+ "\t" + Skipped + "/" + Locked + "/" + Invisible + "/" + NumUnSel;
|
||||
}
|
||||
|
||||
public void Add(dynamic ch)
|
||||
@@ -260,11 +308,36 @@ namespace Spike.LgWebOs5
|
||||
|
||||
if (ch.deleted != null && (bool)ch.deleted)
|
||||
{
|
||||
++Deleted;
|
||||
if (nr == 0)
|
||||
deletedMajor0 = true;
|
||||
else
|
||||
deletedMajorNon0 = true;
|
||||
}
|
||||
if (ch.diabled != null && (bool)ch.disabled)
|
||||
++Disabled;
|
||||
if (ch.discarded != null && (bool)ch.discarded)
|
||||
++Discarded;
|
||||
|
||||
if (ch.userEditChNumber != null && (bool) ch.userEditChNumber)
|
||||
++UserEditChNumber;
|
||||
if (ch.userSelCHNo != null && (bool) ch.userSelCHNo)
|
||||
++UserSelChNo;
|
||||
|
||||
if (ch.factoryDefault != null && (bool) ch.factoryDefault)
|
||||
++FactoryDefault;
|
||||
|
||||
if (ch.skipped != null && (bool) ch.skipped)
|
||||
++Skipped;
|
||||
if (ch.locked != null && (bool) ch.locked)
|
||||
++Locked;
|
||||
if (ch.Invisible != null && (bool) ch.Invisible)
|
||||
++Invisible;
|
||||
if (ch.NumUnSel != null && (bool) ch.NumUnSel)
|
||||
++NumUnSel;
|
||||
|
||||
if (ch.validLCN != null && (bool) ch.validLCN)
|
||||
++Lcn;
|
||||
}
|
||||
|
||||
public static ChanListStats operator +(ChanListStats a, ChanListStats b)
|
||||
@@ -279,6 +352,18 @@ namespace Spike.LgWebOs5
|
||||
stats.hasGap = a.hasGap || b.hasGap;
|
||||
stats.deletedMajor0 = a.deletedMajor0 || b.deletedMajor0;
|
||||
stats.deletedMajorNon0 = a.deletedMajorNon0 || b.deletedMajorNon0;
|
||||
|
||||
stats.UserEditChNumber = a.UserEditChNumber + b.UserEditChNumber;
|
||||
stats.UserSelChNo = a.UserSelChNo + b.UserSelChNo;
|
||||
stats.FactoryDefault = a.FactoryDefault + b.FactoryDefault;
|
||||
stats.Disabled = a.Disabled + b.Disabled;
|
||||
stats.Skipped = a.Skipped + b.Skipped;
|
||||
stats.Invisible = a.Invisible + b.Invisible;
|
||||
stats.Deleted = a.Deleted + b.Deleted;
|
||||
stats.Discarded = a.Discarded + b.Discarded;
|
||||
stats.UserCustomize = a.UserCustomize + b.UserCustomize;
|
||||
stats.NumUnSel = a.NumUnSel + b.NumUnSel;
|
||||
stats.Lcn = a.Lcn + b.Lcn;
|
||||
return stats;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user