update channel settings

pull/702/head
Luke Pulverenti 9 years ago
parent 45c8f51a9c
commit 9c879eefc3

@ -273,10 +273,9 @@ namespace MediaBrowser.Controller.LiveTv
/// <summary> /// <summary>
/// Gets the live tv folder. /// Gets the live tv folder.
/// </summary> /// </summary>
/// <param name="userId">The user identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>BaseItemDto.</returns> /// <returns>BaseItemDto.</returns>
Task<Folder> GetInternalLiveTvFolder(string userId, CancellationToken cancellationToken); Task<Folder> GetInternalLiveTvFolder(CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Gets the live tv folder. /// Gets the live tv folder.

@ -50,6 +50,7 @@ namespace MediaBrowser.Model.Configuration
public string[] PlainFolderViews { get; set; } public string[] PlainFolderViews { get; set; }
public bool HidePlayedInLatest { get; set; } public bool HidePlayedInLatest { get; set; }
public bool DisplayChannelsInline { get; set; }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="UserConfiguration" /> class. /// Initializes a new instance of the <see cref="UserConfiguration" /> class.

@ -1824,7 +1824,7 @@ namespace MediaBrowser.Server.Implementations.Library
throw new ArgumentNullException("name"); throw new ArgumentNullException("name");
} }
var idValues = "37_namedview_" + name + (parentId ?? string.Empty); var idValues = "37_namedview_" + name + (parentId ?? string.Empty) + (viewType ?? string.Empty);
if (!string.IsNullOrWhiteSpace(uniqueId)) if (!string.IsNullOrWhiteSpace(uniqueId))
{ {
idValues += uniqueId; idValues += uniqueId;

@ -156,7 +156,7 @@ namespace MediaBrowser.Server.Implementations.Library
var channels = channelResult.Items; var channels = channelResult.Items;
var embeddedChannels = channels var embeddedChannels = channels
.Where(i => user.Configuration.DisplayChannelsWithinViews.Contains(i.Id.ToString("N"))) .Where(i => user.Configuration.DisplayChannelsInline || user.Configuration.DisplayChannelsWithinViews.Contains(i.Id.ToString("N")))
.ToList(); .ToList();
list.AddRange(embeddedChannels); list.AddRange(embeddedChannels);
@ -168,8 +168,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (_liveTvManager.GetEnabledUsers().Select(i => i.Id.ToString("N")).Contains(query.UserId)) if (_liveTvManager.GetEnabledUsers().Select(i => i.Id.ToString("N")).Contains(query.UserId))
{ {
var name = _localizationManager.GetLocalizedString("ViewType" + CollectionType.LiveTv); list.Add(await _liveTvManager.GetInternalLiveTvFolder(CancellationToken.None).ConfigureAwait(false));
list.Add(await _libraryManager.GetNamedView(name, CollectionType.LiveTv, string.Empty, cancellationToken).ConfigureAwait(false));
} }
} }

@ -2196,15 +2196,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{ {
var user = string.IsNullOrEmpty(userId) ? null : _userManager.GetUserById(userId); var user = string.IsNullOrEmpty(userId) ? null : _userManager.GetUserById(userId);
var folder = await GetInternalLiveTvFolder(userId, cancellationToken).ConfigureAwait(false); var folder = await GetInternalLiveTvFolder(cancellationToken).ConfigureAwait(false);
return _dtoService.GetBaseItemDto(folder, new DtoOptions(), user); return _dtoService.GetBaseItemDto(folder, new DtoOptions(), user);
} }
public async Task<Folder> GetInternalLiveTvFolder(string userId, CancellationToken cancellationToken) public async Task<Folder> GetInternalLiveTvFolder(CancellationToken cancellationToken)
{ {
var name = _localization.GetLocalizedString("ViewTypeLiveTV"); var name = _localization.GetLocalizedString("ViewTypeLiveTV");
return await _libraryManager.GetNamedView(name, "livetv", "zz_" + name, cancellationToken).ConfigureAwait(false); return await _libraryManager.GetNamedView(name, "livetv", name, cancellationToken).ConfigureAwait(false);
} }
public async Task<TunerHostInfo> SaveTunerHost(TunerHostInfo info) public async Task<TunerHostInfo> SaveTunerHost(TunerHostInfo info)

Loading…
Cancel
Save