mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-05-07 14:37:49 +02:00
- 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:
@@ -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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user