diff --git a/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs b/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs index 4f14a61..0309a2b 100644 --- a/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs +++ b/source/ChanSort.Loader.LG/GlobalClone/GcJsonSerializer.cs @@ -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; diff --git a/source/ChanSort.Loader.LG/Resource.Designer.cs b/source/ChanSort.Loader.LG/Resource.Designer.cs index 024bb9b..9f55c3d 100644 --- a/source/ChanSort.Loader.LG/Resource.Designer.cs +++ b/source/ChanSort.Loader.LG/Resource.Designer.cs @@ -102,12 +102,13 @@ namespace ChanSort.Loader.LG { /// /// 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!. /// internal static string LG_BlindscanInfo { get { @@ -142,6 +143,15 @@ namespace ChanSort.Loader.LG { } } + /// + /// Looks up a localized string similar to Loading process was canceled. + /// + internal static string LG_BlindscanInfo_Rejected { + get { + return ResourceManager.GetString("LG_BlindscanInfo_Rejected", resourceCulture); + } + } + /// /// Looks up a localized string similar to Channel #{0} (Pr# {1}) was erased because it is a duplicate of channel #{2} (Pr# {3}): {4}. /// diff --git a/source/ChanSort.Loader.LG/Resource.de.resx b/source/ChanSort.Loader.LG/Resource.de.resx index f3e83ce..2aa3053 100644 --- a/source/ChanSort.Loader.LG/Resource.de.resx +++ b/source/ChanSort.Loader.LG/Resource.de.resx @@ -145,4 +145,20 @@ Bitte stellen Sie sicher, dass auf Ihrem webOS basierenden Gerät eine aktuelle Abbrechen + + Webseite mit Infos zu webOS Unterstützung öffnen + + + !!! 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! + + + Ladevorgang wurde abgebrochen + \ No newline at end of file diff --git a/source/ChanSort.Loader.LG/Resource.resx b/source/ChanSort.Loader.LG/Resource.resx index 06251fb..3f7456a 100644 --- a/source/ChanSort.Loader.LG/Resource.resx +++ b/source/ChanSort.Loader.LG/Resource.resx @@ -147,12 +147,13 @@ Older LG firmware for webOS based TV models does not handle the import of channe !!! 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! Read information about webOS 5 support on github.com @@ -163,4 +164,7 @@ Your TV will show a broken list if these steps are not followed! Cancel + + Loading process was canceled + \ No newline at end of file diff --git a/source/Test.Loader.Toshiba/Test.Loader.Toshiba.csproj b/source/Test.Loader.Toshiba/Test.Loader.Toshiba.csproj index 6c45739..f08de93 100644 --- a/source/Test.Loader.Toshiba/Test.Loader.Toshiba.csproj +++ b/source/Test.Loader.Toshiba/Test.Loader.Toshiba.csproj @@ -68,11 +68,15 @@ + + + PreserveNewest + Always diff --git a/source/Test.Loader.Toshiba/TestFiles/settingsDB.db b/source/Test.Loader.Toshiba/TestFiles/settingsDB.db new file mode 100644 index 0000000..da1b836 Binary files /dev/null and b/source/Test.Loader.Toshiba/TestFiles/settingsDB.db differ diff --git a/source/Test.Loader.Toshiba/ToshibasSettingsDbTest.cs b/source/Test.Loader.Toshiba/ToshibasSettingsDbTest.cs new file mode 100644 index 0000000..c389f7d --- /dev/null +++ b/source/Test.Loader.Toshiba/ToshibasSettingsDbTest.cs @@ -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 + + } +}