- minor fixes ("File / File information" didn't ignore deleted channels when counting duplicates)

- LG WebOS 5 JSON serializer didn't set RecordIndex and didn't set deleted channels to -1
This commit is contained in:
Horst Beham
2021-07-27 01:25:04 +02:00
parent 3b13bf535b
commit 11e57dd20b
4 changed files with 16 additions and 12 deletions

View File

@@ -75,13 +75,13 @@ namespace ChanSort.Api
public string AddChannel(ChannelInfo ci)
{
IList<ChannelInfo> others;
if (this.channelByUid.TryGetValue(ci.Uid, out others))
++duplicateUidCount;
else
if (!this.channelByUid.TryGetValue(ci.Uid, out others))
{
others = new List<ChannelInfo>();
this.channelByUid.Add(ci.Uid, others);
}
if (others.Count > 0 && !ci.IsDeleted)
++duplicateUidCount;
others.Add(ci);
string warning2 = null;

View File

@@ -1,11 +1,9 @@
using System.Xml;
using ChanSort.Api;
using ChanSort.Api;
namespace ChanSort.Loader.GlobalClone
{
internal class GcChannel<TNode> : ChannelInfo
{
internal int Index;
internal TNode Node;
internal bool IsDisabled;
@@ -13,7 +11,7 @@ namespace ChanSort.Loader.GlobalClone
internal GcChannel(SignalSource source, int index, TNode node)
{
this.SignalSource = source;
this.Index = index;
this.RecordIndex = index;
this.RecordOrder = index;
this.Node = node;
}

View File

@@ -225,7 +225,6 @@ namespace ChanSort.Loader.GlobalClone
ch.Skip = (bool) node["skipped"];
ch.Lock = (bool)node["locked"];
ch.Hidden = (bool) node["Invisible"];
ch.OldProgramNr = ch.IsDeleted ? -1 : major;
var nameBytes = Convert.FromBase64String((string) node["chNameBase64"]);
dec.GetChannelNames(nameBytes, 0, nameBytes.Length, out var name, out var shortName);
ch.ShortName = shortName;
@@ -269,12 +268,18 @@ namespace ChanSort.Loader.GlobalClone
}
if ((ch.OldProgramNr & 0x4000) != 0)
if (ch.IsDeleted)
ch.OldProgramNr = -1;
else
{
ch.OldProgramNr &= 0x3FFF;
ch.SignalSource |= SignalSource.Radio;
ch.OldProgramNr = major;
if ((major & 0x4000) != 0)
{
ch.OldProgramNr &= 0x3FFF;
ch.SignalSource |= SignalSource.Radio;
}
}
var list = this.DataRoot.GetChannelList(ch.SignalSource);
this.DataRoot.AddChannel(list, ch);
}

View File

@@ -3,6 +3,7 @@ ChanSort Change Log
TBD
- improved Linux/Wine performance
- minor fixes ("File / File information" didn't ignore deleted channels when counting duplicates)
2021-07-26
- user interface can now be toggled between