diff --git a/source/ChanSort.Api/Model/ChannelList.cs b/source/ChanSort.Api/Model/ChannelList.cs index f9696f9..6d9dc1d 100644 --- a/source/ChanSort.Api/Model/ChannelList.cs +++ b/source/ChanSort.Api/Model/ChannelList.cs @@ -75,13 +75,13 @@ namespace ChanSort.Api public string AddChannel(ChannelInfo ci) { IList others; - if (this.channelByUid.TryGetValue(ci.Uid, out others)) - ++duplicateUidCount; - else + if (!this.channelByUid.TryGetValue(ci.Uid, out others)) { others = new List(); this.channelByUid.Add(ci.Uid, others); } + if (others.Count > 0 && !ci.IsDeleted) + ++duplicateUidCount; others.Add(ci); string warning2 = null; diff --git a/source/ChanSort.Loader.LG/GlobalClone/GcChannel.cs b/source/ChanSort.Loader.LG/GlobalClone/GcChannel.cs index 88a4d8e..bdf1006 100644 --- a/source/ChanSort.Loader.LG/GlobalClone/GcChannel.cs +++ b/source/ChanSort.Loader.LG/GlobalClone/GcChannel.cs @@ -1,11 +1,9 @@ -using System.Xml; -using ChanSort.Api; +using ChanSort.Api; namespace ChanSort.Loader.GlobalClone { internal class GcChannel : 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; } diff --git a/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs b/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs index 4310bb8..37119db 100644 --- a/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs +++ b/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs @@ -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); } diff --git a/source/changelog.md b/source/changelog.md index e531b95..b2968ec 100644 --- a/source/changelog.md +++ b/source/changelog.md @@ -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