mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
Merge pull request #6042 from crobibero/mbc-warn-2
This commit is contained in:
commit
8d2e5ef8c6
@ -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);
|
||||
}
|
||||
|
@ -51,32 +51,47 @@ namespace MediaBrowser.Controller.Channels
|
||||
/// Gets the channels internal.
|
||||
/// </summary>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <returns>The channels.</returns>
|
||||
QueryResult<Channel> GetChannelsInternal(ChannelQuery query);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channels.
|
||||
/// </summary>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <returns>The channels.</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>The latest channels.</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>The latest channels.</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>The channel items.</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>The channel items.</returns>
|
||||
Task<QueryResult<BaseItem>> GetChannelItemsInternal(InternalItemsQuery query, IProgress<double> progress, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
@ -84,9 +99,14 @@ namespace MediaBrowser.Controller.Channels
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
|
||||
/// <returns>The item media sources.</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);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
public interface IDisableMediaSourceDisplay
|
||||
{
|
||||
}
|
||||
}
|
9
MediaBrowser.Controller/Channels/IHasFolderAttributes.cs
Normal file
9
MediaBrowser.Controller/Channels/IHasFolderAttributes.cs
Normal file
@ -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.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);
|
||||
}
|
||||
}
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
15
MediaBrowser.Controller/Channels/ISupportsDelete.cs
Normal file
15
MediaBrowser.Controller/Channels/ISupportsDelete.cs
Normal file
@ -0,0 +1,15 @@
|
||||
#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);
|
||||
}
|
||||
}
|
21
MediaBrowser.Controller/Channels/ISupportsLatestMedia.cs
Normal file
21
MediaBrowser.Controller/Channels/ISupportsLatestMedia.cs
Normal 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>The latest media.</returns>
|
||||
Task<IEnumerable<ChannelItemInfo>> GetLatestMedia(ChannelLatestMediaSearch request, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
8
MediaBrowser.Controller/Channels/ISupportsMediaProbe.cs
Normal file
8
MediaBrowser.Controller/Channels/ISupportsMediaProbe.cs
Normal file
@ -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; }
|
||||
|
||||
/// <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; }
|
||||
|
||||
|
@ -20,7 +20,6 @@ namespace MediaBrowser.Controller.Devices
|
||||
/// </summary>
|
||||
/// <param name="reportedId">The reported identifier.</param>
|
||||
/// <param name="capabilities">The capabilities.</param>
|
||||
/// <returns>Task.</returns>
|
||||
void SaveCapabilities(string reportedId, ClientCapabilities capabilities);
|
||||
|
||||
/// <summary>
|
||||
@ -47,6 +46,9 @@ namespace MediaBrowser.Controller.Devices
|
||||
/// <summary>
|
||||
/// Determines whether this instance [can access device] the specified user identifier.
|
||||
/// </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);
|
||||
|
||||
void UpdateDeviceOptions(string deviceId, DeviceOptions options);
|
||||
|
@ -36,11 +36,17 @@ namespace MediaBrowser.Controller.Dto
|
||||
/// <param name="options">The options.</param>
|
||||
/// <param name="user">The user.</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);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the item by name dto.
|
||||
/// </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 item dto.</returns>
|
||||
BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, User user = null);
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
public class AggregateFolder : Folder
|
||||
{
|
||||
private bool _requiresRefresh;
|
||||
|
||||
public AggregateFolder()
|
||||
{
|
||||
PhysicalLocationsList = Array.Empty<string>();
|
||||
@ -85,8 +87,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
private bool _requiresRefresh;
|
||||
|
||||
public override bool RequiresRefresh()
|
||||
{
|
||||
var changed = base.RequiresRefresh() || _requiresRefresh;
|
||||
@ -106,11 +106,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
return changed;
|
||||
}
|
||||
|
||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
||||
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||
{
|
||||
ClearCache();
|
||||
|
||||
var changed = base.BeforeMetadataRefresh(replaceAllMetdata) || _requiresRefresh;
|
||||
var changed = base.BeforeMetadataRefresh(replaceAllMetadata) || _requiresRefresh;
|
||||
_requiresRefresh = false;
|
||||
return changed;
|
||||
}
|
||||
|
@ -208,9 +208,9 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||
/// </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)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
public override bool IsDisplayedAsFolder => true;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the folder containing the item.
|
||||
/// Gets the folder containing the item.
|
||||
/// If the item is a folder, it returns the folder itself.
|
||||
/// </summary>
|
||||
/// <value>The containing folder path.</value>
|
||||
@ -106,9 +106,9 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||
/// </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();
|
||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||
|
@ -92,7 +92,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
public const string ShortsFolderName = "shorts";
|
||||
public const string FeaturettesFolderName = "featurettes";
|
||||
|
||||
public static readonly string[] AllExtrasTypesFolderNames = {
|
||||
public static readonly string[] AllExtrasTypesFolderNames =
|
||||
{
|
||||
ExtrasFolderName,
|
||||
BehindTheScenesFolderName,
|
||||
DeletedScenesFolderName,
|
||||
@ -177,7 +178,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public virtual bool AlwaysScanInternalMetadataPath => false;
|
||||
|
||||
/// <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>
|
||||
/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>
|
||||
[JsonIgnore]
|
||||
@ -244,7 +245,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public ProgramAudio? Audio { get; set; }
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
/// <value>The display prefs id.</value>
|
||||
@ -280,7 +281,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the folder containing the item.
|
||||
/// Gets the folder containing the item.
|
||||
/// If the item is a folder, it returns the folder itself.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
@ -305,8 +306,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
public string ServiceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If this content came from an external service, the id of the content on that service.
|
||||
/// Gets or sets the external id.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If this content came from an external service, the id of the content on that service.
|
||||
/// </remarks>
|
||||
[JsonIgnore]
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
@ -330,7 +334,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the location.
|
||||
/// Gets the type of the location.
|
||||
/// </summary>
|
||||
/// <value>The type of the location.</value>
|
||||
[JsonIgnore]
|
||||
@ -449,8 +453,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is just a helper for convenience.
|
||||
/// Gets the primary image path.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is just a helper for convenience.
|
||||
/// </remarks>
|
||||
/// <value>The primary image path.</value>
|
||||
[JsonIgnore]
|
||||
public string PrimaryImagePath => this.GetImagePath(ImageType.Primary);
|
||||
@ -541,7 +548,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public DateTime DateLastRefreshed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The logger.
|
||||
/// Gets or sets the logger.
|
||||
/// </summary>
|
||||
public static ILogger<BaseItem> Logger { get; set; }
|
||||
|
||||
@ -621,7 +628,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
private Guid[] _themeVideoIds;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the sort.
|
||||
/// Gets or sets the name of the sort.
|
||||
/// </summary>
|
||||
/// <value>The name of the sort.</value>
|
||||
[JsonIgnore]
|
||||
@ -848,7 +855,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// <value>The premiere date.</value>
|
||||
[JsonIgnore]
|
||||
@ -945,7 +952,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public int? ProductionYear { get; set; }
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
/// <value>The index number.</value>
|
||||
@ -953,7 +960,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public int? IndexNumber { get; set; }
|
||||
|
||||
/// <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>
|
||||
/// <value>The parent index number.</value>
|
||||
[JsonIgnore]
|
||||
@ -1017,9 +1024,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
// if (!user.IsParentalScheduleAllowed())
|
||||
//{
|
||||
// {
|
||||
// return PlayAccess.None;
|
||||
//}
|
||||
// }
|
||||
|
||||
return PlayAccess.Full;
|
||||
}
|
||||
@ -2645,7 +2652,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns true if changes were made.
|
||||
/// </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;
|
||||
|
||||
|
@ -29,30 +29,45 @@ namespace MediaBrowser.Controller.Entities
|
||||
public class CollectionFolder : Folder, ICollectionFolder
|
||||
{
|
||||
private static readonly JsonSerializerOptions _jsonOptions = JsonDefaults.Options;
|
||||
public static IXmlSerializer XmlSerializer { get; set; }
|
||||
|
||||
public static IServerApplicationHost ApplicationHost { get; set; }
|
||||
private static readonly Dictionary<string, LibraryOptions> _libraryOptions = new Dictionary<string, LibraryOptions>();
|
||||
private bool _requiresRefresh;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CollectionFolder"/> class.
|
||||
/// </summary>
|
||||
public CollectionFolder()
|
||||
{
|
||||
PhysicalLocationsList = Array.Empty<string>();
|
||||
PhysicalFolderIds = Array.Empty<Guid>();
|
||||
}
|
||||
|
||||
public static IXmlSerializer XmlSerializer { get; set; }
|
||||
|
||||
public static IServerApplicationHost ApplicationHost { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public override bool SupportsPlayedStatus => false;
|
||||
|
||||
[JsonIgnore]
|
||||
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()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public string CollectionType { get; set; }
|
||||
|
||||
private static readonly Dictionary<string, LibraryOptions> LibraryOptions = new Dictionary<string, LibraryOptions>();
|
||||
public LibraryOptions GetLibraryOptions()
|
||||
{
|
||||
return GetLibraryOptions(Path);
|
||||
@ -106,12 +121,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
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);
|
||||
LibraryOptions[path] = options;
|
||||
_libraryOptions[path] = options;
|
||||
}
|
||||
|
||||
return options;
|
||||
@ -120,9 +135,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
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);
|
||||
foreach (var mediaPath in clone.PathInfos)
|
||||
@ -139,15 +154,18 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public static void OnCollectionFolderChange()
|
||||
{
|
||||
lock (LibraryOptions)
|
||||
lock (_libraryOptions)
|
||||
{
|
||||
LibraryOptions.Clear();
|
||||
_libraryOptions.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allow different display preferences for each collection folder.
|
||||
/// Gets the display preferences id.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Allow different display preferences for each collection folder.
|
||||
/// </remarks>
|
||||
/// <value>The display prefs id.</value>
|
||||
[JsonIgnore]
|
||||
public override Guid DisplayPreferencesId => Id;
|
||||
@ -155,21 +173,20 @@ namespace MediaBrowser.Controller.Entities
|
||||
[JsonIgnore]
|
||||
public override string[] PhysicalLocations => PhysicalLocationsList;
|
||||
|
||||
public string[] PhysicalLocationsList { get; set; }
|
||||
|
||||
public Guid[] PhysicalFolderIds { get; set; }
|
||||
|
||||
public override bool IsSaveLocalMetadataEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public string[] PhysicalLocationsList { get; set; }
|
||||
|
||||
public Guid[] PhysicalFolderIds { get; set; }
|
||||
|
||||
protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return CreateResolveArgs(directoryService, true).FileSystemChildren;
|
||||
}
|
||||
|
||||
private bool _requiresRefresh;
|
||||
public override bool RequiresRefresh()
|
||||
{
|
||||
var changed = base.RequiresRefresh() || _requiresRefresh;
|
||||
@ -201,9 +218,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
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;
|
||||
return changed;
|
||||
}
|
||||
@ -312,13 +329,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
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()
|
||||
{
|
||||
return GetPhysicalFolders(true).SelectMany(c => c.Children);
|
||||
|
@ -37,6 +37,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
public class Folder : BaseItem
|
||||
{
|
||||
public Folder()
|
||||
{
|
||||
LinkedChildren = Array.Empty<LinkedChild>();
|
||||
}
|
||||
|
||||
public static IUserViewManager UserViewManager { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -50,11 +55,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
[JsonIgnore]
|
||||
public DateTime? DateLastMediaAdded { get; set; }
|
||||
|
||||
public Folder()
|
||||
{
|
||||
LinkedChildren = Array.Empty<LinkedChild>();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public override bool SupportsThemeMedia => true;
|
||||
|
||||
@ -86,6 +86,85 @@ namespace MediaBrowser.Controller.Entities
|
||||
[JsonIgnore]
|
||||
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()
|
||||
{
|
||||
if (IsRoot)
|
||||
@ -108,20 +187,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return baseResult;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public override string FileNameWithoutExtension
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsFileProtocol)
|
||||
{
|
||||
return System.IO.Path.GetFileName(Path);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool IsAllowTagFilterEnforced()
|
||||
{
|
||||
if (this is ICollectionFolder)
|
||||
@ -137,9 +202,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
protected virtual bool SupportsShortcutChildren => false;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the child.
|
||||
/// </summary>
|
||||
@ -169,20 +231,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
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)
|
||||
{
|
||||
if (this is ICollectionFolder && !(this is BasePluginFolder))
|
||||
@ -1428,8 +1476,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return list;
|
||||
}
|
||||
|
||||
protected virtual bool FilterLinkedChildrenPerUser => false;
|
||||
|
||||
public bool ContainsLinkedChildByItemId(Guid itemId)
|
||||
{
|
||||
var linkedChildren = LinkedChildren;
|
||||
@ -1530,9 +1576,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
.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)
|
||||
{
|
||||
var changesFound = false;
|
||||
@ -1696,51 +1739,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
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)
|
||||
{
|
||||
if (!SupportsUserDataFromChildren)
|
||||
|
@ -16,6 +16,23 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
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()
|
||||
{
|
||||
var list = base.GetUserDataKeys();
|
||||
@ -34,20 +51,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
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()
|
||||
{
|
||||
return true;
|
||||
@ -72,9 +75,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return LibraryManager.GetItemList(query);
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public override bool SupportsPeople => false;
|
||||
|
||||
public static string GetPath(string name)
|
||||
{
|
||||
return GetPath(name, true);
|
||||
@ -107,12 +107,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
return base.RequiresRefresh();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||
/// </summary>
|
||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
||||
/// <inheridoc />
|
||||
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||
{
|
||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||
|
||||
var newPath = GetRebasedPath();
|
||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||
|
@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public interface IHasSeries
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the series.
|
||||
/// Gets or sets the name of the series.
|
||||
/// </summary>
|
||||
/// <value>The name of the series.</value>
|
||||
string SeriesName { get; set; }
|
||||
|
11
MediaBrowser.Controller/Entities/IHasShares.cs
Normal file
11
MediaBrowser.Controller/Entities/IHasShares.cs
Normal file
@ -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 />
|
||||
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)
|
||||
{
|
||||
|
@ -36,9 +36,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
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)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the folder containing the item.
|
||||
/// Gets the folder containing the item.
|
||||
/// If the item is a folder, it returns the folder itself.
|
||||
/// </summary>
|
||||
/// <value>The containing folder path.</value>
|
||||
@ -67,6 +67,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether to enable alpha numeric sorting.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public override bool EnableAlphaNumericSorting => false;
|
||||
|
||||
@ -126,9 +129,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||
/// </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();
|
||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||
|
@ -4,11 +4,6 @@
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public interface IHasShares
|
||||
{
|
||||
Share[] Shares { get; set; }
|
||||
}
|
||||
|
||||
public class Share
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
|
@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the folder containing the item.
|
||||
/// Gets the folder containing the item.
|
||||
/// If the item is a folder, it returns the folder itself.
|
||||
/// </summary>
|
||||
/// <value>The containing folder path.</value>
|
||||
@ -105,9 +105,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||
/// </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();
|
||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||
|
@ -34,7 +34,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public IReadOnlyList<Guid> RemoteTrailerIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the season in which it aired.
|
||||
/// Gets or sets the season in which it aired.
|
||||
/// </summary>
|
||||
/// <value>The aired season.</value>
|
||||
public int? AirsBeforeSeasonNumber { get; set; }
|
||||
@ -44,7 +44,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public int? AirsBeforeEpisodeNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This is the ending episode number for double episodes.
|
||||
/// Gets or sets the ending episode number for double episodes.
|
||||
/// </summary>
|
||||
/// <value>The index number.</value>
|
||||
public int? IndexNumberEnd { get; set; }
|
||||
@ -116,7 +116,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This Episode's Series Instance.
|
||||
/// Gets the Episode's Series Instance.
|
||||
/// </summary>
|
||||
/// <value>The series.</value>
|
||||
[JsonIgnore]
|
||||
@ -261,6 +261,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
[JsonIgnore]
|
||||
public Guid SeasonId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Guid SeriesId { get; set; }
|
||||
|
||||
@ -318,9 +319,9 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
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)
|
||||
{
|
||||
@ -328,7 +329,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
try
|
||||
{
|
||||
if (LibraryManager.FillMissingEpisodeNumbersFromPath(this, replaceAllMetdata))
|
||||
if (LibraryManager.FillMissingEpisodeNumbersFromPath(this, replaceAllMetadata))
|
||||
{
|
||||
hasChanges = true;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This Episode's Series Instance.
|
||||
/// Gets this Episode's Series Instance.
|
||||
/// </summary>
|
||||
/// <value>The series.</value>
|
||||
[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.
|
||||
/// </summary>
|
||||
/// <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))
|
||||
{
|
||||
|
@ -59,8 +59,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public IReadOnlyList<Guid> RemoteTrailerIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// airdate, dvd or absolute.
|
||||
/// Gets or sets the display order.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Valid options are airdate, dvd or absolute.
|
||||
/// </remarks>
|
||||
public string DisplayOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -45,9 +45,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
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)
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public const double MinLikeValue = 6.5;
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
/// <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 readonly object _childIdsLock = new object();
|
||||
|
||||
protected override List<BaseItem> LoadChildren()
|
||||
{
|
||||
lock (_childIdsLock)
|
||||
@ -87,10 +88,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
return list;
|
||||
}
|
||||
|
||||
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
|
||||
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||
{
|
||||
ClearCache();
|
||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
|
||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||
|
||||
if (string.Equals("default", Name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
@ -15,13 +15,19 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public class UserView : Folder, IHasCollectionType
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets or sets the view type.
|
||||
/// </summary>
|
||||
public string ViewType { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets or sets the display parent id.
|
||||
/// </summary>
|
||||
public new Guid DisplayParentId { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets or sets the user id.
|
||||
/// </summary>
|
||||
public Guid? UserId { get; set; }
|
||||
|
||||
public static ITVSeriesManager TVSeriesManager;
|
||||
@ -110,10 +116,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
return GetChildren(user, false);
|
||||
}
|
||||
|
||||
private static string[] UserSpecificViewTypes = new string[]
|
||||
{
|
||||
Model.Entities.CollectionType.Playlists
|
||||
};
|
||||
private static readonly string[] UserSpecificViewTypes = new string[]
|
||||
{
|
||||
Model.Entities.CollectionType.Playlists
|
||||
};
|
||||
|
||||
public static bool IsUserSpecific(Folder folder)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the folder containing the item.
|
||||
/// Gets the folder containing the item.
|
||||
/// If the item is a folder, it returns the folder itself.
|
||||
/// </summary>
|
||||
/// <value>The containing folder path.</value>
|
||||
@ -112,11 +112,13 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
/// <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>
|
||||
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();
|
||||
if (!string.Equals(Path, newPath, StringComparison.Ordinal))
|
||||
|
@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Extensions
|
||||
{
|
||||
// will throw if input contains invalid unicode chars
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,12 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <summary>
|
||||
/// Resolves a set of files into a list of BaseItem.
|
||||
/// </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 items resolved from the paths.</returns>
|
||||
IEnumerable<BaseItem> ResolvePaths(
|
||||
IEnumerable<FileSystemMetadata> files,
|
||||
IDirectoryService directoryService,
|
||||
|
@ -148,7 +148,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
public bool IsNews { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is kids.
|
||||
/// Gets a value indicating whether this instance is kids.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
|
||||
[JsonIgnore]
|
||||
|
@ -71,7 +71,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
public override SourceType SourceType => SourceType.LiveTV;
|
||||
|
||||
/// <summary>
|
||||
/// The start date of the program, in UTC.
|
||||
/// Gets or sets start date of the program, in UTC.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public DateTime StartDate { get; set; }
|
||||
|
@ -28,18 +28,17 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
public string[] Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Id of the recording.
|
||||
/// Gets or sets the id of the recording.
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the series timer identifier.
|
||||
/// </summary>
|
||||
/// <value>The series timer identifier.</value>
|
||||
public string SeriesTimerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ChannelId of the recording.
|
||||
/// Gets or sets the channelId of the recording.
|
||||
/// </summary>
|
||||
public string ChannelId { get; set; }
|
||||
|
||||
@ -52,24 +51,24 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
public string ShowId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the recording.
|
||||
/// Gets or sets the name of the recording.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Description of the recording.
|
||||
/// Gets or sets the description of the recording.
|
||||
/// </summary>
|
||||
public string Overview { get; set; }
|
||||
|
||||
public string SeriesId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The start date of the recording, in UTC.
|
||||
/// Gets or sets the start date of the recording, in UTC.
|
||||
/// </summary>
|
||||
public DateTime StartDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The end date of the recording, in UTC.
|
||||
/// Gets or sets the end date of the recording, in UTC.
|
||||
/// </summary>
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
@ -133,7 +132,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
public bool IsSeries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is live.
|
||||
/// Gets a value indicating whether this instance is live.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
|
||||
[JsonIgnore]
|
||||
|
@ -2933,6 +2933,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
return threads;
|
||||
}
|
||||
|
||||
#nullable disable
|
||||
public void TryStreamCopy(EncodingJobInfo state)
|
||||
{
|
||||
|
@ -430,7 +430,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// Gets the target video level.
|
||||
/// </summary>
|
||||
public double? TargetVideoLevel
|
||||
{
|
||||
@ -453,7 +453,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// Gets the target video bit depth.
|
||||
/// </summary>
|
||||
public int? TargetVideoBitDepth
|
||||
{
|
||||
@ -488,7 +488,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// Gets the target framerate.
|
||||
/// </summary>
|
||||
public float? TargetFramerate
|
||||
{
|
||||
@ -520,7 +520,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// Gets the target packet length.
|
||||
/// </summary>
|
||||
public int? TargetPacketLength
|
||||
{
|
||||
@ -536,7 +536,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// Gets the target video profile.
|
||||
/// </summary>
|
||||
public string TargetVideoProfile
|
||||
{
|
||||
@ -700,25 +700,4 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// The location of the discovered FFmpeg tool.
|
||||
/// Gets location of the discovered FFmpeg tool.
|
||||
/// </summary>
|
||||
FFmpegLocation EncoderLocation { get; }
|
||||
|
||||
|
23
MediaBrowser.Controller/MediaEncoding/TranscodingJobType.cs
Normal file
23
MediaBrowser.Controller/MediaEncoding/TranscodingJobType.cs
Normal file
@ -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,14 +22,14 @@ namespace MediaBrowser.Controller.Playlists
|
||||
{
|
||||
public class Playlist : Folder, IHasShares
|
||||
{
|
||||
public static string[] SupportedExtensions =
|
||||
{
|
||||
".m3u",
|
||||
".m3u8",
|
||||
".pls",
|
||||
".wpl",
|
||||
".zpl"
|
||||
};
|
||||
public static readonly IReadOnlyList<string> SupportedExtensions = new[]
|
||||
{
|
||||
".m3u",
|
||||
".m3u8",
|
||||
".pls",
|
||||
".wpl",
|
||||
".zpl"
|
||||
};
|
||||
|
||||
public Guid OwnerUserId { get; set; }
|
||||
|
||||
|
9
MediaBrowser.Controller/Plugins/IRunBeforeStartup.cs
Normal file
9
MediaBrowser.Controller/Plugins/IRunBeforeStartup.cs
Normal file
@ -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>
|
||||
/// Run the initialization for this module. This method is invoked at application start.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||
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>
|
||||
/// 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>
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// The TV Series manager.
|
||||
/// </summary>
|
||||
public interface ITVSeriesManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the next up.
|
||||
/// </summary>
|
||||
/// <param name="query">The next up query.</param>
|
||||
/// <param name="options">The dto options.</param>
|
||||
/// <returns>The next up items.</returns>
|
||||
QueryResult<BaseItem> GetNextUp(NextUpQuery query, DtoOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the next up.
|
||||
/// </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 next up items.</returns>
|
||||
QueryResult<BaseItem> GetNextUp(NextUpQuery request, BaseItem[] parentsFolders, DtoOptions options);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user