mirror of https://github.com/jellyfin/jellyfin.git
Reduce warnings in MediaBrowser.Controller
This commit is contained in:
parent
88a7875a27
commit
6bcbc2b88a
|
@ -84,7 +84,7 @@ namespace MediaBrowser.Controller.Channels
|
||||||
|
|
||||||
internal static bool IsChannelVisible(BaseItem channelItem, User user)
|
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);
|
return channel.IsVisible(user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,32 +51,47 @@ namespace MediaBrowser.Controller.Channels
|
||||||
/// Gets the channels internal.
|
/// Gets the channels internal.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query">The query.</param>
|
/// <param name="query">The query.</param>
|
||||||
|
/// <returns>The <see cref="QueryResult{T}"/> of <see cref="Channel"/>.</returns>
|
||||||
QueryResult<Channel> GetChannelsInternal(ChannelQuery query);
|
QueryResult<Channel> GetChannelsInternal(ChannelQuery query);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the channels.
|
/// Gets the channels.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="query">The query.</param>
|
/// <param name="query">The query.</param>
|
||||||
|
/// <returns>The <see cref="QueryResult{T}"/> of <see cref="BaseItemDto"/>.</returns>
|
||||||
QueryResult<BaseItemDto> GetChannels(ChannelQuery query);
|
QueryResult<BaseItemDto> GetChannels(ChannelQuery query);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the latest media.
|
/// Gets the latest channel items.
|
||||||
/// </summary>
|
/// </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);
|
Task<QueryResult<BaseItemDto>> GetLatestChannelItems(InternalItemsQuery query, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the latest media.
|
/// Gets the latest channel items.
|
||||||
/// </summary>
|
/// </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);
|
Task<QueryResult<BaseItem>> GetLatestChannelItemsInternal(InternalItemsQuery query, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the channel items.
|
/// Gets the channel items.
|
||||||
/// </summary>
|
/// </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);
|
Task<QueryResult<BaseItemDto>> GetChannelItems(InternalItemsQuery query, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the channel items internal.
|
/// Gets the channel items.
|
||||||
/// </summary>
|
/// </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);
|
Task<QueryResult<BaseItem>> GetChannelItemsInternal(InternalItemsQuery query, IProgress<double> progress, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -87,6 +102,11 @@ namespace MediaBrowser.Controller.Channels
|
||||||
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
|
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
|
||||||
IEnumerable<MediaSourceInfo> GetStaticMediaSources(BaseItem item, CancellationToken cancellationToken);
|
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);
|
bool EnableMediaProbe(BaseItem item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
|
namespace MediaBrowser.Controller.Channels
|
||||||
|
{
|
||||||
|
public interface IDisableMediaSourceDisplay
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
|
namespace MediaBrowser.Controller.Channels
|
||||||
|
{
|
||||||
|
public interface IHasFolderAttributes
|
||||||
|
{
|
||||||
|
string[] Attributes { get; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,3 @@
|
||||||
#pragma warning disable CS1591
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -7,11 +5,17 @@ using MediaBrowser.Model.Dto;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Channels
|
namespace MediaBrowser.Controller.Channels
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The channel requires a media info callback.
|
||||||
|
/// </summary>
|
||||||
public interface IRequiresMediaInfoCallback
|
public interface IRequiresMediaInfoCallback
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the channel item media information.
|
/// Gets the channel item media information.
|
||||||
/// </summary>
|
/// </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);
|
Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaInfo(string id, CancellationToken cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Controller.Entities;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Channels
|
namespace MediaBrowser.Controller.Channels
|
||||||
{
|
{
|
||||||
|
@ -19,35 +18,4 @@ namespace MediaBrowser.Controller.Channels
|
||||||
/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
|
/// <returns>Task{IEnumerable{ChannelItemInfo}}.</returns>
|
||||||
Task<IEnumerable<ChannelItemInfo>> Search(ChannelSearchInfo searchInfo, CancellationToken cancellationToken);
|
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; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
|
namespace MediaBrowser.Controller.Channels
|
||||||
|
{
|
||||||
|
public interface ISupportsMediaProbe
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.Channels
|
||||||
public List<ChannelMediaContentType> ContentTypes { get; set; }
|
public List<ChannelMediaContentType> ContentTypes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public int? MaxPageSize { get; set; }
|
public int? MaxPageSize { get; set; }
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace MediaBrowser.Controller.Channels
|
||||||
public List<ChannelItemSortField> DefaultSortFields { get; set; }
|
public List<ChannelItemSortField> DefaultSortFields { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public bool SupportsSortOrderToggle { get; set; }
|
public bool SupportsSortOrderToggle { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ namespace MediaBrowser.Controller.Devices
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reportedId">The reported identifier.</param>
|
/// <param name="reportedId">The reported identifier.</param>
|
||||||
/// <param name="capabilities">The capabilities.</param>
|
/// <param name="capabilities">The capabilities.</param>
|
||||||
/// <returns>Task.</returns>
|
|
||||||
void SaveCapabilities(string reportedId, ClientCapabilities capabilities);
|
void SaveCapabilities(string reportedId, ClientCapabilities capabilities);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -47,6 +46,9 @@ namespace MediaBrowser.Controller.Devices
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether this instance [can access device] the specified user identifier.
|
/// Determines whether this instance [can access device] the specified user identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="user">The user to test.</param>
|
||||||
|
/// <param name="deviceId">The device id to test.</param>
|
||||||
|
/// <returns>Whether the user can access the device.</returns>
|
||||||
bool CanAccessDevice(User user, string deviceId);
|
bool CanAccessDevice(User user, string deviceId);
|
||||||
|
|
||||||
void UpdateDeviceOptions(string deviceId, DeviceOptions options);
|
void UpdateDeviceOptions(string deviceId, DeviceOptions options);
|
||||||
|
|
|
@ -36,11 +36,17 @@ namespace MediaBrowser.Controller.Dto
|
||||||
/// <param name="options">The options.</param>
|
/// <param name="options">The options.</param>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <param name="owner">The owner.</param>
|
/// <param name="owner">The owner.</param>
|
||||||
|
/// <returns>The <see cref="IReadOnlyList{T}"/> of <see cref="BaseItemDto"/>.</returns>
|
||||||
IReadOnlyList<BaseItemDto> GetBaseItemDtos(IReadOnlyList<BaseItem> items, DtoOptions options, User user = null, BaseItem owner = null);
|
IReadOnlyList<BaseItemDto> GetBaseItemDtos(IReadOnlyList<BaseItem> items, DtoOptions options, User user = null, BaseItem owner = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the item by name dto.
|
/// Gets the item by name dto.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="item">The item.</param>
|
||||||
|
/// <param name="options">The dto options.</param>
|
||||||
|
/// <param name="taggedItems">The list of tagged items.</param>
|
||||||
|
/// <param name="user">The user.</param>
|
||||||
|
/// <returns>The <see cref="BaseItemDto"/>.</returns>
|
||||||
BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, User user = null);
|
BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, User user = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AggregateFolder : Folder
|
public class AggregateFolder : Folder
|
||||||
{
|
{
|
||||||
|
private bool _requiresRefresh;
|
||||||
|
|
||||||
public AggregateFolder()
|
public AggregateFolder()
|
||||||
{
|
{
|
||||||
PhysicalLocationsList = Array.Empty<string>();
|
PhysicalLocationsList = Array.Empty<string>();
|
||||||
|
@ -85,8 +87,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _requiresRefresh;
|
|
||||||
|
|
||||||
public override bool RequiresRefresh()
|
public override bool RequiresRefresh()
|
||||||
{
|
{
|
||||||
var changed = base.RequiresRefresh() || _requiresRefresh;
|
var changed = base.RequiresRefresh() || _requiresRefresh;
|
||||||
|
@ -106,11 +106,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
ClearCache();
|
ClearCache();
|
||||||
|
|
||||||
var changed = base.BeforeMetadataRefresh(replaceAllMetdata) || _requiresRefresh;
|
var changed = base.BeforeMetadataRefresh(replaceAllMetadata) || _requiresRefresh;
|
||||||
_requiresRefresh = false;
|
_requiresRefresh = false;
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,9 +208,9 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
if (IsAccessedByName)
|
if (IsAccessedByName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
public override bool IsDisplayedAsFolder => true;
|
public override bool IsDisplayedAsFolder => true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the folder containing the item.
|
/// Gets the folder containing the item.
|
||||||
/// If the item is a folder, it returns the folder itself.
|
/// If the item is a folder, it returns the folder itself.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The containing folder path.</value>
|
/// <value>The containing folder path.</value>
|
||||||
|
@ -106,9 +106,9 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
var newPath = GetRebasedPath();
|
var newPath = GetRebasedPath();
|
||||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||||
|
|
|
@ -92,7 +92,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public const string ShortsFolderName = "shorts";
|
public const string ShortsFolderName = "shorts";
|
||||||
public const string FeaturettesFolderName = "featurettes";
|
public const string FeaturettesFolderName = "featurettes";
|
||||||
|
|
||||||
public static readonly string[] AllExtrasTypesFolderNames = {
|
public static readonly string[] AllExtrasTypesFolderNames =
|
||||||
|
{
|
||||||
ExtrasFolderName,
|
ExtrasFolderName,
|
||||||
BehindTheScenesFolderName,
|
BehindTheScenesFolderName,
|
||||||
DeletedScenesFolderName,
|
DeletedScenesFolderName,
|
||||||
|
@ -177,7 +178,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public virtual bool AlwaysScanInternalMetadataPath => false;
|
public virtual bool AlwaysScanInternalMetadataPath => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether this instance is in mixed folder.
|
/// Gets or sets a value indicating whether this instance is in mixed folder.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>
|
/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -244,7 +245,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public ProgramAudio? Audio { get; set; }
|
public ProgramAudio? Audio { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return the id that should be used to key display prefs for this item.
|
/// Gets the id that should be used to key display prefs for this item.
|
||||||
/// Default is based on the type for everything except actual generic folders.
|
/// Default is based on the type for everything except actual generic folders.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The display prefs id.</value>
|
/// <value>The display prefs id.</value>
|
||||||
|
@ -280,7 +281,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the folder containing the item.
|
/// Gets the folder containing the item.
|
||||||
/// If the item is a folder, it returns the folder itself.
|
/// If the item is a folder, it returns the folder itself.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -305,8 +306,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public string ServiceName { get; set; }
|
public string ServiceName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If this content came from an external service, the id of the content on that service.
|
/// Gets or sets the external id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// If this content came from an external service, the id of the content on that service.
|
||||||
|
/// </remarks>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string ExternalId { get; set; }
|
public string ExternalId { get; set; }
|
||||||
|
|
||||||
|
@ -330,7 +334,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the type of the location.
|
/// Gets the type of the location.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The type of the location.</value>
|
/// <value>The type of the location.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -449,8 +453,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is just a helper for convenience.
|
/// Gets the primary image path.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This is just a helper for convenience.
|
||||||
|
/// </remarks>
|
||||||
/// <value>The primary image path.</value>
|
/// <value>The primary image path.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string PrimaryImagePath => this.GetImagePath(ImageType.Primary);
|
public string PrimaryImagePath => this.GetImagePath(ImageType.Primary);
|
||||||
|
@ -541,7 +548,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public DateTime DateLastRefreshed { get; set; }
|
public DateTime DateLastRefreshed { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The logger.
|
/// Gets or sets the logger.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ILogger<BaseItem> Logger { get; set; }
|
public static ILogger<BaseItem> Logger { get; set; }
|
||||||
|
|
||||||
|
@ -621,7 +628,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
private Guid[] _themeVideoIds;
|
private Guid[] _themeVideoIds;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name of the sort.
|
/// Gets or sets the name of the sort.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The name of the sort.</value>
|
/// <value>The name of the sort.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -848,7 +855,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When the item first debuted. For movies this could be premiere date, episodes would be first aired
|
/// Gets or sets the date that the item first debuted. For movies this could be premiere date, episodes would be first aired.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The premiere date.</value>
|
/// <value>The premiere date.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -945,7 +952,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public int? ProductionYear { get; set; }
|
public int? ProductionYear { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the item is part of a series, this is it's number in the series.
|
/// Gets or sets the index number. If the item is part of a series, this is it's number in the series.
|
||||||
/// This could be episode number, album track number, etc.
|
/// This could be episode number, album track number, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The index number.</value>
|
/// <value>The index number.</value>
|
||||||
|
@ -953,7 +960,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public int? IndexNumber { get; set; }
|
public int? IndexNumber { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For an episode this could be the season number, or for a song this could be the disc number.
|
/// Gets or sets the parent index number. For an episode this could be the season number, or for a song this could be the disc number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The parent index number.</value>
|
/// <value>The parent index number.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -2645,7 +2652,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true if changes were made.
|
/// This is called before any metadata refresh and returns true if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
/// <param name="replaceAllMetadata">Whether to replace all metadata.</param>
|
||||||
|
/// <returns>true if the item has change, else false.</returns>
|
||||||
|
public virtual bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
_sortName = null;
|
_sortName = null;
|
||||||
|
|
||||||
|
|
|
@ -29,30 +29,45 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public class CollectionFolder : Folder, ICollectionFolder
|
public class CollectionFolder : Folder, ICollectionFolder
|
||||||
{
|
{
|
||||||
private static readonly JsonSerializerOptions _jsonOptions = JsonDefaults.Options;
|
private static readonly JsonSerializerOptions _jsonOptions = JsonDefaults.Options;
|
||||||
public static IXmlSerializer XmlSerializer { get; set; }
|
private static readonly Dictionary<string, LibraryOptions> _libraryOptions = new Dictionary<string, LibraryOptions>();
|
||||||
|
private bool _requiresRefresh;
|
||||||
public static IServerApplicationHost ApplicationHost { get; set; }
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="CollectionFolder"/> class.
|
||||||
|
/// </summary>
|
||||||
public CollectionFolder()
|
public CollectionFolder()
|
||||||
{
|
{
|
||||||
PhysicalLocationsList = Array.Empty<string>();
|
PhysicalLocationsList = Array.Empty<string>();
|
||||||
PhysicalFolderIds = Array.Empty<Guid>();
|
PhysicalFolderIds = Array.Empty<Guid>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IXmlSerializer XmlSerializer { get; set; }
|
||||||
|
|
||||||
|
public static IServerApplicationHost ApplicationHost { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsPlayedStatus => false;
|
public override bool SupportsPlayedStatus => false;
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsInheritedParentImages => false;
|
public override bool SupportsInheritedParentImages => false;
|
||||||
|
|
||||||
|
public string CollectionType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the item's children.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Our children are actually just references to the ones in the physical root...
|
||||||
|
/// </remarks>
|
||||||
|
/// <value>The actual children.</value>
|
||||||
|
[JsonIgnore]
|
||||||
|
public override IEnumerable<BaseItem> Children => GetActualChildren();
|
||||||
|
|
||||||
public override bool CanDelete()
|
public override bool CanDelete()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string CollectionType { get; set; }
|
|
||||||
|
|
||||||
private static readonly Dictionary<string, LibraryOptions> LibraryOptions = new Dictionary<string, LibraryOptions>();
|
|
||||||
public LibraryOptions GetLibraryOptions()
|
public LibraryOptions GetLibraryOptions()
|
||||||
{
|
{
|
||||||
return GetLibraryOptions(Path);
|
return GetLibraryOptions(Path);
|
||||||
|
@ -106,12 +121,12 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public static LibraryOptions GetLibraryOptions(string path)
|
public static LibraryOptions GetLibraryOptions(string path)
|
||||||
{
|
{
|
||||||
lock (LibraryOptions)
|
lock (_libraryOptions)
|
||||||
{
|
{
|
||||||
if (!LibraryOptions.TryGetValue(path, out var options))
|
if (!_libraryOptions.TryGetValue(path, out var options))
|
||||||
{
|
{
|
||||||
options = LoadLibraryOptions(path);
|
options = LoadLibraryOptions(path);
|
||||||
LibraryOptions[path] = options;
|
_libraryOptions[path] = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
|
@ -120,9 +135,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public static void SaveLibraryOptions(string path, LibraryOptions options)
|
public static void SaveLibraryOptions(string path, LibraryOptions options)
|
||||||
{
|
{
|
||||||
lock (LibraryOptions)
|
lock (_libraryOptions)
|
||||||
{
|
{
|
||||||
LibraryOptions[path] = options;
|
_libraryOptions[path] = options;
|
||||||
|
|
||||||
var clone = JsonSerializer.Deserialize<LibraryOptions>(JsonSerializer.SerializeToUtf8Bytes(options, _jsonOptions), _jsonOptions);
|
var clone = JsonSerializer.Deserialize<LibraryOptions>(JsonSerializer.SerializeToUtf8Bytes(options, _jsonOptions), _jsonOptions);
|
||||||
foreach (var mediaPath in clone.PathInfos)
|
foreach (var mediaPath in clone.PathInfos)
|
||||||
|
@ -139,15 +154,18 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public static void OnCollectionFolderChange()
|
public static void OnCollectionFolderChange()
|
||||||
{
|
{
|
||||||
lock (LibraryOptions)
|
lock (_libraryOptions)
|
||||||
{
|
{
|
||||||
LibraryOptions.Clear();
|
_libraryOptions.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allow different display preferences for each collection folder.
|
/// Gets the display preferences id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Allow different display preferences for each collection folder.
|
||||||
|
/// </remarks>
|
||||||
/// <value>The display prefs id.</value>
|
/// <value>The display prefs id.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override Guid DisplayPreferencesId => Id;
|
public override Guid DisplayPreferencesId => Id;
|
||||||
|
@ -155,21 +173,20 @@ namespace MediaBrowser.Controller.Entities
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override string[] PhysicalLocations => PhysicalLocationsList;
|
public override string[] PhysicalLocations => PhysicalLocationsList;
|
||||||
|
|
||||||
|
public string[] PhysicalLocationsList { get; set; }
|
||||||
|
|
||||||
|
public Guid[] PhysicalFolderIds { get; set; }
|
||||||
|
|
||||||
public override bool IsSaveLocalMetadataEnabled()
|
public override bool IsSaveLocalMetadataEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string[] PhysicalLocationsList { get; set; }
|
|
||||||
|
|
||||||
public Guid[] PhysicalFolderIds { get; set; }
|
|
||||||
|
|
||||||
protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService)
|
protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService)
|
||||||
{
|
{
|
||||||
return CreateResolveArgs(directoryService, true).FileSystemChildren;
|
return CreateResolveArgs(directoryService, true).FileSystemChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _requiresRefresh;
|
|
||||||
public override bool RequiresRefresh()
|
public override bool RequiresRefresh()
|
||||||
{
|
{
|
||||||
var changed = base.RequiresRefresh() || _requiresRefresh;
|
var changed = base.RequiresRefresh() || _requiresRefresh;
|
||||||
|
@ -201,9 +218,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var changed = base.BeforeMetadataRefresh(replaceAllMetdata) || _requiresRefresh;
|
var changed = base.BeforeMetadataRefresh(replaceAllMetadata) || _requiresRefresh;
|
||||||
_requiresRefresh = false;
|
_requiresRefresh = false;
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
@ -312,13 +329,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Our children are actually just references to the ones in the physical root...
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The actual children.</value>
|
|
||||||
[JsonIgnore]
|
|
||||||
public override IEnumerable<BaseItem> Children => GetActualChildren();
|
|
||||||
|
|
||||||
public IEnumerable<BaseItem> GetActualChildren()
|
public IEnumerable<BaseItem> GetActualChildren()
|
||||||
{
|
{
|
||||||
return GetPhysicalFolders(true).SelectMany(c => c.Children);
|
return GetPhysicalFolders(true).SelectMany(c => c.Children);
|
||||||
|
|
|
@ -37,6 +37,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Folder : BaseItem
|
public class Folder : BaseItem
|
||||||
{
|
{
|
||||||
|
public Folder()
|
||||||
|
{
|
||||||
|
LinkedChildren = Array.Empty<LinkedChild>();
|
||||||
|
}
|
||||||
|
|
||||||
public static IUserViewManager UserViewManager { get; set; }
|
public static IUserViewManager UserViewManager { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -50,11 +55,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public DateTime? DateLastMediaAdded { get; set; }
|
public DateTime? DateLastMediaAdded { get; set; }
|
||||||
|
|
||||||
public Folder()
|
|
||||||
{
|
|
||||||
LinkedChildren = Array.Empty<LinkedChild>();
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsThemeMedia => true;
|
public override bool SupportsThemeMedia => true;
|
||||||
|
|
||||||
|
@ -86,6 +86,85 @@ namespace MediaBrowser.Controller.Entities
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual bool SupportsDateLastMediaAdded => false;
|
public virtual bool SupportsDateLastMediaAdded => false;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override string FileNameWithoutExtension
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (IsFileProtocol)
|
||||||
|
{
|
||||||
|
return System.IO.Path.GetFileName(Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the actual children.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The actual children.</value>
|
||||||
|
[JsonIgnore]
|
||||||
|
public virtual IEnumerable<BaseItem> Children => LoadChildren();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets thread-safe access to all recursive children of this folder - without regard to user.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The recursive children.</value>
|
||||||
|
[JsonIgnore]
|
||||||
|
public IEnumerable<BaseItem> RecursiveChildren => GetRecursiveChildren();
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
protected virtual bool SupportsShortcutChildren => false;
|
||||||
|
|
||||||
|
protected virtual bool FilterLinkedChildrenPerUser => false;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
protected override bool SupportsOwnedItems => base.SupportsOwnedItems || SupportsShortcutChildren;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public virtual bool SupportsUserDataFromChildren
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// These are just far too slow.
|
||||||
|
if (this is ICollectionFolder)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this is UserView)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this is UserRootFolder)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this is Channel)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SourceType != SourceType.Library)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this is IItemByName)
|
||||||
|
{
|
||||||
|
if (this is not IHasDualAccess hasDualAccess || hasDualAccess.IsAccessedByName)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CanDelete()
|
public override bool CanDelete()
|
||||||
{
|
{
|
||||||
if (IsRoot)
|
if (IsRoot)
|
||||||
|
@ -108,20 +187,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return baseResult;
|
return baseResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override string FileNameWithoutExtension
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (IsFileProtocol)
|
|
||||||
{
|
|
||||||
return System.IO.Path.GetFileName(Path);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool IsAllowTagFilterEnforced()
|
protected override bool IsAllowTagFilterEnforced()
|
||||||
{
|
{
|
||||||
if (this is ICollectionFolder)
|
if (this is ICollectionFolder)
|
||||||
|
@ -137,9 +202,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
protected virtual bool SupportsShortcutChildren => false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the child.
|
/// Adds the child.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -169,20 +231,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
LibraryManager.CreateItem(item, this);
|
LibraryManager.CreateItem(item, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the actual children.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The actual children.</value>
|
|
||||||
[JsonIgnore]
|
|
||||||
public virtual IEnumerable<BaseItem> Children => LoadChildren();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// thread-safe access to all recursive children of this folder - without regard to user.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The recursive children.</value>
|
|
||||||
[JsonIgnore]
|
|
||||||
public IEnumerable<BaseItem> RecursiveChildren => GetRecursiveChildren();
|
|
||||||
|
|
||||||
public override bool IsVisible(User user)
|
public override bool IsVisible(User user)
|
||||||
{
|
{
|
||||||
if (this is ICollectionFolder && !(this is BasePluginFolder))
|
if (this is ICollectionFolder && !(this is BasePluginFolder))
|
||||||
|
@ -1428,8 +1476,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool FilterLinkedChildrenPerUser => false;
|
|
||||||
|
|
||||||
public bool ContainsLinkedChildByItemId(Guid itemId)
|
public bool ContainsLinkedChildByItemId(Guid itemId)
|
||||||
{
|
{
|
||||||
var linkedChildren = LinkedChildren;
|
var linkedChildren = LinkedChildren;
|
||||||
|
@ -1530,9 +1576,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
.Where(i => i.Item2 != null);
|
.Where(i => i.Item2 != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
protected override bool SupportsOwnedItems => base.SupportsOwnedItems || SupportsShortcutChildren;
|
|
||||||
|
|
||||||
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var changesFound = false;
|
var changesFound = false;
|
||||||
|
@ -1696,51 +1739,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return !IsPlayed(user);
|
return !IsPlayed(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public virtual bool SupportsUserDataFromChildren
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
// These are just far too slow.
|
|
||||||
if (this is ICollectionFolder)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this is UserView)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this is UserRootFolder)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this is Channel)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SourceType != SourceType.Library)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var iItemByName = this as IItemByName;
|
|
||||||
if (iItemByName != null)
|
|
||||||
{
|
|
||||||
var hasDualAccess = this as IHasDualAccess;
|
|
||||||
if (hasDualAccess == null || hasDualAccess.IsAccessedByName)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void FillUserDataDtoValues(UserItemDataDto dto, UserItemData userData, BaseItemDto itemDto, User user, DtoOptions fields)
|
public override void FillUserDataDtoValues(UserItemDataDto dto, UserItemData userData, BaseItemDto itemDto, User user, DtoOptions fields)
|
||||||
{
|
{
|
||||||
if (!SupportsUserDataFromChildren)
|
if (!SupportsUserDataFromChildren)
|
||||||
|
|
|
@ -16,6 +16,23 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Genre : BaseItem, IItemByName
|
public class Genre : BaseItem, IItemByName
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the folder containing the item.
|
||||||
|
/// If the item is a folder, it returns the folder itself.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The containing folder path.</value>
|
||||||
|
[JsonIgnore]
|
||||||
|
public override string ContainingFolderPath => Path;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool IsDisplayedAsFolder => true;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsAncestors => false;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsPeople => false;
|
||||||
|
|
||||||
public override List<string> GetUserDataKeys()
|
public override List<string> GetUserDataKeys()
|
||||||
{
|
{
|
||||||
var list = base.GetUserDataKeys();
|
var list = base.GetUserDataKeys();
|
||||||
|
@ -34,20 +51,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the folder containing the item.
|
|
||||||
/// If the item is a folder, it returns the folder itself.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The containing folder path.</value>
|
|
||||||
[JsonIgnore]
|
|
||||||
public override string ContainingFolderPath => Path;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool IsDisplayedAsFolder => true;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsAncestors => false;
|
|
||||||
|
|
||||||
public override bool IsSaveLocalMetadataEnabled()
|
public override bool IsSaveLocalMetadataEnabled()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -72,9 +75,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return LibraryManager.GetItemList(query);
|
return LibraryManager.GetItemList(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsPeople => false;
|
|
||||||
|
|
||||||
public static string GetPath(string name)
|
public static string GetPath(string name)
|
||||||
{
|
{
|
||||||
return GetPath(name, true);
|
return GetPath(name, true);
|
||||||
|
@ -107,12 +107,10 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return base.RequiresRefresh();
|
return base.RequiresRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheridoc />
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
/// </summary>
|
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
var newPath = GetRebasedPath();
|
var newPath = GetRebasedPath();
|
||||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public interface IHasSeries
|
public interface IHasSeries
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name of the series.
|
/// Gets or sets the name of the series.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The name of the series.</value>
|
/// <value>The name of the series.</value>
|
||||||
string SeriesName { get; set; }
|
string SeriesName { get; set; }
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
|
namespace MediaBrowser.Controller.Entities
|
||||||
|
{
|
||||||
|
public interface IHasShares
|
||||||
|
{
|
||||||
|
Share[] Shares { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -144,9 +144,9 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
if (!ProductionYear.HasValue)
|
if (!ProductionYear.HasValue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,9 +36,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
if (!ProductionYear.HasValue)
|
if (!ProductionYear.HasValue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the folder containing the item.
|
/// Gets the folder containing the item.
|
||||||
/// If the item is a folder, it returns the folder itself.
|
/// If the item is a folder, it returns the folder itself.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The containing folder path.</value>
|
/// <value>The containing folder path.</value>
|
||||||
|
@ -67,6 +67,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether to enable alpha numeric sorting.
|
||||||
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool EnableAlphaNumericSorting => false;
|
public override bool EnableAlphaNumericSorting => false;
|
||||||
|
|
||||||
|
@ -126,9 +129,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
var newPath = GetRebasedPath();
|
var newPath = GetRebasedPath();
|
||||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||||
|
|
|
@ -4,11 +4,6 @@
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public interface IHasShares
|
|
||||||
{
|
|
||||||
Share[] Shares { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Share
|
public class Share
|
||||||
{
|
{
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the folder containing the item.
|
/// Gets the folder containing the item.
|
||||||
/// If the item is a folder, it returns the folder itself.
|
/// If the item is a folder, it returns the folder itself.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The containing folder path.</value>
|
/// <value>The containing folder path.</value>
|
||||||
|
@ -105,9 +105,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
var newPath = GetRebasedPath();
|
var newPath = GetRebasedPath();
|
||||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
public IReadOnlyList<Guid> RemoteTrailerIds { get; set; }
|
public IReadOnlyList<Guid> RemoteTrailerIds { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the season in which it aired.
|
/// Gets or sets the season in which it aired.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The aired season.</value>
|
/// <value>The aired season.</value>
|
||||||
public int? AirsBeforeSeasonNumber { get; set; }
|
public int? AirsBeforeSeasonNumber { get; set; }
|
||||||
|
@ -44,7 +44,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
public int? AirsBeforeEpisodeNumber { get; set; }
|
public int? AirsBeforeEpisodeNumber { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is the ending episode number for double episodes.
|
/// Gets or sets the ending episode number for double episodes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The index number.</value>
|
/// <value>The index number.</value>
|
||||||
public int? IndexNumberEnd { get; set; }
|
public int? IndexNumberEnd { get; set; }
|
||||||
|
@ -116,7 +116,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This Episode's Series Instance.
|
/// Gets the Episode's Series Instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The series.</value>
|
/// <value>The series.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -261,6 +261,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Guid SeasonId { get; set; }
|
public Guid SeasonId { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Guid SeriesId { get; set; }
|
public Guid SeriesId { get; set; }
|
||||||
|
|
||||||
|
@ -318,9 +319,9 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
if (!IsLocked)
|
if (!IsLocked)
|
||||||
{
|
{
|
||||||
|
@ -328,7 +329,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (LibraryManager.FillMissingEpisodeNumbersFromPath(this, replaceAllMetdata))
|
if (LibraryManager.FillMissingEpisodeNumbersFromPath(this, replaceAllMetadata))
|
||||||
{
|
{
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This Episode's Series Instance.
|
/// Gets this Episode's Series Instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The series.</value>
|
/// <value>The series.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -242,9 +242,9 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path))
|
if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path))
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,8 +59,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
public IReadOnlyList<Guid> RemoteTrailerIds { get; set; }
|
public IReadOnlyList<Guid> RemoteTrailerIds { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// airdate, dvd or absolute.
|
/// Gets or sets the display order.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Valid options are airdate, dvd or absolute.
|
||||||
|
/// </remarks>
|
||||||
public string DisplayOrder { get; set; }
|
public string DisplayOrder { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -45,9 +45,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
if (!ProductionYear.HasValue)
|
if (!ProductionYear.HasValue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public const double MinLikeValue = 6.5;
|
public const double MinLikeValue = 6.5;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is an interpreted property to indicate likes or dislikes
|
/// Gets or sets a value indicating whether the item is liked or not.
|
||||||
/// This should never be serialized.
|
/// This should never be serialized.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>null</c> if [likes] contains no value, <c>true</c> if [likes]; otherwise, <c>false</c>.</value>
|
/// <value><c>null</c> if [likes] contains no value, <c>true</c> if [likes]; otherwise, <c>false</c>.</value>
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
private List<Guid> _childrenIds = null;
|
private List<Guid> _childrenIds = null;
|
||||||
private readonly object _childIdsLock = new object();
|
private readonly object _childIdsLock = new object();
|
||||||
|
|
||||||
protected override List<BaseItem> LoadChildren()
|
protected override List<BaseItem> LoadChildren()
|
||||||
{
|
{
|
||||||
lock (_childIdsLock)
|
lock (_childIdsLock)
|
||||||
|
@ -87,10 +88,10 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
ClearCache();
|
ClearCache();
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
if (string.Equals("default", Name, StringComparison.OrdinalIgnoreCase))
|
if (string.Equals("default", Name, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,13 +15,19 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public class UserView : Folder, IHasCollectionType
|
public class UserView : Folder, IHasCollectionType
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <summary>
|
||||||
|
/// Gets or sets the view type.
|
||||||
|
/// </summary>
|
||||||
public string ViewType { get; set; }
|
public string ViewType { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <summary>
|
||||||
|
/// Gets or sets the display parent id.
|
||||||
|
/// </summary>
|
||||||
public new Guid DisplayParentId { get; set; }
|
public new Guid DisplayParentId { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <summary>
|
||||||
|
/// Gets or sets the user id.
|
||||||
|
/// </summary>
|
||||||
public Guid? UserId { get; set; }
|
public Guid? UserId { get; set; }
|
||||||
|
|
||||||
public static ITVSeriesManager TVSeriesManager;
|
public static ITVSeriesManager TVSeriesManager;
|
||||||
|
@ -110,7 +116,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return GetChildren(user, false);
|
return GetChildren(user, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string[] UserSpecificViewTypes = new string[]
|
private static readonly string[] UserSpecificViewTypes = new string[]
|
||||||
{
|
{
|
||||||
Model.Entities.CollectionType.Playlists
|
Model.Entities.CollectionType.Playlists
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the folder containing the item.
|
/// Gets the folder containing the item.
|
||||||
/// If the item is a folder, it returns the folder itself.
|
/// If the item is a folder, it returns the folder itself.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The containing folder path.</value>
|
/// <value>The containing folder path.</value>
|
||||||
|
@ -112,11 +112,13 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
/// <param name="replaceAllMetadata">Whether to replace all metadata.</param>
|
||||||
|
/// <returns>true if the item has change, else false.</returns>
|
||||||
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
||||||
var newPath = GetRebasedPath();
|
var newPath = GetRebasedPath();
|
||||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Extensions
|
||||||
{
|
{
|
||||||
// will throw if input contains invalid unicode chars
|
// will throw if input contains invalid unicode chars
|
||||||
// https://mnaoumov.wordpress.com/2014/06/14/stripping-invalid-characters-from-utf-16-strings/
|
// https://mnaoumov.wordpress.com/2014/06/14/stripping-invalid-characters-from-utf-16-strings/
|
||||||
text = Regex.Replace(text, "([\ud800-\udbff](?![\udc00-\udfff]))|((?<![\ud800-\udbff])[\udc00-\udfff])", "");
|
text = Regex.Replace(text, "([\ud800-\udbff](?![\udc00-\udfff]))|((?<![\ud800-\udbff])[\udc00-\udfff])", string.Empty);
|
||||||
return Normalize(text, form, false);
|
return Normalize(text, form, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,12 @@ namespace MediaBrowser.Controller.Library
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolves a set of files into a list of BaseItem.
|
/// Resolves a set of files into a list of BaseItem.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="files">The list of tiles.</param>
|
||||||
|
/// <param name="directoryService">Instance of the <see cref="IDirectoryService"/> interface.</param>
|
||||||
|
/// <param name="parent">The parent folder.</param>
|
||||||
|
/// <param name="libraryOptions">The library options.</param>
|
||||||
|
/// <param name="collectionType">The collection type.</param>
|
||||||
|
/// <returns>The list of <see cref="BaseItem"/>.</returns>
|
||||||
IEnumerable<BaseItem> ResolvePaths(
|
IEnumerable<BaseItem> ResolvePaths(
|
||||||
IEnumerable<FileSystemMetadata> files,
|
IEnumerable<FileSystemMetadata> files,
|
||||||
IDirectoryService directoryService,
|
IDirectoryService directoryService,
|
||||||
|
|
|
@ -148,7 +148,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
public bool IsNews { get; set; }
|
public bool IsNews { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance is kids.
|
/// Gets a value indicating whether this instance is kids.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
|
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
public override SourceType SourceType => SourceType.LiveTV;
|
public override SourceType SourceType => SourceType.LiveTV;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The start date of the program, in UTC.
|
/// Gets or sets start date of the program, in UTC.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public DateTime StartDate { get; set; }
|
public DateTime StartDate { get; set; }
|
||||||
|
|
|
@ -28,18 +28,17 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
public string[] Tags { get; set; }
|
public string[] Tags { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Id of the recording.
|
/// Gets or sets the id of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the series timer identifier.
|
/// Gets or sets the series timer identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The series timer identifier.</value>
|
|
||||||
public string SeriesTimerId { get; set; }
|
public string SeriesTimerId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ChannelId of the recording.
|
/// Gets or sets the channelId of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ChannelId { get; set; }
|
public string ChannelId { get; set; }
|
||||||
|
|
||||||
|
@ -52,24 +51,24 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
public string ShowId { get; set; }
|
public string ShowId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name of the recording.
|
/// Gets or sets the name of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description of the recording.
|
/// Gets or sets the description of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Overview { get; set; }
|
public string Overview { get; set; }
|
||||||
|
|
||||||
public string SeriesId { get; set; }
|
public string SeriesId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The start date of the recording, in UTC.
|
/// Gets or sets the start date of the recording, in UTC.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime StartDate { get; set; }
|
public DateTime StartDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The end date of the recording, in UTC.
|
/// Gets or sets the end date of the recording, in UTC.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime EndDate { get; set; }
|
public DateTime EndDate { get; set; }
|
||||||
|
|
||||||
|
@ -133,7 +132,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
public bool IsSeries { get; set; }
|
public bool IsSeries { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance is live.
|
/// Gets a value indicating whether this instance is live.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
|
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -2933,6 +2933,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
return threads;
|
return threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
public void TryStreamCopy(EncodingJobInfo state)
|
public void TryStreamCopy(EncodingJobInfo state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -430,7 +430,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Predicts the audio sample rate that will be in the output stream.
|
/// Gets the target video level.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double? TargetVideoLevel
|
public double? TargetVideoLevel
|
||||||
{
|
{
|
||||||
|
@ -453,7 +453,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Predicts the audio sample rate that will be in the output stream.
|
/// Gets the target video bit depth.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? TargetVideoBitDepth
|
public int? TargetVideoBitDepth
|
||||||
{
|
{
|
||||||
|
@ -488,7 +488,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Predicts the audio sample rate that will be in the output stream.
|
/// Gets the target framerate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float? TargetFramerate
|
public float? TargetFramerate
|
||||||
{
|
{
|
||||||
|
@ -520,7 +520,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Predicts the audio sample rate that will be in the output stream.
|
/// Gets the target packet length.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? TargetPacketLength
|
public int? TargetPacketLength
|
||||||
{
|
{
|
||||||
|
@ -536,7 +536,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Predicts the audio sample rate that will be in the output stream.
|
/// Gets the target video profile.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TargetVideoProfile
|
public string TargetVideoProfile
|
||||||
{
|
{
|
||||||
|
@ -700,25 +700,4 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
Progress.Report(percentComplete.Value);
|
Progress.Report(percentComplete.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enum TranscodingJobType.
|
|
||||||
/// </summary>
|
|
||||||
public enum TranscodingJobType
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The progressive.
|
|
||||||
/// </summary>
|
|
||||||
Progressive,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The HLS.
|
|
||||||
/// </summary>
|
|
||||||
Hls,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The dash.
|
|
||||||
/// </summary>
|
|
||||||
Dash
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
public interface IMediaEncoder : ITranscoderSupport
|
public interface IMediaEncoder : ITranscoderSupport
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The location of the discovered FFmpeg tool.
|
/// Gets location of the discovered FFmpeg tool.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FFmpegLocation EncoderLocation { get; }
|
FFmpegLocation EncoderLocation { get; }
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum TranscodingJobType.
|
||||||
|
/// </summary>
|
||||||
|
public enum TranscodingJobType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The progressive.
|
||||||
|
/// </summary>
|
||||||
|
Progressive,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The HLS.
|
||||||
|
/// </summary>
|
||||||
|
Hls,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The dash.
|
||||||
|
/// </summary>
|
||||||
|
Dash
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,7 +22,8 @@ namespace MediaBrowser.Controller.Playlists
|
||||||
{
|
{
|
||||||
public class Playlist : Folder, IHasShares
|
public class Playlist : Folder, IHasShares
|
||||||
{
|
{
|
||||||
public static string[] SupportedExtensions =
|
public static readonly IReadOnlyList<string> SupportedExtensions =
|
||||||
|
new[]
|
||||||
{
|
{
|
||||||
".m3u",
|
".m3u",
|
||||||
".m3u8",
|
".m3u8",
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace MediaBrowser.Controller.Plugins
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that a <see cref="IServerEntryPoint"/> should be invoked as a pre-startup task.
|
||||||
|
/// </summary>
|
||||||
|
public interface IRunBeforeStartup
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,13 +14,7 @@ namespace MediaBrowser.Controller.Plugins
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Run the initialization for this module. This method is invoked at application start.
|
/// Run the initialization for this module. This method is invoked at application start.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||||
Task RunAsync();
|
Task RunAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Indicates that a <see cref="IServerEntryPoint"/> should be invoked as a pre-startup task.
|
|
||||||
/// </summary>
|
|
||||||
public interface IRunBeforeStartup
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.Providers
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether all existing data should be overwritten with new data from providers
|
/// Gets or sets a value indicating whether all existing data should be overwritten with new data from providers
|
||||||
/// when paired with MetadataRefreshMode=FullRefresh
|
/// when paired with MetadataRefreshMode=FullRefresh.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ReplaceAllMetadata { get; set; }
|
public bool ReplaceAllMetadata { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
|
||||||
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MediaBrowser.Model.Sync;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Sync
|
|
||||||
{
|
|
||||||
public interface IHasDynamicAccess
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the synced file information.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id">The identifier.</param>
|
|
||||||
/// <param name="target">The target.</param>
|
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
|
||||||
/// <returns>Task<SyncedFileInfo>.</returns>
|
|
||||||
Task<SyncedFileInfo> GetSyncedFileInfo(string id, SyncTarget target, CancellationToken cancellationToken);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
namespace MediaBrowser.Controller.Sync
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// A marker interface.
|
|
||||||
/// </summary>
|
|
||||||
public interface IRemoteSyncProvider
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MediaBrowser.Model.IO;
|
|
||||||
using MediaBrowser.Model.Querying;
|
|
||||||
using MediaBrowser.Model.Sync;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Sync
|
|
||||||
{
|
|
||||||
public interface IServerSyncProvider : ISyncProvider
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Transfers the file.
|
|
||||||
/// </summary>
|
|
||||||
Task<SyncedFileInfo> SendFile(SyncJob syncJob, string originalMediaPath, Stream inputStream, bool isMedia, string[] outputPathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
|
||||||
|
|
||||||
Task<QueryResult<FileSystemMetadata>> GetFiles(string[] directoryPathParts, SyncTarget target, CancellationToken cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface ISupportsDirectCopy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Sends the file.
|
|
||||||
/// </summary>
|
|
||||||
Task<SyncedFileInfo> SendFile(SyncJob syncJob, string originalMediaPath, string inputPath, bool isMedia, string[] outputPathParts, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using MediaBrowser.Model.Sync;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Sync
|
|
||||||
{
|
|
||||||
public interface ISyncProvider
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the name.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The name.</value>
|
|
||||||
string Name { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the synchronize targets.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId">The user identifier.</param>
|
|
||||||
/// <returns>IEnumerable<SyncTarget>.</returns>
|
|
||||||
List<SyncTarget> GetSyncTargets(string userId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets all synchronize targets.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>IEnumerable<SyncTarget>.</returns>
|
|
||||||
List<SyncTarget> GetAllSyncTargets();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using MediaBrowser.Model.MediaInfo;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Sync
|
|
||||||
{
|
|
||||||
public class SyncedFileInfo
|
|
||||||
{
|
|
||||||
public SyncedFileInfo()
|
|
||||||
{
|
|
||||||
RequiredHttpHeaders = new Dictionary<string, string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the path.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The path.</value>
|
|
||||||
public string Path { get; set; }
|
|
||||||
|
|
||||||
public string[] PathParts { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the protocol.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The protocol.</value>
|
|
||||||
public MediaProtocol Protocol { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the required HTTP headers.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The required HTTP headers.</value>
|
|
||||||
public Dictionary<string, string> RequiredHttpHeaders { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the identifier.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The identifier.</value>
|
|
||||||
public string Id { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,16 +6,26 @@ using MediaBrowser.Model.Querying;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.TV
|
namespace MediaBrowser.Controller.TV
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The TV Series manager.
|
||||||
|
/// </summary>
|
||||||
public interface ITVSeriesManager
|
public interface ITVSeriesManager
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the next up.
|
/// Gets the next up.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="query">The next up query.</param>
|
||||||
|
/// <param name="options">The dto options.</param>
|
||||||
|
/// <returns>The query result of <see cref="BaseItem"/>.</returns>
|
||||||
QueryResult<BaseItem> GetNextUp(NextUpQuery query, DtoOptions options);
|
QueryResult<BaseItem> GetNextUp(NextUpQuery query, DtoOptions options);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the next up.
|
/// Gets the next up.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="request">The next up request.</param>
|
||||||
|
/// <param name="parentsFolders">The list of parent folders.</param>
|
||||||
|
/// <param name="options">The dto options.</param>
|
||||||
|
/// <returns>The query result of <see cref="BaseItem"/>.</returns>
|
||||||
QueryResult<BaseItem> GetNextUp(NextUpQuery request, BaseItem[] parentsFolders, DtoOptions options);
|
QueryResult<BaseItem> GetNextUp(NextUpQuery request, BaseItem[] parentsFolders, DtoOptions options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue