- updated NuGet packages

- added support for dtv_cmdb_3.bin file with file size 1323920
- fixed error when opening reference list dialog with Italian translation
- "Tornado" TV lists which are a slight variation of old Philips lists using a file name __chtb_do_not_delete_.xml
This commit is contained in:
Horst Beham
2024-08-18 17:41:46 +02:00
parent 78e53e7183
commit d33f349626
53 changed files with 712 additions and 429 deletions

View File

@@ -32,7 +32,7 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.8" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />

View File

@@ -175,9 +175,11 @@ namespace ChanSort.Loader.Panasonic
{
if (chan is not XmlChannel ch)
continue;
ch.Node.Attributes["ChannelNumber"].InnerText = ch.NewProgramNr.ToString();
SetXmlValue(ch.Node, "ChannelNumber", ch.NewProgramNr.ToString());
if (setIsModified && ch.NewProgramNr != ch.OldProgramNr)
ch.Node.Attributes["IsModified"].InnerText = "1";
SetXmlValue(ch.Node, "IsModified", "1");
if (reorder)
{
var parent = ch.Node.ParentNode;
@@ -282,6 +284,28 @@ namespace ChanSort.Loader.Panasonic
}
#endregion
#region SetXmlValue()
static void SetXmlValue(XmlNode node, string field, string value)
{
// old format stored all values as attributes of <ChannelInfo ...>
if (node.Attributes != null && node.Attributes.Count > 0)
{
node.Attributes[field].InnerText = value;
return;
}
// new format with meaningful channel names stores all values as child elements
foreach (XmlNode child in node.ChildNodes)
{
if (child is XmlElement elem && elem.LocalName == field)
{
elem.InnerText = value;
return;
}
}
}
#endregion
#region class XmlChannel
class XmlChannel : ChannelInfo