mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 07:18:47 +01:00
update translations
This commit is contained in:
@@ -14,6 +14,12 @@ namespace MediaBrowser.Controller.Channels
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description.
|
||||
/// </summary>
|
||||
/// <value>The description.</value>
|
||||
string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data version.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Model.Channels;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Channels;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System.Collections.Generic;
|
||||
@@ -80,5 +81,21 @@ namespace MediaBrowser.Controller.Channels
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
|
||||
Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channel folder.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>BaseItemDto.</returns>
|
||||
Task<Folder> GetInternalChannelFolder(string userId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channel folder.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>BaseItemDto.</returns>
|
||||
Task<BaseItemDto> GetChannelFolder(string userId, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
/// <value>The configuration directory path.</value>
|
||||
[IgnoreDataMember]
|
||||
internal string ConfigurationDirectoryPath
|
||||
public string ConfigurationDirectoryPath
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -247,10 +247,5 @@ namespace MediaBrowser.Controller.Entities
|
||||
Configuration = config;
|
||||
SaveConfiguration();
|
||||
}
|
||||
|
||||
public IEnumerable<Folder> GetViews()
|
||||
{
|
||||
return ((UserRootFolder)RootFolder).GetViews(this, CancellationToken.None).Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -57,90 +51,5 @@ namespace MediaBrowser.Controller.Entities
|
||||
LibraryManager.RegisterItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Folder>> GetViews(User user, CancellationToken cancellationToken)
|
||||
{
|
||||
var folders = user.RootFolder
|
||||
.GetChildren(user, true)
|
||||
.OfType<Folder>()
|
||||
.ToList();
|
||||
|
||||
var list = new List<Folder>();
|
||||
|
||||
var excludeFolderIds = user.Configuration.ExcludeFoldersFromGrouping.Select(i => new Guid(i)).ToList();
|
||||
|
||||
var standaloneFolders = folders.Where(i => UserView.IsExcludedFromGrouping(i) || excludeFolderIds.Contains(i.Id)).ToList();
|
||||
|
||||
list.AddRange(standaloneFolders);
|
||||
|
||||
var recursiveChildren = folders
|
||||
.Except(standaloneFolders)
|
||||
.SelectMany(i => i.GetRecursiveChildren(user, false))
|
||||
.ToList();
|
||||
|
||||
if (recursiveChildren.OfType<Series>().Any())
|
||||
{
|
||||
list.Add(await GetUserView(CollectionType.TvShows, user, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
if (recursiveChildren.OfType<MusicAlbum>().Any() ||
|
||||
recursiveChildren.OfType<MusicVideo>().Any())
|
||||
{
|
||||
list.Add(await GetUserView(CollectionType.Music, user, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
if (recursiveChildren.OfType<Movie>().Any())
|
||||
{
|
||||
list.Add(await GetUserView(CollectionType.Movies, user, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
if (recursiveChildren.OfType<Game>().Any())
|
||||
{
|
||||
list.Add(await GetUserView(CollectionType.Games, user, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
if (recursiveChildren.OfType<BoxSet>().Any())
|
||||
{
|
||||
list.Add(await GetUserView(CollectionType.BoxSets, user, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
return list.OrderBy(i => i.SortName);
|
||||
}
|
||||
|
||||
// Use this to force new entity creation, as needed
|
||||
private const string DataVersion = "5";
|
||||
private async Task<UserView> GetUserView(string type, User user, CancellationToken cancellationToken)
|
||||
{
|
||||
var name = LocalizationManager.GetLocalizedString("ViewType" + type);
|
||||
|
||||
var id = "view" + name + DataVersion + user.Id.ToString("N");
|
||||
var guid = id.GetMD5();
|
||||
|
||||
var item = LibraryManager.GetItemById(guid) as UserView;
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
var path = System.IO.Path.Combine(user.ConfigurationDirectoryPath,
|
||||
"views",
|
||||
FileSystem.GetValidFilename(name));
|
||||
|
||||
Directory.CreateDirectory(System.IO.Path.GetDirectoryName(path));
|
||||
|
||||
item = new UserView
|
||||
{
|
||||
Path = path,
|
||||
Id = guid,
|
||||
DateCreated = DateTime.UtcNow,
|
||||
Name = name,
|
||||
ViewType = type
|
||||
};
|
||||
|
||||
await LibraryManager.CreateItem(item, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await item.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,5 +332,15 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="items">The items.</param>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
IEnumerable<BaseItem> ReplaceVideosWithPrimaryVersions(IEnumerable<BaseItem> items);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the named folder.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="sortName">Name of the sort.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{Folder}.</returns>
|
||||
Task<UserView> GetNamedView(string name, string type, string sortName, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
13
MediaBrowser.Controller/Library/IUserViewManager.cs
Normal file
13
MediaBrowser.Controller/Library/IUserViewManager.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Library;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
public interface IUserViewManager
|
||||
{
|
||||
Task<IEnumerable<Folder>> GetUserViews(UserViewQuery query, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System.Collections.Generic;
|
||||
@@ -257,5 +258,21 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task ResetTuner(string id, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the live tv folder.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>BaseItemDto.</returns>
|
||||
Task<Folder> GetInternalLiveTvFolder(string userId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the live tv folder.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>BaseItemDto.</returns>
|
||||
Task<BaseItemDto> GetLiveTvFolder(string userId, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +160,7 @@
|
||||
<Compile Include="Library\IntroInfo.cs" />
|
||||
<Compile Include="Library\ItemUpdateType.cs" />
|
||||
<Compile Include="Library\IUserDataManager.cs" />
|
||||
<Compile Include="Library\IUserViewManager.cs" />
|
||||
<Compile Include="Library\LibraryManagerExtensions.cs" />
|
||||
<Compile Include="Library\PlaybackStopEventArgs.cs" />
|
||||
<Compile Include="Library\UserDataSaveEventArgs.cs" />
|
||||
|
||||
Reference in New Issue
Block a user