Refactor for clarity; add docs and .editorconfig
Refactored code to consistently use `this.` for instance members, improving clarity and maintainability. Added XML documentation comments to multiple methods and properties for better API documentation. Streamlined `FfProbeKeyframeExtractor` logic and enhanced EBML parsing code with comments and style improvements. Introduced a new `.editorconfig` to disable legacy StyleCop and IDisposableAnalyzers rules. Updated binary files, assembly info, and NuGet cache files due to rebuilds and dependency changes. No functional changes were made.
This commit is contained in:
@@ -27,12 +27,18 @@ namespace MediaBrowser.Controller.Channels
|
||||
[JsonIgnore]
|
||||
public override SourceType SourceType => SourceType.Channel;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this channel is visible to the specified user.
|
||||
/// </summary>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <param name="skipAllowedTagsCheck">Whether to skip the allowed tags check.</param>
|
||||
/// <returns>True if visible; otherwise, false.</returns>
|
||||
public override bool IsVisible(User user, bool skipAllowedTagsCheck = false)
|
||||
{
|
||||
var blockedChannelsPreference = user.GetPreferenceValues<Guid>(PreferenceKind.BlockedChannels);
|
||||
if (blockedChannelsPreference.Length != 0)
|
||||
{
|
||||
if (blockedChannelsPreference.Contains(Id))
|
||||
if (blockedChannelsPreference.Contains(this.Id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -40,7 +46,7 @@ namespace MediaBrowser.Controller.Channels
|
||||
else
|
||||
{
|
||||
if (!user.HasPermission(PermissionKind.EnableAllChannels)
|
||||
&& !user.GetPreferenceValues<Guid>(PreferenceKind.EnabledChannels).Contains(Id))
|
||||
&& !user.GetPreferenceValues<Guid>(PreferenceKind.EnabledChannels).Contains(this.Id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -49,12 +55,17 @@ namespace MediaBrowser.Controller.Channels
|
||||
return base.IsVisible(user, skipAllowedTagsCheck);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets items from the channel.
|
||||
/// </summary>
|
||||
/// <param name="query">The items query.</param>
|
||||
/// <returns>The query result.</returns>
|
||||
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
||||
{
|
||||
try
|
||||
{
|
||||
query.Parent = this;
|
||||
query.ChannelIds = new Guid[] { Id };
|
||||
query.ChannelIds = new Guid[] { this.Id };
|
||||
|
||||
// Don't blow up here because it could cause parent screens with other content to fail
|
||||
return ChannelManager.GetChannelItemsInternal(query, new Progress<double>(), CancellationToken.None).GetAwaiter().GetResult();
|
||||
@@ -66,21 +77,42 @@ namespace MediaBrowser.Controller.Channels
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal metadata path for this channel.
|
||||
/// </summary>
|
||||
/// <param name="basePath">The base path.</param>
|
||||
/// <returns>The internal metadata path.</returns>
|
||||
protected override string GetInternalMetadataPath(string basePath)
|
||||
{
|
||||
return GetInternalMetadataPath(basePath, Id);
|
||||
return GetInternalMetadataPath(basePath, this.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal metadata path for a channel with the specified ID.
|
||||
/// </summary>
|
||||
/// <param name="basePath">The base path.</param>
|
||||
/// <param name="id">The channel ID.</param>
|
||||
/// <returns>The internal metadata path.</returns>
|
||||
public static string GetInternalMetadataPath(string basePath, Guid id)
|
||||
{
|
||||
return System.IO.Path.Combine(basePath, "channels", id.ToString("N", CultureInfo.InvariantCulture), "metadata");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this channel can be deleted.
|
||||
/// </summary>
|
||||
/// <returns>True if deletable; otherwise, false.</returns>
|
||||
public override bool CanDelete()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the channel item is visible to the specified user.
|
||||
/// </summary>
|
||||
/// <param name="channelItem">The channel item.</param>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <returns>True if visible; otherwise, false.</returns>
|
||||
internal static bool IsChannelVisible(BaseItem channelItem, User user)
|
||||
{
|
||||
var channel = ChannelManager.GetChannel(channelItem.ChannelId.ToString(string.Empty));
|
||||
|
||||
Reference in New Issue
Block a user