Reduce warnings in MediaBrowser.Controller

This commit is contained in:
crobibero
2021-05-13 07:32:02 -06:00
parent 88a7875a27
commit 6bcbc2b88a
53 changed files with 412 additions and 427 deletions

View File

@@ -84,7 +84,7 @@ namespace MediaBrowser.Controller.Channels
internal static bool IsChannelVisible(BaseItem channelItem, User user)
{
var channel = ChannelManager.GetChannel(channelItem.ChannelId.ToString(""));
var channel = ChannelManager.GetChannel(channelItem.ChannelId.ToString(string.Empty));
return channel.IsVisible(user);
}

View File

@@ -51,32 +51,47 @@ namespace MediaBrowser.Controller.Channels
/// Gets the channels internal.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>The <see cref="QueryResult{T}"/> of <see cref="Channel"/>.</returns>
QueryResult<Channel> GetChannelsInternal(ChannelQuery query);
/// <summary>
/// Gets the channels.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>The <see cref="QueryResult{T}"/> of <see cref="BaseItemDto"/>.</returns>
QueryResult<BaseItemDto> GetChannels(ChannelQuery query);
/// <summary>
/// Gets the latest media.
/// Gets the latest channel items.
/// </summary>
/// <param name="query">The item query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItemDto"/>.</returns>
Task<QueryResult<BaseItemDto>> GetLatestChannelItems(InternalItemsQuery query, CancellationToken cancellationToken);
/// <summary>
/// Gets the latest media.
/// Gets the latest channel items.
/// </summary>
/// <param name="query">The item query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItem"/>.</returns>
Task<QueryResult<BaseItem>> GetLatestChannelItemsInternal(InternalItemsQuery query, CancellationToken cancellationToken);
/// <summary>
/// Gets the channel items.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItemDto"/>.</returns>
Task<QueryResult<BaseItemDto>> GetChannelItems(InternalItemsQuery query, CancellationToken cancellationToken);
/// <summary>
/// Gets the channel items internal.
/// Gets the channel items.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="progress">The progress to report to.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> containing the <see cref="QueryResult{T}"/> of <see cref="BaseItem"/>.</returns>
Task<QueryResult<BaseItem>> GetChannelItemsInternal(InternalItemsQuery query, IProgress<double> progress, CancellationToken cancellationToken);
/// <summary>
@@ -87,6 +102,11 @@ namespace MediaBrowser.Controller.Channels
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
IEnumerable<MediaSourceInfo> GetStaticMediaSources(BaseItem item, CancellationToken cancellationToken);
/// <summary>
/// Whether the item supports media probe.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>Whether media probe should be enabled.</returns>
bool EnableMediaProbe(BaseItem item);
}
}

View File

@@ -0,0 +1,8 @@
#pragma warning disable CS1591
namespace MediaBrowser.Controller.Channels
{
public interface IDisableMediaSourceDisplay
{
}
}

View File

@@ -0,0 +1,9 @@
#pragma warning disable CS1591
namespace MediaBrowser.Controller.Channels
{
public interface IHasFolderAttributes
{
string[] Attributes { get; }
}
}

View File

@@ -1,5 +1,3 @@
#pragma warning disable CS1591
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -7,11 +5,17 @@ using MediaBrowser.Model.Dto;
namespace MediaBrowser.Controller.Channels
{
/// <summary>
/// The channel requires a media info callback.
/// </summary>
public interface IRequiresMediaInfoCallback
{
/// <summary>
/// Gets the channel item media information.
/// </summary>
/// <param name="id">The channel item id.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The enumerable of media source info.</returns>
Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken);
}
}

View File

@@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Channels
{
@@ -19,35 +18,4 @@ namespace MediaBrowser.Controller.Channels
/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, CancellationToken cancellationToken);
}
public interface ISupportsLatestMedia
{
/// <summary>
/// Gets the latest media.
/// </summary>
/// <param name="request">The request.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken);
}
public interface ISupportsDelete
{
bool CanDelete(BaseItem item);
Task DeleteItem(string id, CancellationToken cancellationToken);
}
public interface IDisableMediaSourceDisplay
{
}
public interface ISupportsMediaProbe
{
}
public interface IHasFolderAttributes
{
string[] Attributes { get; }
}
}

View File

@@ -0,0 +1,17 @@
#nullable disable
#pragma warning disable CS1591
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Channels
{
public interface ISupportsDelete
{
bool CanDelete(BaseItem item);
Task DeleteItem(string id, CancellationToken cancellationToken);
}
}

View File

@@ -0,0 +1,21 @@
#nullable disable
#pragma warning disable CS1591
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Channels
{
public interface ISupportsLatestMedia
{
/// <summary>
/// Gets the latest media.
/// </summary>
/// <param name="request">The request.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken);
}
}

View File

@@ -0,0 +1,8 @@
#pragma warning disable CS1591
namespace MediaBrowser.Controller.Channels
{
public interface ISupportsMediaProbe
{
}
}

View File

@@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.Channels
public List<ChannelMediaContentType> ContentTypes { get; set; }
/// <summary>
/// Represents the maximum number of records the channel allows retrieving at a time.
/// Gets or sets the maximum number of records the channel allows retrieving at a time.
/// </summary>
public int? MaxPageSize { get; set; }
@@ -41,7 +41,7 @@ namespace MediaBrowser.Controller.Channels
public List<ChannelItemSortField> DefaultSortFields { get; set; }
/// <summary>
/// Indicates if a sort ascending/descending toggle is supported or not.
/// Gets or sets a value indicating whether a sort ascending/descending toggle is supported or not.
/// </summary>
public bool SupportsSortOrderToggle { get; set; }