mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-03-06 04:00:42 +01:00
- 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:
@@ -70,8 +70,8 @@ namespace ChanSort.Loader.Philips
|
||||
this.Features.DeleteMode = DeleteMode.NotSupported;
|
||||
this.Features.CanSaveAs = false;
|
||||
this.Features.CanHaveGaps = false;
|
||||
this.Features.SupportedFavorites = Favorites.A; // Map45 format will change this
|
||||
this.Features.SortedFavorites = false; // satellite favorites are stored in a separate file that may support independent sorting, but DVB C/T only have a flag
|
||||
this.Features.FavoritesMode = FavoritesMode.Flags; // satellite favorites are stored in a separate file that may support independent sorting, but DVB C/T only have a flag
|
||||
this.Features.MaxFavoriteLists = 1; // Map45 format will change this
|
||||
this.Features.AllowGapsInFavNumbers = false;
|
||||
this.Features.CanEditFavListNames = false;
|
||||
|
||||
@@ -647,9 +647,9 @@ namespace ChanSort.Loader.Philips
|
||||
this.favChannels.AddChannel(chan);
|
||||
}
|
||||
}
|
||||
this.Features.SupportedFavorites = (Favorites)0xFF;
|
||||
this.Features.SortedFavorites = true;
|
||||
this.Features.MixedSourceFavorites = true;
|
||||
|
||||
this.Features.FavoritesMode = FavoritesMode.MixedSource;
|
||||
this.Features.MaxFavoriteLists = 8;
|
||||
this.Features.AllowGapsInFavNumbers = false;
|
||||
|
||||
using var conn = new SQLiteConnection($"Data Source={listDb}");
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Test.Loader.PhilipsBin")]
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
|
||||
@@ -260,8 +260,8 @@ namespace ChanSort.Loader.Philips
|
||||
if (setupNode.HasAttribute("ChannelName"))
|
||||
{
|
||||
file.formatVersion = 1;
|
||||
this.Features.SupportedFavorites = Favorites.A;
|
||||
this.Features.SortedFavorites = true;
|
||||
this.Features.FavoritesMode = FavoritesMode.OrderedPerSource;
|
||||
this.Features.MaxFavoriteLists = 1;
|
||||
|
||||
var dtype = bcastNode.GetAttribute("DecoderType");
|
||||
if (dtype == "1")
|
||||
@@ -276,8 +276,7 @@ namespace ChanSort.Loader.Philips
|
||||
else if (setupNode.HasAttribute("name"))
|
||||
{
|
||||
file.formatVersion = 2;
|
||||
this.Features.SupportedFavorites = 0;
|
||||
this.Features.SortedFavorites = false;
|
||||
this.Features.FavoritesMode = FavoritesMode.None;
|
||||
foreach (var list in this.DataRoot.ChannelLists)
|
||||
{
|
||||
list.VisibleColumnFieldNames.Remove("Favorites");
|
||||
@@ -417,9 +416,8 @@ namespace ChanSort.Loader.Philips
|
||||
{
|
||||
int index = ParseInt(node.Attributes["Index"].InnerText);
|
||||
string name = DecodeName(node.Attributes["Name"].InnerText);
|
||||
this.Features.SupportedFavorites |= (Favorites) (1 << (index - 1));
|
||||
this.Features.SortedFavorites = true;
|
||||
this.Features.MixedSourceFavorites = true;
|
||||
this.Features.FavoritesMode = FavoritesMode.MixedSource;
|
||||
this.Features.MaxFavoriteLists = Math.Max(this.Features.MaxFavoriteLists, index);
|
||||
|
||||
this.DataRoot.SetFavListCaption(index - 1, name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user