mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-03-05 03:30:44 +01:00
- 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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user