mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-03-18 01:40:18 +01:00
- 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:
@@ -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" />
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user