Skip to content

Commit

Permalink
- Panasonic LS 500 / LX 700 series: support for new firmware which do…
Browse files Browse the repository at this point in the history
…esn't export a hotel.bin file.

- Loewe servicelist.xml (and maybe some other .xml files) larger than 2 000 000 bytes were
  not loaded.
- Enigma/Linux lists can now also be opened by selecting a .tv or .radio file (not just lamedb)
  • Loading branch information
PredatH0r committed Jun 1, 2023
1 parent 072d9b2 commit 68d3fc4
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 15 deletions.
8 changes: 6 additions & 2 deletions source/ChanSort.Loader.Enigma2/Enigma2Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
using ChanSort.Api;
using System.IO;
using ChanSort.Api;

namespace ChanSort.Loader.Enigma2
{
public class Enigma2Plugin : ISerializerPlugin
{
public string DllName { get; set; }
public string PluginName => "Enigma2 (Linux Receiver)";
public string FileFilter => "lamedb";
public string FileFilter => "lamedb;*.tv;*.radio";

public SerializerBase CreateSerializer(string inputFile)
{
var ext = Path.GetExtension(inputFile).ToLowerInvariant();
if (ext == ".tv" || ext == ".radio")
inputFile = Path.Combine(Path.GetDirectoryName(inputFile) ?? "", "lamedb");
return new Serializer(inputFile);
}
}
Expand Down
2 changes: 2 additions & 0 deletions source/ChanSort.Loader.Enigma2/Serializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public Serializer(string inputFile) : base(inputFile)
this.Features.CanSkipChannels = false;
this.Features.CanLockChannels = false;
this.Features.CanHideChannels = false;
this.Features.CanHaveGaps = false;
this.Features.AllowGapsInFavNumbers = false;
this.Features.FavoritesMode = FavoritesMode.MixedSource;
this.Features.MaxFavoriteLists = 0; // dynamically added

Expand Down
4 changes: 2 additions & 2 deletions source/ChanSort.Loader.Hisense/HisensePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public SerializerBase CreateSerializer(string inputFile)
{
var name = Path.GetFileName(inputFile).ToLowerInvariant();

if (name.Contains("channel")) // UHD models 2015-2016
if (name.Contains("channel") && name.EndsWith(".db")) // UHD models 2015-2016
return new ChannelDb.ChannelDbSerializer(inputFile);

if (name.Contains("servicelist")) // models 2017 and later
if (name.Contains("servicelist") && name.EndsWith(".db")) // models 2017 and later
return new ServicelistDb.ServicelistDbSerializer(inputFile);

if (name.StartsWith("his_dvb") && name.EndsWith(".bin")) // HIS_DVB.BIN
Expand Down
3 changes: 3 additions & 0 deletions source/ChanSort.Loader.LG/LgPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public SerializerBase CreateSerializer(string inputFile)
if (content.Contains("<TLLDATA>"))
return new GlobalClone.GcXmlSerializer(inputFile);

if (content.StartsWith("<"))
throw LoaderException.TryNext("File is not a binary LG .TLL file");

return new Binary.TllFileSerializer(inputFile) { IsTesting = this.IsTesting };
}

Expand Down
6 changes: 3 additions & 3 deletions source/ChanSort.Loader.Panasonic/IdtvChannelSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace ChanSort.Loader.Panasonic;
* Serializer for the 2022/2023 Android based Panasonic LS 500, LX 700 series file format
*
* The format uses a directory tree with
* /hotel.bin (irrelevant content)
* /hotel.bin (irrelevant content, no longer exists after a firmware update in 2023)
* /mnt/vendor/tvdata/database/tv.db Sqlite database
* /mnt/vendor/tvdata/database/channel/idtvChannel.bin
*
Expand Down Expand Up @@ -148,9 +148,9 @@ public BinChannelEntry(int index, IdtvChannel channel, string name, int startOff
private readonly StringBuilder log = new();

#region ctor()
public IdtvChannelSerializer(string hotelBin) : base(hotelBin)
public IdtvChannelSerializer(string tvDb) : base(tvDb)
{
var dir = Path.Combine(Path.GetDirectoryName(hotelBin), "mnt/vendor/tvdata/database");
var dir = Path.GetDirectoryName(tvDb);
dbFile = Path.Combine(dir, "tv.db");
binFile = Path.Combine(dir, "channel", "idtvChannel.bin");

Expand Down
14 changes: 7 additions & 7 deletions source/ChanSort.Loader.Panasonic/PanasonicPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public SerializerBase CreateSerializer(string inputFile)
// check for files in the 2022 /mnt/vendor/tvdata/database/channel/ directory structure file format with tv.db and idtvChannel.bin
var name = Path.GetFileName(inputFile).ToLowerInvariant();
var baseDir = Path.GetDirectoryName(inputFile);
if (name == "idtvchannel.bin")
baseDir = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(baseDir))))); // go down channel/database/tvdata/vendor/mnt
else if (name == "tv.db")
baseDir = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(baseDir)))); // go down database/tvdata/vendor/mnt
if (name == "hotel.bin")
baseDir = Path.Combine(baseDir, "mnt", "vendor", "tvdata", "database");
else if (name == "idtvchannel.bin")
baseDir = Path.GetDirectoryName(baseDir); // go down channel/database/tvdata/vendor/mnt

var hotelBin = Path.Combine(baseDir, "hotel.bin");
if (File.Exists(hotelBin) && File.Exists(Path.Combine(baseDir, "mnt/vendor/tvdata/database", "tv.db")) && File.Exists(Path.Combine(baseDir, "mnt/vendor/tvdata/database/channel", "idtvChannel.bin")))
return new IdtvChannelSerializer(hotelBin);
var tvDb = Path.Combine(baseDir, "tv.db");
if (File.Exists(tvDb) && File.Exists(Path.Combine(baseDir, "channel", "idtvChannel.bin")))
return new IdtvChannelSerializer(tvDb);

// Android based models use an .xml format. Unfortunately that format is utter garbage and not really useful
var ext = Path.GetExtension(inputFile).ToLowerInvariant();
Expand Down
13 changes: 12 additions & 1 deletion source/ChanSort/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ private void UpdateFavoritesEditor(Favorites favorites)
this.repositoryItemCheckedComboBoxEdit2.Items.Clear();
var regex = "[";
var favCount = 0;
for (var favMask = (ulong)favorites; (favMask & 1) != 0; favMask >>= 1)
for (int i = 0; i < this.currentTvSerializer.Features.MaxFavoriteLists; i++)
{
var c = (char) ('A' + favCount);
++favCount;
Expand Down Expand Up @@ -2552,6 +2552,17 @@ private void grid_DragDrop(GridView gview)
var selectedChannels = this.GetSelectedChannels(this.dragDropInfo.SourceView);
int newProgNr;
var dropPos = dropChannel.GetPosition(this.subListIndex);
if (this.dragDropInfo.EditMode == EditMode.Swap)
newProgNr = dropPos;
else if (this.dragDropInfo.EditMode == EditMode.InsertBefore)
{

}
else
{

}

if (this.dragDropInfo.EditMode != EditMode.InsertAfter || !this.cbCloseGap.Checked)
newProgNr = dropPos;
else
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions source/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
ChanSort Change Log
===================

2023-06-01
- Panasonic LS 500 / LX 700 series: support for new firmware which doesn't export a hotel.bin file.
- Loewe servicelist.xml (and maybe some other .xml files) larger than 2 000 000 bytes were
not loaded.
- Enigma/Linux lists can now also be opened by selecting a .tv or .radio file (not just lamedb)

2023-02-20
- added support for Medion Ultra HD Android Smart TV "senderliste.txt" format,
containing lines with JSON data, e.g. Medion X15567 (MD31555)
Expand Down

0 comments on commit 68d3fc4

Please sign in to comment.