- fixed saving VDR lists after applying a reference list which contained no longer existing channels (cast exception for the proxy ChannelInfo record)

- no longer load samsung .zip lists with invalid internal folder structure (all files must be in the root folder of the .zip)
This commit is contained in:
hbeham
2019-02-10 16:59:20 +01:00
parent c57dd9e4b9
commit de68993721
2 changed files with 11 additions and 4 deletions

View File

@@ -107,8 +107,13 @@ namespace ChanSort.Loader.SamsungJ
using (ZipFile zip = new ZipFile(this.FileName))
{
foreach(ZipEntry entry in zip)
this.Expand(zip, entry.Name);
foreach (ZipEntry entry in zip)
{
// only expand files from the root folder to avoid pit-falls with incorrectly rezipped lists
// that contain the data files in a subfolder
if (Path.GetDirectoryName(entry.Name) == "")
this.Expand(zip, entry.Name);
}
}
}
#endregion

View File

@@ -59,9 +59,11 @@ namespace ChanSort.Loader.VDR
using (StreamWriter file = new StreamWriter(tvOutputFile))
{
foreach (Channels channelInfo in this.allChannels.GetChannelsByNewOrder())
foreach (ChannelInfo channel in this.allChannels.GetChannelsByNewOrder())
{
file.WriteLine(channelInfo.confLine);
// when a reference list was applied, the list may contain proxy entries for deleted channels, which must be ignored
if (channel is Channels vdrChannel)
file.WriteLine(vdrChannel.confLine);
}
}
}