mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-05-07 20:35:51 +02:00
- added support for 2016 Hisense channels.db SQLite file format
- DevExpress upgrade
This commit is contained in:
@@ -409,15 +409,24 @@ namespace ChanSort.Api
|
||||
/// </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)
|
||||
{
|
||||
/// <returns>true if there were any changes</returns>
|
||||
public static bool SequentializeFavPos(ChannelList channelList, int favCount)
|
||||
{
|
||||
bool changed = false;
|
||||
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;
|
||||
int i = 1;
|
||||
foreach (var channel in list)
|
||||
channel.FavIndex[fav] = ++i;
|
||||
{
|
||||
if (channel.FavIndex[fav] != i)
|
||||
{
|
||||
channel.FavIndex[fav] = ++i;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace ChanSort.Api
|
||||
public int MaxChannelNameLength { get; set; }
|
||||
public int PresetProgramNrCount { get; private set; }
|
||||
public IList<string> VisibleColumnFieldNames;
|
||||
public bool IsMixedSouceFavoritesList { get; set; }
|
||||
|
||||
#region Caption
|
||||
public string Caption
|
||||
|
||||
@@ -15,11 +15,13 @@ namespace ChanSort.Api
|
||||
public IDictionary<int, Satellite> Satellites { get { return this.satellites; } }
|
||||
public IDictionary<int, Transponder> Transponder { get { return this.transponder; } }
|
||||
public IDictionary<int, LnbConfig> LnbConfig { get { return this.lnbConfig; } }
|
||||
public ICollection<ChannelList> ChannelLists { get { return this.channelLists; } }
|
||||
public IEnumerable<ChannelList> ChannelLists { get { return this.channelLists; } }
|
||||
public bool IsEmpty { get { return this.channelLists.Count == 0; } }
|
||||
public bool NeedsSaving { get; set; }
|
||||
public Favorites SupportedFavorites { get; set; }
|
||||
public bool SortedFavorites { get; set; }
|
||||
public bool MixedSourceFavorites { get; set; }
|
||||
public bool AllowGapsInFavNumbers { get; set; }
|
||||
|
||||
public DataRoot()
|
||||
{
|
||||
@@ -59,6 +61,7 @@ namespace ChanSort.Api
|
||||
public virtual void AddChannelList(ChannelList list)
|
||||
{
|
||||
this.channelLists.Add(list);
|
||||
this.MixedSourceFavorites |= list.IsMixedSouceFavoritesList;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user