- added unit tests for Enigma2 and Grundig loaders

- added round-trip unit test for all loaders to check reordering channels and favorites, saving and reloading
- internal code clean-up regarding different favorite list modes (none vs. flags vs. ordered per source vs. mixed source)
This commit is contained in:
Horst Beham
2021-03-14 22:13:22 +01:00
parent f5010439cb
commit 5705a435b4
104 changed files with 19262 additions and 316 deletions

View File

@@ -51,14 +51,13 @@ namespace ChanSort.Loader.LG.Binary
this.ParseNames();
this.Favorites = (Favorites)((data.GetByte(_Favorites2) & 0x3C) >> 2);
if (this.Favorites != 0)
{ }
this.Lock = data.GetFlag(_Lock);
this.Skip = data.GetFlag(_Skip);
this.Hidden = data.GetFlag(_Hide);
this.Encrypted = data.GetFlag(_Encrypted);
this.IsDeleted = data.GetFlag(_Deleted);
if (IsDeleted) // allow setting a breakpoint
{
}
}
#endregion

View File

@@ -83,6 +83,8 @@ namespace ChanSort.Loader.LG.Binary
this.Features.CanHaveGaps = true;
this.Features.DeviceSettings = true;
this.Features.CleanUpChannelData = true;
this.Features.FavoritesMode = FavoritesMode.Flags;
this.Features.MaxFavoriteLists = 4;
this.SupportedTvCountryCodes = new List<string>
{
"___ (None)", "AUT (Austria)", "BEL (Belgium)", "CHE (Switzerland)",

View File

@@ -25,7 +25,7 @@ namespace ChanSort.Loader.GlobalClone
this.Features.DeleteMode = DeleteMode.NotSupported; //.FlagWithoutPrNr;
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.SupportedFavorites = 0;
this.Features.FavoritesMode = FavoritesMode.None;
this.Features.CanSaveAs = true;
this.Features.CanHaveGaps = true;
this.Features.CanHideChannels = true;

View File

@@ -119,7 +119,7 @@ namespace ChanSort.Loader.GlobalClone
if (binTlls.Length > 0 && !(binTlls.Length == 1 && Path.GetFileName(binTlls[0]).ToLower() == Path.GetFileName(this.FileName).ToLower()))
{
var txt = Resource.GcSerializer_ReadModelInfo_ModelWarning;
if (Api.View.Default.MessageBox(txt, "LG GlobalClone", (int)MessageBoxButtons.YesNo, (int)MessageBoxIcon.Information) == (int)DialogResult.Yes)
if (Api.View.Default != null && Api.View.Default.MessageBox(txt, "LG GlobalClone", (int)MessageBoxButtons.YesNo, (int)MessageBoxIcon.Information) == (int)DialogResult.Yes)
{
foreach (var file in binTlls)
File.Move(file, file + "_bak");
@@ -332,8 +332,8 @@ namespace ChanSort.Loader.GlobalClone
{
int n = info.LocalName[11] - 'A';
var mask = 1 << n;
this.Features.SupportedFavorites |= (Favorites)mask;
this.Features.SortedFavorites = true;
this.Features.FavoritesMode = FavoritesMode.OrderedPerSource;
this.Features.MaxFavoriteLists = Math.Max(this.Features.MaxFavoriteLists, n);
if (((int)ch.Favorites & mask) != 0) // xml element holds bad index data (250) when fav is not set
ch.SetOldPosition(n + 1, int.Parse(info.InnerText));
}