Skip to content

Commit 864819f

Browse files
committed
- TCL: fixed deleting channels
1 parent dd96064 commit 864819f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

source/ChanSort.Loader.TCL/DtvDataSerializer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,9 @@ private void WriteChannels(SqliteCommand cmd, SqliteCommand cmdDelete, ChannelLi
385385
cmd.Prepare();
386386

387387
#if !TestBuild
388-
//cmdDelete.CommandText = @"delete from PrograminfoTbl where u32Index=@handle;";
389-
//cmdDelete.Parameters.Add("@handle", SqliteType.Integer);
390-
//cmdDelete.Prepare();
388+
cmdDelete.CommandText = @"delete from PrograminfoTbl where u32Index=@handle;";
389+
cmdDelete.Parameters.Add("@handle", SqliteType.Integer);
390+
cmdDelete.Prepare();
391391
#endif
392392

393393
foreach (ChannelInfo channel in channelList.Channels)

source/ChanSort/MainForm.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,11 @@ private List<ChannelInfo> GetSelectedChannels(GridView gview, bool selectAllIfOn
13991399
foreach (var rowHandle in gview.GetSelectedRows())
14001400
{
14011401
if (gview.IsDataRow(rowHandle))
1402-
channels.Add((ChannelInfo) gview.GetRow(rowHandle));
1402+
{
1403+
var chan = (ChannelInfo)gview.GetRow(rowHandle); // this method get called while updating the grid, resulting in NULL objects to be returned
1404+
if (chan != null)
1405+
channels.Add(chan);
1406+
}
14031407
}
14041408
}
14051409

source/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
ChanSort Change Log
22
===================
33

4+
2023-01-10
5+
- TCL: fixed deleting channels
6+
47
2023-01-08
58
- TCL/Thomson .tar: custom implementation for reading/writing .tar archives, preserving all
69
unix file metadata (based on "old-GNU" .tar flavor, like the files exported by the TV)

0 commit comments

Comments
 (0)