mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
update translations
This commit is contained in:
@@ -12,6 +12,6 @@ namespace MediaBrowser.Controller.Activity
|
||||
|
||||
Task Create(ActivityLogEntry entry);
|
||||
|
||||
QueryResult<ActivityLogEntry> GetActivityLogEntries(int? startIndex, int? limit);
|
||||
QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Activity
|
||||
@@ -8,6 +9,6 @@ namespace MediaBrowser.Controller.Activity
|
||||
{
|
||||
Task Create(ActivityLogEntry entry);
|
||||
|
||||
QueryResult<ActivityLogEntry> GetActivityLogEntries(int? startIndex, int? limit);
|
||||
QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Channels;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Controller.Localization;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
@@ -66,6 +67,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>
|
||||
public bool IsInMixedFolder { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual bool SupportsRemoteImageDownloading
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private string _name;
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
@@ -227,6 +237,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public static IItemRepository ItemRepository { get; set; }
|
||||
public static IFileSystem FileSystem { get; set; }
|
||||
public static IUserDataManager UserDataManager { get; set; }
|
||||
public static ILiveTvManager LiveTvManager { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="System.String" /> that represents this instance.
|
||||
|
||||
@@ -840,7 +840,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (includeLinkedChildren)
|
||||
{
|
||||
foreach (var child in GetLinkedChildren())
|
||||
foreach (var child in GetLinkedChildren(user))
|
||||
{
|
||||
if (child.IsVisible(user))
|
||||
{
|
||||
@@ -924,6 +924,31 @@ namespace MediaBrowser.Controller.Entities
|
||||
.Where(i => i != null);
|
||||
}
|
||||
|
||||
protected virtual bool FilterLinkedChildrenPerUser
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<BaseItem> GetLinkedChildren(User user)
|
||||
{
|
||||
if (!FilterLinkedChildrenPerUser)
|
||||
{
|
||||
return GetLinkedChildren();
|
||||
}
|
||||
|
||||
var locations = user.RootFolder
|
||||
.Children
|
||||
.OfType<CollectionFolder>()
|
||||
.SelectMany(i => i.PhysicalLocations)
|
||||
.ToList();
|
||||
|
||||
return LinkedChildren.Where(i => string.IsNullOrWhiteSpace(i.Path) || locations.Any(l => FileSystem.ContainsSubPath(l, i.Path)))
|
||||
.Select(GetLinkedChild)
|
||||
.Where(i => i != null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the linked children.
|
||||
|
||||
@@ -154,6 +154,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is locked; otherwise, <c>false</c>.</value>
|
||||
bool IsLocked { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [supports remote image downloading].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [supports remote image downloading]; otherwise, <c>false</c>.</value>
|
||||
bool SupportsRemoteImageDownloading { get; }
|
||||
}
|
||||
|
||||
public static class HasImagesExtensions
|
||||
|
||||
@@ -9,6 +9,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public interface IHasMediaSources
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the identifier.
|
||||
/// </summary>
|
||||
/// <value>The identifier.</value>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the media sources.
|
||||
/// </summary>
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// Serves as a cache
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public Guid? ItemId { get; set; }
|
||||
|
||||
public static LinkedChild Create(BaseItem item)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Runtime.Serialization;
|
||||
using MediaBrowser.Common.Progress;
|
||||
using MediaBrowser.Controller.Playlists;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@@ -26,6 +27,14 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
Keywords = new List<string>();
|
||||
}
|
||||
|
||||
protected override bool FilterLinkedChildrenPerUser
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Guid> LocalTrailerIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -72,6 +81,8 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
{
|
||||
var children = base.GetChildren(user, includeLinkedChildren);
|
||||
|
||||
children = Playlist.FilterInaccessibleItems(children, user);
|
||||
|
||||
if (string.Equals(DisplayOrder, ItemSortBy.SortName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Sort by name
|
||||
@@ -83,11 +94,17 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
// Sort by release date
|
||||
return LibraryManager.Sort(children, user, new[] { ItemSortBy.ProductionYear, ItemSortBy.PremiereDate, ItemSortBy.SortName }, SortOrder.Ascending);
|
||||
}
|
||||
|
||||
|
||||
// Default sorting
|
||||
return LibraryManager.Sort(children, user, new[] { ItemSortBy.ProductionYear, ItemSortBy.PremiereDate, ItemSortBy.SortName }, SortOrder.Ascending);
|
||||
}
|
||||
|
||||
public override IEnumerable<BaseItem> GetRecursiveChildren(User user, bool includeLinkedChildren = true)
|
||||
{
|
||||
var children = base.GetRecursiveChildren(user, includeLinkedChildren);
|
||||
return Playlist.FilterInaccessibleItems(children, user);
|
||||
}
|
||||
|
||||
public BoxSetInfo GetLookupInfo()
|
||||
{
|
||||
return GetItemLookupInfo<BoxSetInfo>();
|
||||
|
||||
@@ -188,6 +188,20 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
return false;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsRemoteImageDownloading
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsMissingEpisode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsMissingEpisode
|
||||
{
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public class UserView : Folder
|
||||
{
|
||||
public string ViewType { get; set; }
|
||||
public static IUserViewManager UserViewManager { get; set; }
|
||||
|
||||
public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
||||
{
|
||||
@@ -17,6 +22,23 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
switch (ViewType)
|
||||
{
|
||||
case CollectionType.LiveTvChannels:
|
||||
return LiveTvManager.GetInternalChannels(new LiveTvChannelQuery
|
||||
{
|
||||
UserId = user.Id.ToString("N")
|
||||
|
||||
}, CancellationToken.None).Result.Items;
|
||||
case CollectionType.LiveTvRecordingGroups:
|
||||
return LiveTvManager.GetInternalRecordings(new RecordingQuery
|
||||
{
|
||||
UserId = user.Id.ToString("N"),
|
||||
Status = RecordingStatus.Completed
|
||||
|
||||
}, CancellationToken.None).Result.Items;
|
||||
case CollectionType.LiveTv:
|
||||
return GetLiveTvFolders(user).Result;
|
||||
case CollectionType.Folders:
|
||||
return user.RootFolder.GetChildren(user, includeLinkedChildren);
|
||||
case CollectionType.Games:
|
||||
return mediaFolders.SelectMany(i => i.GetRecursiveChildren(user, includeLinkedChildren))
|
||||
.OfType<GameSystem>();
|
||||
@@ -34,6 +56,16 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<BaseItem>> GetLiveTvFolders(User user)
|
||||
{
|
||||
var list = new List<BaseItem>();
|
||||
|
||||
list.Add(await UserViewManager.GetUserView(CollectionType.LiveTvChannels, user, string.Empty, CancellationToken.None).ConfigureAwait(false));
|
||||
list.Add(await UserViewManager.GetUserView(CollectionType.LiveTvRecordingGroups, user, string.Empty, CancellationToken.None).ConfigureAwait(false));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
|
||||
{
|
||||
return GetChildren(user, false);
|
||||
|
||||
@@ -9,5 +9,7 @@ namespace MediaBrowser.Controller.Library
|
||||
public interface IUserViewManager
|
||||
{
|
||||
Task<IEnumerable<Folder>> GetUserViews(UserViewQuery query, CancellationToken cancellationToken);
|
||||
|
||||
Task<UserView> GetUserView(string type, User user, string sortName, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,5 +280,22 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{User}.</returns>
|
||||
IEnumerable<User> GetEnabledUsers();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal channels.
|
||||
/// </summary>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<QueryResult<LiveTvChannel>>.</returns>
|
||||
Task<QueryResult<LiveTvChannel>> GetInternalChannels(LiveTvChannelQuery query,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal recordings.
|
||||
/// </summary>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<QueryResult<BaseItem>>.</returns>
|
||||
Task<QueryResult<BaseItem>> GetInternalRecordings(RecordingQuery query, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
22
MediaBrowser.Controller/LiveTv/RecordingGroup.cs
Normal file
22
MediaBrowser.Controller/LiveTv/RecordingGroup.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
|
||||
namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
public class RecordingGroup : Folder
|
||||
{
|
||||
protected override bool GetBlockUnratedValue(UserConfiguration config)
|
||||
{
|
||||
// Don't block.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool SupportsLocalMetadata
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,6 +168,7 @@
|
||||
<Compile Include="Library\LibraryManagerExtensions.cs" />
|
||||
<Compile Include="Library\PlaybackStopEventArgs.cs" />
|
||||
<Compile Include="Library\UserDataSaveEventArgs.cs" />
|
||||
<Compile Include="LiveTv\RecordingGroup.cs" />
|
||||
<Compile Include="LiveTv\RecordingStatusChangedEventArgs.cs" />
|
||||
<Compile Include="LiveTv\ILiveTvRecording.cs" />
|
||||
<Compile Include="LiveTv\LiveStreamInfo.cs" />
|
||||
|
||||
@@ -12,6 +12,14 @@ namespace MediaBrowser.Controller.Playlists
|
||||
{
|
||||
public string OwnerUserId { get; set; }
|
||||
|
||||
protected override bool FilterLinkedChildrenPerUser
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
||||
{
|
||||
return GetPlayableItems(user);
|
||||
@@ -34,7 +42,12 @@ namespace MediaBrowser.Controller.Playlists
|
||||
|
||||
public static IEnumerable<BaseItem> GetPlaylistItems(string playlistMediaType, IEnumerable<BaseItem> inputItems, User user)
|
||||
{
|
||||
return inputItems.SelectMany(i =>
|
||||
if (user != null)
|
||||
{
|
||||
inputItems = inputItems.Where(i => i.IsVisible(user));
|
||||
}
|
||||
|
||||
inputItems = inputItems.SelectMany(i =>
|
||||
{
|
||||
var folder = i as Folder;
|
||||
|
||||
@@ -58,6 +71,31 @@ namespace MediaBrowser.Controller.Playlists
|
||||
return new[] { i };
|
||||
|
||||
}).Where(m => string.Equals(m.MediaType, playlistMediaType, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
return FilterInaccessibleItems(inputItems, user);
|
||||
}
|
||||
|
||||
public static IEnumerable<BaseItem> FilterInaccessibleItems(IEnumerable<BaseItem> items, User user)
|
||||
{
|
||||
return items;
|
||||
//var locations = user.RootFolder.Children.OfType<CollectionFolder>().SelectMany(i => i.PhysicalLocations).ToList();
|
||||
|
||||
//return items.Where(i =>
|
||||
//{
|
||||
// var parent = i.Parent;
|
||||
|
||||
// while (parent != null)
|
||||
// {
|
||||
// parent = parent.Parent;
|
||||
|
||||
// if (parent != null && parent.Parent is AggregateFolder)
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// return parent == null || locations.Contains(parent.Path, StringComparer.OrdinalIgnoreCase);
|
||||
//});
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
|
||||
Reference in New Issue
Block a user