- LG GlobalClone: Favorites were not loaded correctly into ChanSort

- LG GlobalClone: some changes that might fix problems where the TV didn't work properly
  with an importet list (ChanSort now modifies less data in the file)
- Menu items for hide/unhide, skip/unskip, lock/unlock are now disabled when these features are not supported by the
  channel list file format
- Applying a .txt reference list (which doesn't contain information about skip/lock/hide) will no longer clear these
  flags in the current channel list
This commit is contained in:
hbeham
2019-11-24 20:00:48 +01:00
parent cdd7c219a1
commit 9ba8a357ed
18 changed files with 107 additions and 18 deletions

View File

@@ -31,6 +31,8 @@ namespace ChanSort.Api
{
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.CanSkipChannels = true;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = true;
this.Features.DeleteMode = DeleteMode.FlagWithoutPrNr;
this.Features.CanHaveGaps = true;
this.Features.EncryptedFlagEdit = false;

View File

@@ -293,10 +293,14 @@ namespace ChanSort.Api
chan.NewProgramNr = -1;
tvChannel.SetPosition(0, newNr);
tvChannel.Skip = refChannel.Skip;
tvChannel.Lock = refChannel.Lock;
tvChannel.Hidden = refChannel.Hidden;
tvChannel.IsDeleted = refChannel.IsDeleted;
if (refDataRoot.CanSkip && this.DataRoot.CanSkip)
tvChannel.Skip = refChannel.Skip;
if (refDataRoot.CanLock && this.DataRoot.CanLock)
tvChannel.Lock = refChannel.Lock;
if (refDataRoot.CanHide && this.DataRoot.CanHide)
tvChannel.Hidden = refChannel.Hidden;
//tvChannel.IsDeleted = refChannel.IsDeleted;
if ((tvChannel.SignalSource & SignalSource.Analog) != 0 && !string.IsNullOrEmpty(refChannel.Name))
{
tvChannel.Name = refChannel.Name;

View File

@@ -25,6 +25,8 @@ namespace ChanSort.Api
public bool CleanUpChannelData { get; set; }
public bool DeviceSettings { get; set; }
public bool CanSkipChannels { get; set; } = true;
public bool CanLockChannels { get; set; } = true;
public bool CanHideChannels { get; set; } = true;
public bool CanHaveGaps { get; set; } = true;
public bool EncryptedFlagEdit { get; set; }
public DeleteMode DeleteMode { get; set; } = DeleteMode.NotSupported;

View File

@@ -16,6 +16,8 @@ namespace ChanSort.Api
{
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.CanSkipChannels = false;
this.Features.CanLockChannels = false;
this.Features.CanHideChannels = false;
this.Features.DeleteMode = DeleteMode.Physically;
this.Features.CanHaveGaps = true;
this.Features.EncryptedFlagEdit = false;

View File

@@ -23,6 +23,9 @@ namespace ChanSort.Api
public bool MixedSourceFavorites => this.loader.Features.MixedSourceFavorites;
public bool AllowGapsInFavNumbers => this.loader.Features.AllowGapsInFavNumbers;
public bool DeletedChannelsNeedNumbers => this.loader.Features.DeleteMode == SerializerBase.DeleteMode.FlagWithPrNr;
public bool CanSkip => this.loader.Features.CanSkipChannels;
public bool CanLock => this.loader.Features.CanLockChannels;
public bool CanHide => this.loader.Features.CanHideChannels;
public DataRoot(SerializerBase loader)
{

View File

@@ -25,8 +25,11 @@ namespace ChanSort.Loader.GlobalClone
public GcSerializer(string inputFile) : base(inputFile)
{
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.DeleteMode = DeleteMode.FlagWithPrNr;
this.Features.DeleteMode = DeleteMode.FlagWithoutPrNr;
this.Features.CanHaveGaps = true;
this.Features.CanSkipChannels = true;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = true;
this.DataRoot.AddChannelList(this.atvChannels);
this.DataRoot.AddChannelList(this.dtvTvChannels);
@@ -272,7 +275,7 @@ namespace ChanSort.Loader.GlobalClone
case "transport_id":
ch.TransportStreamId = int.Parse(info.InnerText);
break;
case "service_id":
case "service_id": // also same value in "programNo"
ch.ServiceId = int.Parse(info.InnerText);
break;
case "serviceType":
@@ -320,7 +323,7 @@ namespace ChanSort.Loader.GlobalClone
this.Features.SupportedFavorites |= (Favorites)mask;
this.Features.SortedFavorites = true;
if (((int)ch.Favorites & mask) != 0) // xml element holds bad index data (250) when fav is not set
ch.SetPosition(n + 1, int.Parse(info.InnerText));
ch.SetOldPosition(n + 1, int.Parse(info.InnerText));
}
break;
}
@@ -379,7 +382,6 @@ namespace ChanSort.Loader.GlobalClone
{
foreach (var list in this.DataRoot.ChannelLists)
{
foreach (var channel in list.Channels)
{
var ch = channel as GcChannel;
@@ -425,17 +427,25 @@ namespace ChanSort.Loader.GlobalClone
// ?
break;
case "isDisabled":
node.InnerText = ch.IsDeleted || ch.IsDisabled ? "1" : "0";
node.InnerText = ch.IsDisabled /* || ch.IsDeleted */ ? "1" : "0";
break;
case "isDeleted":
node.InnerText = ch.IsDeleted ? "1" : "0";
break;
case "isUserSelCHNo":
if (ch.NewProgramNr != ch.OldProgramNr)
node.InnerText = "1";
node.InnerText = ch.IsDeleted ? "0" : "1";
break;
case "mapType":
mapType = node.InnerText;
if (int.TryParse(mapType, out int value))
{
if (ch.IsDeleted)
value |= 0x02; // all channels that have isDeleted=1 had mapType=0x03, all other channels had mapType=0x01
else
value &= ~0x02;
node.InnerText = value.ToString();
}
break;
case "mapAttr":
if (mapType == "1")
@@ -474,6 +484,9 @@ namespace ChanSort.Loader.GlobalClone
xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n\r\n" + xml;
xml = xml.Replace("<ATV></ATV>\r\n", "<ATV>\r\n</ATV>\r\n");
xml = xml.Replace("<DTV></DTV>\r\n", "<DTV>\r\n</DTV>\r\n");
xml = xml.Replace("<hexAszTkgsMessage type=\"0\"></hexAszTkgsMessage>", "<hexAszTkgsMessage type=\"0\"> </hexAszTkgsMessage>");
xml = xml.Replace("<aszTkgsMessage type=\"0\"></aszTkgsMessage>", "<aszTkgsMessage type=\"0\"> </aszTkgsMessage>");
if (!xml.EndsWith("\r\n"))
xml += "\r\n";
File.WriteAllText(tvOutputFile, xml, settings.Encoding);

View File

@@ -94,6 +94,8 @@ namespace ChanSort.Loader.Hisense
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.DeleteMode = DeleteMode.NotSupported;
this.Features.CanSkipChannels = false;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = true;
this.Features.CanHaveGaps = true;
this.Features.SortedFavorites = true;

View File

@@ -121,6 +121,8 @@ namespace ChanSort.Loader.Hisense2017
Features.ChannelNameEdit = ChannelNameEditMode.All;
Features.DeleteMode = DeleteMode.FlagWithPrNr;
Features.CanSkipChannels = true;
Features.CanLockChannels = true;
Features.CanHideChannels = true;
Features.CanHaveGaps = true;
Features.MixedSourceFavorites = true;
Features.SortedFavorites = true;

View File

@@ -77,6 +77,9 @@ namespace ChanSort.Loader.LG
{
this.Features.ChannelNameEdit = ChannelNameEditMode.Analog;
this.Features.DeleteMode = DeleteMode.FlagWithoutPrNr;
this.Features.CanSkipChannels = true;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = true;
this.Features.CanHaveGaps = true;
this.Features.DeviceSettings = true;
this.Features.CleanUpChannelData = true;

View File

@@ -41,6 +41,9 @@ namespace ChanSort.Loader.Panasonic
this.Features.ChannelNameEdit = ChannelNameEditMode.None; // due to the chaos with binary data inside the "sname" string column, writing back a name has undesired side effects
this.Features.DeleteMode = DeleteMode.Physically;
this.Features.CanSkipChannels = true;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = false;
this.Features.CanHaveGaps = false;
this.Features.EncryptedFlagEdit = true;
this.Features.SortedFavorites = true;

View File

@@ -11,12 +11,30 @@ namespace ChanSort.Loader.PhilipsXml
{
/*
This loader supports 2 different kinds of XML files from Philips.
I had a test file "DVBS.xml" with satellite channels and entries like:
<Channel>
<Setup SatelliteName="0x54 0x00 0x55 0x00 0x52 0x00 0x4B 0x00 0x53 0x00 0x41 0x00 0x54 0x00 0x20 0x00 0x34 0x00 0x32 0x00 0x45 0x00 " ChannelNumber="1" ChannelName="0x54 0x00 0xC4 0x00 0xB0 0x00 0x56 0x00 0xC4 0x00 0xB0 0x00 0x42 0x00 0x55 0x00 0x20 0x00 0x53 0x00 0x50 0x00 0x4F 0x00 0x52 0x00 " ChannelLock="0" UserModifiedName="0" LogoID="0" UserModifiedLogo="0" LogoLock="0" UserHidden="0" FavoriteNumber="0" />
<Broadcast ChannelType="3" Onid="1070" Tsid="43203" Sid="16001" Frequency="11794" Modulation="0" ServiceType="1" SymbolRate="27507" LNBNumber="38" Polarization="0" SystemHidden="0" />
<Setup SatelliteName="0x54 0x00 0x55 0x00 0x52 0x00 0x4B 0x00 0x53 0x00 0x41 0x00 0x54 0x00 0x20 0x00 0x34 0x00 0x32 0x00 0x45 0x00 " ChannelNumber="1" ChannelName="0x54 0x00 0xC4 0x00 0xB0 0x00 0x56 0x00 0xC4 0x00 0xB0 0x00 0x42 0x00 0x55 0x00 0x20 0x00 0x53 0x00 0x50 0x00 0x4F 0x00 0x52 0x00 " ChannelLock="0" UserModifiedName="0" LogoID="0" UserModifiedLogo="0" LogoLock="0" UserHidden="0" FavoriteNumber="0" />
<Broadcast ChannelType="3" Onid="1070" Tsid="43203" Sid="16001" Frequency="11794" Modulation="0" ServiceType="1" SymbolRate="27507" LNBNumber="38" Polarization="0" SystemHidden="0" />
</Channel>
Example from a ChannelMap_100\ChannelList\channellib\DVBC.xml:
<Channel>
<Setup ChannelNumber="2" ChannelName="0x50 0x00 0x61 0x00 0x72 0x00 0x61 0x00 0x6D 0x00 0x6F 0x00 0x75 0x00 0x6E 0x00 0x74 0x00 0x20 0x00 0x43 0x00 0x68 0x00 0x61 0x00 0x6E 0x00 0x6E 0x00 0x65 0x00 0x6C 0x00 " LogoID="0" ChannelLock="0" UserModifiedName="0" UserModifiedLogo="0" LogoLock="0" UserHidden="0" FavoriteNumber="0" Scramble="0"></Setup>
<Broadcast ChannelType="3" Onid="1" Tsid="104" Sid="357" Frequency="386000000" Modulation="64" ServiceType="1" Bandwidth="8" SymbolRate="6900" DecoderType="2" SubType="0" NetworkID="0" StreamPriority="0" SystemHidden="0"></Broadcast>
</Channel>
Example from a ChannelMap_105\ChannelList\s2channellib\DVBS.xml:
<Channel>
<Setup SatelliteName="0x41 0x00 0x53 0x00 0x54 0x00 0x52 0x00 0x41 0x00 0x20 0x00 0x31 0x00 0x39 0x00 0x2E 0x00 0x32 0x00 0x45 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00" ChannelNumber="45" ChannelName="0x31 0x00 0x2D 0x00 0x32 0x00 0x2D 0x00 0x33 0x00 0x2E 0x00 0x74 0x00 0x76 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00" ChannelLock="0" UserModifiedName="0" LogoID="1441" UserModifiedLogo="0" LogoLock="0" UserHidden="0" FavoriteNumber="45" Scrambled="0"></Setup>
<Broadcast UniqueID="14" ChannelType="3" Onid="133" Tsid="5" Sid="1" Frequency="12460" Modulation="8-VSB" ServiceType="1" SymbolRate="27500" LNBNumber="1" Polarization="1" SystemHidden="0"></Broadcast>
</Channel>
Example from a ChannelMap_110\ChannelList\channellib\DVBC.xml:
<Channel>
<Setup ChannelNumber="1" ChannelName="0x44 0x00 0x61 0x00 0x73 0x00 0x20 0x00 0x45 0x00 0x72 0x00 0x73 0x00 0x74 0x00 0x65 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00" ChannelLock="0" UserModifiedName="0" LogoID="0" UserModifiedLogo="0" LogoLock="0" UserHidden="0" FavoriteNumber="0" Scrambled="0"></Setup>
<Broadcast UniqueID="12" ChannelType="3" Onid="1" Tsid="1101" Sid="1" Frequency="306" Modulation="256" ServiceType="1" Bandwidth="8" SymbolRate="6901000" DecoderType="2" NetworkID="43264" StreamPriority="0" SystemHidden="0"></Broadcast>
</Channel>
The other file was "CM_TPM1013E_LA_CK.xml" with entries like:
<Channel>
@@ -43,6 +61,9 @@ namespace ChanSort.Loader.PhilipsXml
public Serializer(string inputFile) : base(inputFile)
{
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.CanSkipChannels = false;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = true;
this.Features.DeleteMode = DeleteMode.Physically;
this.Features.CanSaveAs = false;
@@ -252,8 +273,10 @@ namespace ChanSort.Loader.PhilipsXml
foreach(XmlAttribute attr in n.Attributes)
data.Add(attr.LocalName, attr.Value);
}
var chan = new Channel(curList.SignalSource & SignalSource.MaskAdInput, rowId, rowId, setupNode);
if (!int.TryParse(data["UniqueID"], out var uniqueId)) // UniqueId only exists in ChannelMap_105 and later
uniqueId = rowId;
var chan = new Channel(curList.SignalSource & SignalSource.MaskAdInput, rowId, uniqueId, setupNode);
chan.OldProgramNr = -1;
chan.IsDeleted = false;
if (file.formatVersion == 1)

View File

@@ -63,6 +63,9 @@ namespace ChanSort.Loader.Samsung
this.ReadConfigurationFromIniFile();
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.DeleteMode = DeleteMode.FlagWithPrNr;
this.Features.CanSkipChannels = true;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = true;
this.Features.CleanUpChannelData = true;
this.Features.EncryptedFlagEdit = true;
}

View File

@@ -26,6 +26,9 @@ namespace ChanSort.Loader.SamsungJ
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.DeleteMode = DeleteMode.Physically;
this.Features.CanSkipChannels = true;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = true;
this.Features.SupportedFavorites = Favorites.A | Favorites.B | Favorites.C | Favorites.D | Favorites.E;
this.Features.SortedFavorites = true;
this.Features.AllowGapsInFavNumbers = false;

View File

@@ -17,6 +17,9 @@ namespace ChanSort.Loader.SilvaSchneider
{
this.Features.ChannelNameEdit = ChannelNameEditMode.None;
this.Features.DeleteMode = DeleteMode.Physically;
this.Features.CanSkipChannels = false;
this.Features.CanLockChannels = false;
this.Features.CanHideChannels = false;
this.Features.SortedFavorites = false;
this.Features.SupportedFavorites = 0;

View File

@@ -65,6 +65,10 @@ namespace ChanSort.Loader.Sony
this.Features.DeleteMode = DeleteMode.FlagWithoutPrNr; // in Android/e-format, this will be changed to FlagWithPrNr
this.Features.MixedSourceFavorites = false; // true for Android/e-format
this.Features.SortedFavorites = false; // true for Android/e-format
this.Features.CanSkipChannels = false;
this.Features.CanLockChannels = false;
this.Features.CanHideChannels = false; // true in Android/e-format
this.DataRoot.AddChannelList(new ChannelList(SignalSource.DvbT | SignalSource.Tv, "DVB-T TV"));
this.DataRoot.AddChannelList(new ChannelList(SignalSource.DvbT | SignalSource.Radio, "DVB-T Radio"));
@@ -164,6 +168,7 @@ namespace ChanSort.Loader.Sony
this.format = "e" + formatNode.InnerText;
this.isEFormat = true;
this.Features.DeleteMode = DeleteMode.FlagWithPrNr;
this.Features.CanHideChannels = true;
this.Features.MixedSourceFavorites = true;
this.Features.SortedFavorites = true;
this.mixedFavList = new ChannelList(SignalSource.All, "Favorites");

View File

@@ -25,6 +25,9 @@ namespace ChanSort.Loader.Toshiba
this.Features.ChannelNameEdit = ChannelNameEditMode.All;
this.Features.DeleteMode = DeleteMode.Physically;
this.Features.CanSkipChannels = false;
this.Features.CanLockChannels = true;
this.Features.CanHideChannels = false; // true in Android/e-format
this.DataRoot.AddChannelList(this.atvChannels);
this.DataRoot.AddChannelList(this.dtvTvChannels);

View File

@@ -1480,7 +1480,7 @@ namespace ChanSort.Ui
{
if (filter.Contains("+" + col.FieldName)) // force-show without further checks
return true;
if (!filter.Contains(col.FieldName)) // force-hide without further checks
if (filter.Contains("-" + col.FieldName) || !filter.Contains(col.FieldName)) // force-hide without further checks
return false;
}
else if (col.Tag is bool originalVisible && !originalVisible)
@@ -1497,7 +1497,6 @@ namespace ChanSort.Ui
if (col == this.colAudioPid) return (source & SignalSource.Digital) != 0;
//if (col == this.colServiceType) return (source & SignalSource.Digital) != 0;
if (col == this.colServiceTypeName) return (source & SignalSource.Digital) != 0;
if (col == this.colEncrypted) return (source & SignalSource.Digital) != 0;
if (col == this.colTransportStreamId) return (source & SignalSource.Digital) != 0;
if (col == this.colNetworkName) return (source & SignalSource.Digital) != 0;
if (col == this.colNetworkOperator) return (source & SignalSource.Digital) != 0;
@@ -1505,6 +1504,9 @@ namespace ChanSort.Ui
if (col == this.colSatellite) return (source & SignalSource.Sat) != 0;
if (col == this.colNetworkId) return (source & SignalSource.Digital) != 0;
if (col == this.colSymbolRate) return (source & SignalSource.Digital) != 0;
if (col == this.colSkip) return (source & SignalSource.Digital) != 0 && this.DataRoot.CanSkip;
if (col == this.colLock) return (source & SignalSource.Digital) != 0 && this.DataRoot.CanLock;
if (col == this.colHidden) return (source & SignalSource.Digital) != 0 && this.DataRoot.CanHide;
if (col == this.colIndex) return col.Visible;
if (col == this.colUid) return col.Visible;
if (col == this.colDebug) return col.Visible;
@@ -1643,6 +1645,8 @@ namespace ChanSort.Ui
this.miMoveDown.Visibility = visLeft;
this.miAddChannel.Visibility = visRight;
this.miSkipOn.Enabled = this.miSkipOff.Enabled = this.currentTvSerializer?.Features.CanSkipChannels ?? false;
this.miLockOn.Enabled = this.miLockOff.Enabled = this.currentTvSerializer?.Features.CanLockChannels ?? false;
this.miHideOn.Enabled = this.miHideOff.Enabled = this.currentTvSerializer?.Features.CanHideChannels ?? false;
var isLeftGridSortedByNewProgNr = this.IsLeftGridSortedByNewProgNr;
var sel = this.gviewLeft.GetSelectedRows();

View File

@@ -1,6 +1,15 @@
ChanSort Change Log
===================
2019-11-24
- LG GlobalClone: Favorites were not loaded correctly into ChanSort
- LG GlobalClone: some changes that might fix problems where the TV didn't work properly
with an importet list (ChanSort now modifies less data in the file)
- Menu items for hide/unhide, skip/unskip, lock/unlock are now disabled when these features are not supported by the
channel list file format
- Applying a .txt reference list (which doesn't contain information about skip/lock/hide) will no longer clear these
flags in the current channel list
2019-11-18
- Philips: fixed file detection in some ChannelMap_xxx folder structures