mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-03-03 18:50:44 +01:00
- W.I.P: Enigma2 lamedb / bouquets support for Linux based Set-Top-Boxes (Dreambox, VU+, Octagon, ...)
- Toshiba settingsDB.db: support for lists without analog tuner data (missing TADTunerDataTable) - Grunding: failed to load lists where the <Digital> element did not contain a <channels> child element - W.I.P: reworking the reference list system so that a simple list of channels can be applied to the main channel numbers or a particular favorite list. (The "Automatically reorder all lists" options currently does not work)
This commit is contained in:
@@ -27,6 +27,8 @@ namespace ChanSort.Api
|
||||
public bool CanHide => this.loader.Features.CanHideChannels;
|
||||
public bool CanEditFavListName => this.loader.Features.CanEditFavListNames;
|
||||
|
||||
public int FavListCount { get; private set; }
|
||||
|
||||
public DataRoot(SerializerBase loader)
|
||||
{
|
||||
this.loader = loader;
|
||||
@@ -108,14 +110,12 @@ namespace ChanSort.Api
|
||||
#region ValidateAfterLoad()
|
||||
public virtual void ValidateAfterLoad()
|
||||
{
|
||||
this.FavListCount = 0;
|
||||
for (ulong m = (ulong)this.loader.Features.SupportedFavorites; m != 0; m >>= 1)
|
||||
++this.FavListCount;
|
||||
|
||||
foreach (var list in this.ChannelLists)
|
||||
{
|
||||
if (list.FavListCount == 0)
|
||||
{
|
||||
for (ulong m = (ulong) this.loader.Features.SupportedFavorites; m != 0; m >>= 1)
|
||||
++list.FavListCount;
|
||||
}
|
||||
|
||||
if (list.IsMixedSourceFavoritesList)
|
||||
{
|
||||
loader.Features.SortedFavorites = true; // all mixed source favorite lists must support ordering
|
||||
@@ -144,18 +144,11 @@ namespace ChanSort.Api
|
||||
#region ApplyCurrentProgramNumbers()
|
||||
public void ApplyCurrentProgramNumbers()
|
||||
{
|
||||
int c = 0;
|
||||
if (this.MixedSourceFavorites || this.SortedFavorites)
|
||||
{
|
||||
for (ulong m = (ulong) this.SupportedFavorites; m != 0; m >>= 1)
|
||||
++c;
|
||||
}
|
||||
|
||||
foreach (var list in this.ChannelLists)
|
||||
{
|
||||
foreach (var channel in list.Channels)
|
||||
{
|
||||
for (int i = 0; i <= c; i++)
|
||||
for (int i = 0; i <= this.FavListCount; i++)
|
||||
channel.SetPosition(i, channel.GetOldPosition(i));
|
||||
}
|
||||
}
|
||||
@@ -247,9 +240,8 @@ namespace ChanSort.Api
|
||||
chan.NewProgramNr = -1;
|
||||
}
|
||||
|
||||
chan.OldProgramNr = chan.NewProgramNr;
|
||||
chan.OldFavIndex.Clear();
|
||||
chan.OldFavIndex.AddRange(chan.FavIndex);
|
||||
for (int j=0; j<=this.FavListCount; j++)
|
||||
chan.SetOldPosition(j, chan.GetPosition(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user