mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-03-03 10:40:42 +01:00
- various improvements for Sony 1.1.0e format (handling deleted channels that need a unique number)
- DX upgrade to 19.1.5
This commit is contained in:
@@ -373,7 +373,7 @@ namespace ChanSort.Api
|
||||
}
|
||||
|
||||
int progNr = this.GetNewProgramNr(appChannel, ref maxProgNr);
|
||||
if (mode != UnsortedChannelMode.MarkDeleted)
|
||||
if (mode != UnsortedChannelMode.MarkDeleted || this.DataRoot.DeletedChannelsNeedNumbers)
|
||||
appChannel.NewProgramNr = progNr;
|
||||
}
|
||||
}
|
||||
@@ -384,8 +384,9 @@ namespace ChanSort.Api
|
||||
private string ChanSortCriteria(ChannelInfo channel)
|
||||
{
|
||||
// explicitly sorted
|
||||
if (channel.GetPosition(this.SubListIndex) != -1)
|
||||
return channel.GetPosition(this.SubListIndex).ToString("d5");
|
||||
var pos = channel.GetPosition(this.SubListIndex);
|
||||
if (pos != -1)
|
||||
return pos.ToString("d5");
|
||||
|
||||
// eventually hide unsorted channels
|
||||
if (this.unsortedChannelMode == UnsortedChannelMode.MarkDeleted)
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace ChanSort.Api
|
||||
public bool AllowGapsInFavNumbers { get; set; }
|
||||
public bool ShowDeletedChannels { get; set; }
|
||||
|
||||
public bool DeletedChannelsNeedNumbers { get; set; }
|
||||
|
||||
public DataRoot()
|
||||
{
|
||||
this.SupportedFavorites = Favorites.A | Favorites.B | Favorites.C | Favorites.D;
|
||||
@@ -118,8 +120,8 @@ namespace ChanSort.Api
|
||||
{
|
||||
foreach (var channel in list.Channels)
|
||||
{
|
||||
for (int i=0; i<=c; i++)
|
||||
channel.SetPosition(i, channel.IsDeleted ? -1 : channel.GetOldPosition(i));
|
||||
for (int i = 0; i <= c; i++)
|
||||
channel.SetPosition(i, channel.IsDeleted && !this.DeletedChannelsNeedNumbers ? -1 : channel.GetOldPosition(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,6 +130,9 @@ namespace ChanSort.Api
|
||||
#region SetPrNrForDeletedChannels()
|
||||
public void SetPrNrForDeletedChannels()
|
||||
{
|
||||
if (this.DeletedChannelsNeedNumbers)
|
||||
return;
|
||||
|
||||
// make sure that deleted channels have OldProgramNr = -1
|
||||
foreach (var list in this.ChannelLists)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user