- unified handling for deleting channels (action based on file format support either mark-as-deleted, remove-from-file, append-at-end)

- added unit tests
- internal code cleanup
This commit is contained in:
hbeham
2019-11-08 02:31:44 +01:00
parent caca802c0a
commit 34b281f5fc
105 changed files with 2024 additions and 1442 deletions

View File

@@ -76,6 +76,8 @@ namespace ChanSort.Loader.LG
public TllFileSerializer(string inputFile) : base(inputFile)
{
this.Features.ChannelNameEdit = ChannelNameEditMode.Analog;
this.Features.DeleteMode = DeleteMode.FlagWithoutPrNr;
this.Features.CanHaveGaps = true;
this.Features.DeviceSettings = true;
this.Features.CleanUpChannelData = true;
this.SupportedTvCountryCodes = new List<string>
@@ -125,10 +127,6 @@ namespace ChanSort.Loader.LG
#endregion
#region DisplayName
public override string DisplayName { get { return "TLL loader"; } }
#endregion
#region Load()
public override void Load()
@@ -530,11 +528,7 @@ namespace ChanSort.Loader.LG
else
{
if (ci.IsDeleted)
{
ci.OldProgramNr = -1;
ci.NewProgramNr = -1;
++this.deletedChannelsSoft;
}
var list = this.DataRoot.GetChannelList(ci.SignalSource);
var dupes = list.GetChannelByUid(ci.Uid);
@@ -923,10 +917,11 @@ namespace ChanSort.Loader.LG
newDvbctChannelCount = 0;
foreach (var list in this.DataRoot.ChannelLists)
{
int count = list.Channels.Count;
for (int i=0; i<count; i++)
foreach(var channel in list.Channels)
{
ChannelInfo channel = list.Channels[i];
if (channel.IsProxy)
continue;
if (channel.NewProgramNr != -1)
{
if ((channel.SignalSource & SignalSource.Analog) != 0)
@@ -935,12 +930,6 @@ namespace ChanSort.Loader.LG
++newDvbctChannelCount;
}
if (!(channel is TllChannelBase))
{
var newChannel = this.CreateChannelFromProxy(channel);
if (newChannel != null)
list.Channels[i] = newChannel;
}
channel.UpdateRawData();
}
}
@@ -948,21 +937,6 @@ namespace ChanSort.Loader.LG
#endregion
#region CreateChannelFromProxy()
private ChannelInfo CreateChannelFromProxy(ChannelInfo proxy)
{
if ((proxy.SignalSource & SignalSource.Sat) != 0)
{
var mapping = this.GetDvbsChannelMapping();
var channel = SatChannel.CreateFromProxy(proxy, this.DataRoot, mapping, this.satConfig.dvbsChannelLength);
if (channel != null)
this.mustReorganizeDvbs = true;
return channel;
}
return null;
}
#endregion
#region ReorderActChannelsPhysically()
private void ReorderActChannelsPhysically()
{