mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-02-10 00:16:46 +01:00
- added unit test for Toshiba settingsDB.db channel list format
- added english and german translation for LG blindscan warning
This commit is contained in:
@@ -81,7 +81,7 @@ namespace ChanSort.Loader.GlobalClone
|
||||
switch (dlg.SelectedAction)
|
||||
{
|
||||
case 0:
|
||||
throw new FileLoadException("LG webOS 5 experimental support rejected");
|
||||
throw new FileLoadException(ChanSort.Loader.LG.Resource.LG_BlindscanInfo_Rejected);
|
||||
case 1:
|
||||
System.Diagnostics.Process.Start("https://github.com/PredatH0r/ChanSort/discussions/207");
|
||||
break;
|
||||
|
||||
12
source/ChanSort.Loader.LG/Resource.Designer.cs
generated
12
source/ChanSort.Loader.LG/Resource.Designer.cs
generated
@@ -102,12 +102,13 @@ namespace ChanSort.Loader.LG {
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to !!! ATTENTION !!!
|
||||
///
|
||||
///LG channel lists can ONLY be imported back into the TV, when special options were selected during the TV's channel search process:
|
||||
///- Provider: MUST be None/Other (do NOT select your cable provider or Astra 19.2E)
|
||||
///- Blindscan: MUST be selected
|
||||
///- Network search: optional (can be selected)
|
||||
///
|
||||
///Your TV will show a broken list if these steps are not followed!.
|
||||
///Your TV will not process the list correctly if these steps are not followed!.
|
||||
/// </summary>
|
||||
internal static string LG_BlindscanInfo {
|
||||
get {
|
||||
@@ -142,6 +143,15 @@ namespace ChanSort.Loader.LG {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Loading process was canceled.
|
||||
/// </summary>
|
||||
internal static string LG_BlindscanInfo_Rejected {
|
||||
get {
|
||||
return ResourceManager.GetString("LG_BlindscanInfo_Rejected", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Channel #{0} (Pr# {1}) was erased because it is a duplicate of channel #{2} (Pr# {3}): {4}.
|
||||
/// </summary>
|
||||
|
||||
@@ -145,4 +145,20 @@ Bitte stellen Sie sicher, dass auf Ihrem webOS basierenden Gerät eine aktuelle
|
||||
<data name="LG_BlindscanInfo_Cancel" xml:space="preserve">
|
||||
<value>Abbrechen</value>
|
||||
</data>
|
||||
<data name="LG_BlindscanInfo_OpenWebpage" xml:space="preserve">
|
||||
<value>Webseite mit Infos zu webOS Unterstützung öffnen</value>
|
||||
</data>
|
||||
<data name="LG_BlindscanInfo" xml:space="preserve">
|
||||
<value>!!! ACHTUNG !!!
|
||||
|
||||
LG Senderlisten können NUR DANN vom Fernseher eingelesen werden, wenn bestimmte Optionen bei der Sendersuche gewählt wurden:
|
||||
- Anbieter: MUSS "Keiner" gewählt werden
|
||||
- Blindsuche: MUSS ausgewählt sein
|
||||
- Netzwerksuche: kann ausgewählt werden
|
||||
|
||||
Ihr Fernseher wird die Senderliste nicht korrekt verarbeiten, wenn diese Schritte nicht befolgt wurden!</value>
|
||||
</data>
|
||||
<data name="LG_BlindscanInfo_Rejected" xml:space="preserve">
|
||||
<value>Ladevorgang wurde abgebrochen</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -147,12 +147,13 @@ Older LG firmware for webOS based TV models does not handle the import of channe
|
||||
</data>
|
||||
<data name="LG_BlindscanInfo" xml:space="preserve">
|
||||
<value>!!! ATTENTION !!!
|
||||
|
||||
LG channel lists can ONLY be imported back into the TV, when special options were selected during the TV's channel search process:
|
||||
- Provider: MUST be None/Other (do NOT select your cable provider or Astra 19.2E)
|
||||
- Blindscan: MUST be selected
|
||||
- Network search: optional (can be selected)
|
||||
|
||||
Your TV will show a broken list if these steps are not followed!</value>
|
||||
Your TV will not process the list correctly if these steps are not followed!</value>
|
||||
</data>
|
||||
<data name="LG_BlindscanInfo_OpenWebpage" xml:space="preserve">
|
||||
<value>Read information about webOS 5 support on github.com</value>
|
||||
@@ -163,4 +164,7 @@ Your TV will show a broken list if these steps are not followed!</value>
|
||||
<data name="LG_BlindscanInfo_Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="LG_BlindscanInfo_Rejected" xml:space="preserve">
|
||||
<value>Loading process was canceled</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -68,11 +68,15 @@
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ToshibasSettingsDbTest.cs" />
|
||||
<Compile Include="ToshibaChmgtDbTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="TestFiles\settingsDB.db">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="TestFiles\Toshiba-SL863G.zip">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
BIN
source/Test.Loader.Toshiba/TestFiles/settingsDB.db
Normal file
BIN
source/Test.Loader.Toshiba/TestFiles/settingsDB.db
Normal file
Binary file not shown.
103
source/Test.Loader.Toshiba/ToshibasSettingsDbTest.cs
Normal file
103
source/Test.Loader.Toshiba/ToshibasSettingsDbTest.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System.Linq;
|
||||
using ChanSort.Api;
|
||||
using ChanSort.Loader.Toshiba;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace Test.Loader.Toshiba
|
||||
{
|
||||
[TestClass]
|
||||
public class ToshibaSettingsDbTest
|
||||
{
|
||||
#region TestSatChannelsAddedToCorrectLists
|
||||
|
||||
[TestMethod]
|
||||
public void TestSatChannelsAddedToCorrectLists()
|
||||
{
|
||||
this.TestChannelsAddedToCorrectLists("settingsDB.db", SignalSource.All, 496, 496);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TestChannelsAddedToCorrectList
|
||||
|
||||
private void TestChannelsAddedToCorrectLists(string fileName, SignalSource signalSource, int expectedTv, int expectedRadio, int dataProgramSid = 0, string dataProgramName = null)
|
||||
{
|
||||
var tempFile = TestUtils.DeploymentItem("Test.Loader.Toshiba\\TestFiles\\" + fileName);
|
||||
var plugin = new ToshibaPlugin();
|
||||
var ser = plugin.CreateSerializer(tempFile);
|
||||
ser.Load();
|
||||
|
||||
var root = ser.DataRoot;
|
||||
|
||||
var tv = root.GetChannelList(signalSource);
|
||||
if (expectedTv > 0)
|
||||
{
|
||||
Assert.IsNotNull(tv);
|
||||
Assert.AreEqual(expectedTv, tv?.Channels.Count ?? 0);
|
||||
}
|
||||
|
||||
if (expectedRadio > 0)
|
||||
{
|
||||
var radio = root.GetChannelList(signalSource | SignalSource.Radio);
|
||||
Assert.IsNotNull(radio);
|
||||
Assert.AreEqual(expectedRadio, radio.Channels.Count);
|
||||
}
|
||||
|
||||
// check that data channel is in the TV list
|
||||
if (dataProgramSid != 0)
|
||||
{
|
||||
var chan = tv.Channels.FirstOrDefault(ch => ch.ServiceId == dataProgramSid);
|
||||
Assert.IsNotNull(chan);
|
||||
Assert.AreEqual(dataProgramName, chan.Name);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region TestDeletingChannel
|
||||
|
||||
[TestMethod]
|
||||
public void TestDeletingChannel()
|
||||
{
|
||||
var tempFile = TestUtils.DeploymentItem("Test.Loader.Toshiba\\TestFiles\\settingsDB.db");
|
||||
var plugin = new ToshibaPlugin();
|
||||
var ser = plugin.CreateSerializer(tempFile);
|
||||
ser.Load();
|
||||
var data = ser.DataRoot;
|
||||
data.ValidateAfterLoad();
|
||||
data.ApplyCurrentProgramNumbers();
|
||||
|
||||
// Pr# 379 = ORF2E
|
||||
|
||||
var dvbs = data.GetChannelList(SignalSource.DvbS);
|
||||
var orf2e = dvbs.Channels.FirstOrDefault(ch => ch.Name == "ORF2E");
|
||||
Assert.IsNotNull(orf2e);
|
||||
Assert.AreEqual(379, orf2e.OldProgramNr);
|
||||
Assert.AreEqual(379, orf2e.NewProgramNr);
|
||||
Assert.IsFalse(orf2e.IsDeleted);
|
||||
|
||||
orf2e.NewProgramNr = -1;
|
||||
data.AssignNumbersToUnsortedAndDeletedChannels(UnsortedChannelMode.Delete);
|
||||
|
||||
Assert.IsTrue(orf2e.IsDeleted);
|
||||
Assert.IsTrue(orf2e.NewProgramNr == 0);
|
||||
|
||||
|
||||
// save and reload
|
||||
ser.Save(tempFile);
|
||||
ser = plugin.CreateSerializer(tempFile);
|
||||
ser.Load();
|
||||
data = ser.DataRoot;
|
||||
data.ValidateAfterLoad();
|
||||
data.ApplyCurrentProgramNumbers();
|
||||
|
||||
// channel was deleted from database
|
||||
dvbs = data.GetChannelList(SignalSource.DvbS);
|
||||
orf2e = dvbs.Channels.FirstOrDefault(ch => ch.Name == "ORF2E");
|
||||
Assert.IsNull(orf2e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user