Skip to content

Commit

Permalink
- TCL: fixed deleting channels
Browse files Browse the repository at this point in the history
  • Loading branch information
PredatH0r committed Jan 10, 2023
1 parent dd96064 commit 864819f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions source/ChanSort.Loader.TCL/DtvDataSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ private void WriteChannels(SqliteCommand cmd, SqliteCommand cmdDelete, ChannelLi
cmd.Prepare();

#if !TestBuild
//cmdDelete.CommandText = @"delete from PrograminfoTbl where u32Index=@handle;";
//cmdDelete.Parameters.Add("@handle", SqliteType.Integer);
//cmdDelete.Prepare();
cmdDelete.CommandText = @"delete from PrograminfoTbl where u32Index=@handle;";
cmdDelete.Parameters.Add("@handle", SqliteType.Integer);
cmdDelete.Prepare();
#endif

foreach (ChannelInfo channel in channelList.Channels)
Expand Down
6 changes: 5 additions & 1 deletion source/ChanSort/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,11 @@ private List<ChannelInfo> GetSelectedChannels(GridView gview, bool selectAllIfOn
foreach (var rowHandle in gview.GetSelectedRows())
{
if (gview.IsDataRow(rowHandle))
channels.Add((ChannelInfo) gview.GetRow(rowHandle));
{
var chan = (ChannelInfo)gview.GetRow(rowHandle); // this method get called while updating the grid, resulting in NULL objects to be returned
if (chan != null)
channels.Add(chan);
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions source/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ChanSort Change Log
===================

2023-01-10
- TCL: fixed deleting channels

2023-01-08
- TCL/Thomson .tar: custom implementation for reading/writing .tar archives, preserving all
unix file metadata (based on "old-GNU" .tar flavor, like the files exported by the TV)
Expand Down

0 comments on commit 864819f

Please sign in to comment.