- when deleted and non-deleted channels match a reference item, prefer the non-deleted

- upgrade to DX 21.1.3
- improved high-dpi-support (mixed DPI screens or VM/remote desktop with high-dpi only)
This commit is contained in:
Horst Beham
2021-06-13 04:03:12 +02:00
parent b0a99064d9
commit 2124346be0
23 changed files with 530 additions and 450 deletions

View File

@@ -312,7 +312,7 @@ namespace ChanSort.Api
List<ChannelInfo> candidates;
// try to find matching channels based on UID or ONID+TSID+SID+Transponder
var channels = refChannel.Uid == "0-0-0" ? new List<ChannelInfo>() : tvList.GetChannelByUid(refChannel.Uid).ToList();
var channels = refChannel.Uid.EndsWith("0-0-0") ? new List<ChannelInfo>() : tvList.GetChannelByUid(refChannel.Uid).ToList();
if (channels.Count == 0)
{
var key = DvbKey(refChannel.OriginalNetworkId, refChannel.TransportStreamId, refChannel.ServiceId);
@@ -327,10 +327,22 @@ namespace ChanSort.Api
channels = candidates;
}
}
var channel = channels.FirstOrDefault(c => c.GetPosition(subListIndex) == -1);
if (channel != null)
return channel;
candidates = channels.Where(c => c.GetPosition(subListIndex) == -1).ToList();
if (candidates.Count > 0)
{
channels = candidates;
if (channels.Count > 1)
{
candidates = channels.Where(ch => ch.IsDeleted == false).ToList();
if (candidates.Count > 0)
channels = candidates;
}
if (channels.Count > 0)
return channels[0];
}
// try to find matching channels by name
channels = tvList.GetChannelByName(refChannel.Name).Where(c => c.GetPosition(subListIndex) == -1).ToList();