- fixed channel names turning from bad-byte-order-UTF16-varchar to BLOB when saving (probably the cause of Samsung J errors)

- Samsung E,F,H,J .scm file format: allow independant reordering of each favorites list (with editable numbers)
- Samsung J .zip file format: predefined lists can be edited again, allow independant reordering of each favorites list (sequential numbers), allow deleting channels
This commit is contained in:
hbeham
2015-11-29 20:36:56 +01:00
parent e795d00ebb
commit 845c1c44c1
11 changed files with 134 additions and 181 deletions

View File

@@ -402,5 +402,24 @@ namespace ChanSort.Api
}
#endregion
#region SequentializeFavPos()
/// <summary>
/// Put the numbers in channel.FavIndex[i] in a sequential order, starting with 1
/// </summary>
/// <param name="channelList"></param>
/// <param name="favCount">Number of favorite lists (i=0..favCount-1)</param>
public static void SequentializeFavPos(ChannelList channelList, int favCount)
{
for (int fav = 0; fav < favCount; fav++)
{
var list = channelList.Channels.Where(c => c.FavIndex[fav] >= 0).OrderBy(c => c.FavIndex[fav]).ToList();
int i = 0;
foreach (var channel in list)
channel.FavIndex[fav] = ++i;
}
}
#endregion
}
}