mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge branch 'beta' of https://github.com/MediaBrowser/Emby into beta
This commit is contained in:
commit
fc4876cfd2
@ -295,9 +295,9 @@ namespace Emby.Drawing.ImageMagick
|
|||||||
wand.OpenImage("gradient:#111111-#111111");
|
wand.OpenImage("gradient:#111111-#111111");
|
||||||
using (var draw = new DrawingWand())
|
using (var draw = new DrawingWand())
|
||||||
{
|
{
|
||||||
var iSlice = Convert.ToInt32(width * .1166666667 * 2);
|
var iSlice = Convert.ToInt32(width * 0.24125);
|
||||||
int iTrans = Convert.ToInt32(height * .25);
|
int iTrans = Convert.ToInt32(height * .25);
|
||||||
int iHeight = Convert.ToInt32(height * .62);
|
int iHeight = Convert.ToInt32(height * .70);
|
||||||
var horizontalImagePadding = Convert.ToInt32(width * 0.0125);
|
var horizontalImagePadding = Convert.ToInt32(width * 0.0125);
|
||||||
|
|
||||||
foreach (var element in wandImages.ImageList)
|
foreach (var element in wandImages.ImageList)
|
||||||
@ -339,7 +339,7 @@ namespace Emby.Drawing.ImageMagick
|
|||||||
|
|
||||||
wandList.AddImage(mwr);
|
wandList.AddImage(mwr);
|
||||||
int ex = (int)(wand.CurrentImage.Width - mwg.CurrentImage.Width) / 2;
|
int ex = (int)(wand.CurrentImage.Width - mwg.CurrentImage.Width) / 2;
|
||||||
wand.CurrentImage.CompositeImage(wandList.AppendImages(true), CompositeOperator.AtopCompositeOp, ex, Convert.ToInt32(height * .085));
|
wand.CurrentImage.CompositeImage(wandList.AppendImages(true), CompositeOperator.AtopCompositeOp, ex, Convert.ToInt32(height * .045));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -360,9 +360,9 @@ namespace Emby.Drawing.ImageMagick
|
|||||||
wand.OpenImage("gradient:#111111-#111111");
|
wand.OpenImage("gradient:#111111-#111111");
|
||||||
using (var draw = new DrawingWand())
|
using (var draw = new DrawingWand())
|
||||||
{
|
{
|
||||||
var iSlice = Convert.ToInt32(width * .3);
|
var iSlice = Convert.ToInt32(width * .32);
|
||||||
int iTrans = Convert.ToInt32(height * .25);
|
int iTrans = Convert.ToInt32(height * .25);
|
||||||
int iHeight = Convert.ToInt32(height * .63);
|
int iHeight = Convert.ToInt32(height * .68);
|
||||||
var horizontalImagePadding = Convert.ToInt32(width * 0.02);
|
var horizontalImagePadding = Convert.ToInt32(width * 0.02);
|
||||||
|
|
||||||
foreach (var element in wandImages.ImageList)
|
foreach (var element in wandImages.ImageList)
|
||||||
@ -404,7 +404,7 @@ namespace Emby.Drawing.ImageMagick
|
|||||||
|
|
||||||
wandList.AddImage(mwr);
|
wandList.AddImage(mwr);
|
||||||
int ex = (int)(wand.CurrentImage.Width - mwg.CurrentImage.Width) / 2;
|
int ex = (int)(wand.CurrentImage.Width - mwg.CurrentImage.Width) / 2;
|
||||||
wand.CurrentImage.CompositeImage(wandList.AppendImages(true), CompositeOperator.AtopCompositeOp, ex, Convert.ToInt32(height * .07));
|
wand.CurrentImage.CompositeImage(wandList.AppendImages(true), CompositeOperator.AtopCompositeOp, ex, Convert.ToInt32(height * .03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.Channels
|
|||||||
set { }
|
set { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
protected override async Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ namespace MediaBrowser.Controller.Channels
|
|||||||
return ExternalId;
|
return ExternalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
protected override async Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
protected virtual bool SupportsShortcutChildren
|
protected virtual bool SupportsShortcutChildren
|
||||||
{
|
{
|
||||||
get { return ConfigurationManager.Configuration.EnableWindowsShortcuts; }
|
get { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -1122,7 +1122,18 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
public Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
||||||
|
{
|
||||||
|
if (query.ItemIds.Length > 0)
|
||||||
|
{
|
||||||
|
var specificItems = query.ItemIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
|
||||||
|
return Task.FromResult(PostFilterAndSort(specificItems, query));
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetItemsInternal(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual async Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (SourceType == SourceType.Channel)
|
if (SourceType == SourceType.Channel)
|
||||||
{
|
{
|
||||||
@ -1175,9 +1186,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
: GetChildren(user, true).Where(filter);
|
: GetChildren(user, true).Where(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = PostFilterAndSort(items, query);
|
return PostFilterAndSort(items, query);
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items, InternalItemsQuery query)
|
protected QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items, InternalItemsQuery query)
|
||||||
|
@ -129,7 +129,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
get { return (IndexNumber ?? -1) == 0; }
|
get { return (IndexNumber ?? -1) == 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
protected override Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
var user = query.User;
|
var user = query.User;
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
return GetSeasons(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
|
return GetSeasons(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
protected override Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
var user = query.User;
|
var user = query.User;
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using MediaBrowser.Controller.Library;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
@ -17,7 +18,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class UserRootFolder : Folder
|
public class UserRootFolder : Folder
|
||||||
{
|
{
|
||||||
public override async Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
protected override async Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (query.Recursive)
|
if (query.Recursive)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
|
protected override Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
var parent = this as Folder;
|
var parent = this as Folder;
|
||||||
|
|
||||||
|
@ -219,14 +219,15 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||||||
string outputFormat;
|
string outputFormat;
|
||||||
string outputCodec;
|
string outputCodec;
|
||||||
|
|
||||||
if (string.Equals(subtitleStream.Codec, "ass", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(subtitleStream.Codec, "ass", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(subtitleStream.Codec, "ssa", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(subtitleStream.Codec, "srt", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// Extract
|
// Extract
|
||||||
outputCodec = "copy";
|
outputCodec = "copy";
|
||||||
outputFormat = "ass";
|
outputFormat = subtitleStream.Codec;
|
||||||
}
|
}
|
||||||
else if (string.Equals(subtitleStream.Codec, "subrip", StringComparison.OrdinalIgnoreCase) ||
|
else if (string.Equals(subtitleStream.Codec, "subrip", StringComparison.OrdinalIgnoreCase))
|
||||||
string.Equals(subtitleStream.Codec, "srt", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
{
|
||||||
// Extract
|
// Extract
|
||||||
outputCodec = "copy";
|
outputCodec = "copy";
|
||||||
|
@ -196,8 +196,6 @@ namespace MediaBrowser.Model.Configuration
|
|||||||
|
|
||||||
public int SharingExpirationDays { get; set; }
|
public int SharingExpirationDays { get; set; }
|
||||||
|
|
||||||
public bool EnableWindowsShortcuts { get; set; }
|
|
||||||
|
|
||||||
public bool EnableDateLastRefresh { get; set; }
|
public bool EnableDateLastRefresh { get; set; }
|
||||||
|
|
||||||
public string[] Migrations { get; set; }
|
public string[] Migrations { get; set; }
|
||||||
|
@ -383,7 +383,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
|
|
||||||
if (subtitleStream != null)
|
if (subtitleStream != null)
|
||||||
{
|
{
|
||||||
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context, directPlay.Value);
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, directPlay.Value);
|
||||||
|
|
||||||
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
||||||
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
||||||
@ -413,7 +413,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
|
|
||||||
if (subtitleStream != null)
|
if (subtitleStream != null)
|
||||||
{
|
{
|
||||||
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context, PlayMethod.Transcode);
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, PlayMethod.Transcode);
|
||||||
|
|
||||||
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
||||||
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
||||||
@ -739,7 +739,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
{
|
{
|
||||||
if (subtitleStream != null)
|
if (subtitleStream != null)
|
||||||
{
|
{
|
||||||
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context, playMethod);
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, playMethod);
|
||||||
|
|
||||||
if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed)
|
if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed)
|
||||||
{
|
{
|
||||||
@ -751,7 +751,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
return IsAudioEligibleForDirectPlay(item, maxBitrate);
|
return IsAudioEligibleForDirectPlay(item, maxBitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SubtitleProfile GetSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, EncodingContext context, PlayMethod playMethod)
|
public static SubtitleProfile GetSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod)
|
||||||
{
|
{
|
||||||
if (playMethod != PlayMethod.Transcode && !subtitleStream.IsExternal)
|
if (playMethod != PlayMethod.Transcode && !subtitleStream.IsExternal)
|
||||||
{
|
{
|
||||||
@ -775,7 +775,16 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for an external profile that matches the stream type (text/graphical)
|
// Look for an external or hls profile that matches the stream type (text/graphical) and doesn't require conversion
|
||||||
|
return GetExternalSubtitleProfile(subtitleStream, subtitleProfiles, playMethod, false) ?? GetExternalSubtitleProfile(subtitleStream, subtitleProfiles, playMethod, false) ?? new SubtitleProfile
|
||||||
|
{
|
||||||
|
Method = SubtitleDeliveryMethod.Encode,
|
||||||
|
Format = subtitleStream.Codec
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SubtitleProfile GetExternalSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, bool allowConversion)
|
||||||
|
{
|
||||||
foreach (SubtitleProfile profile in subtitleProfiles)
|
foreach (SubtitleProfile profile in subtitleProfiles)
|
||||||
{
|
{
|
||||||
if (profile.Method != SubtitleDeliveryMethod.External && profile.Method != SubtitleDeliveryMethod.Hls)
|
if (profile.Method != SubtitleDeliveryMethod.External && profile.Method != SubtitleDeliveryMethod.Hls)
|
||||||
@ -798,21 +807,24 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
{
|
{
|
||||||
bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format);
|
bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format);
|
||||||
|
|
||||||
if (subtitleStream.IsTextSubtitleStream || !requiresConversion)
|
if (requiresConversion && !allowConversion)
|
||||||
{
|
{
|
||||||
if (subtitleStream.SupportsExternalStream)
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!requiresConversion)
|
||||||
|
{
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subtitleStream.IsTextSubtitleStream && subtitleStream.SupportsExternalStream)
|
||||||
{
|
{
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return new SubtitleProfile
|
return null;
|
||||||
{
|
|
||||||
Method = SubtitleDeliveryMethod.Encode,
|
|
||||||
Format = subtitleStream.Codec
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsAudioEligibleForDirectPlay(MediaSourceInfo item, int? maxBitrate)
|
private bool IsAudioEligibleForDirectPlay(MediaSourceInfo item, int? maxBitrate)
|
||||||
|
@ -321,7 +321,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
|
|
||||||
private SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream, string baseUrl, string accessToken, long startPositionTicks, SubtitleProfile[] subtitleProfiles)
|
private SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream, string baseUrl, string accessToken, long startPositionTicks, SubtitleProfile[] subtitleProfiles)
|
||||||
{
|
{
|
||||||
SubtitleProfile subtitleProfile = StreamBuilder.GetSubtitleProfile(stream, subtitleProfiles, Context, PlayMethod);
|
SubtitleProfile subtitleProfile = StreamBuilder.GetSubtitleProfile(stream, subtitleProfiles, PlayMethod);
|
||||||
SubtitleStreamInfo info = new SubtitleStreamInfo
|
SubtitleStreamInfo info = new SubtitleStreamInfo
|
||||||
{
|
{
|
||||||
IsForced = stream.IsForced,
|
IsForced = stream.IsForced,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user