Merge pull request #2385 from MediaBrowser/dev

Dev
release-10.1.0
Luke 8 years ago committed by GitHub
commit c2cb9c1a7c

@ -3368,9 +3368,9 @@ namespace Emby.Server.Implementations.Data
} }
} }
if (query.SimilarTo != null) if (query.SimilarTo != null && query.MinSimilarityScore > 0)
{ {
whereClauses.Add("SimilarityScore > 0"); whereClauses.Add("SimilarityScore > " + (query.MinSimilarityScore - 1).ToString(CultureInfo.InvariantCulture));
} }
if (query.IsFolder.HasValue) if (query.IsFolder.HasValue)

@ -100,7 +100,12 @@ namespace Emby.Server.Implementations.Intros
if (trailerTypes.Count > 0) if (trailerTypes.Count > 0)
{ {
var trailerResult = _libraryManager.GetItemList(new InternalItemsQuery if (trailerTypes.Count >= 5)
{
trailerTypes.Clear();
}
var trailerResult = _libraryManager.GetItemList(new InternalItemsQuery(user)
{ {
IncludeItemTypes = new[] { typeof(Trailer).Name }, IncludeItemTypes = new[] { typeof(Trailer).Name },
TrailerTypes = trailerTypes.ToArray(), TrailerTypes = trailerTypes.ToArray(),
@ -111,7 +116,8 @@ namespace Emby.Server.Implementations.Intros
// Account for duplicates by imdb id, since the database doesn't support this yet // Account for duplicates by imdb id, since the database doesn't support this yet
Limit = config.TrailerLimit * 2, Limit = config.TrailerLimit * 2,
SourceTypes = sourceTypes.ToArray() SourceTypes = sourceTypes.ToArray(),
MinSimilarityScore = 0
}).Where(i => string.IsNullOrWhiteSpace(i.GetProviderId(MetadataProviders.Imdb)) || !string.Equals(i.GetProviderId(MetadataProviders.Imdb), item.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).Take(config.TrailerLimit); }).Where(i => string.IsNullOrWhiteSpace(i.GetProviderId(MetadataProviders.Imdb)) || !string.Equals(i.GetProviderId(MetadataProviders.Imdb), item.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).Take(config.TrailerLimit);

@ -155,7 +155,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
ReadAtNativeFramerate = false, ReadAtNativeFramerate = false,
Id = channel.Path.GetMD5().ToString("N"), Id = channel.Path.GetMD5().ToString("N"),
IsInfiniteStream = true IsInfiniteStream = true,
SupportsDirectStream = false
}; };
return new List<MediaSourceInfo> { mediaSource }; return new List<MediaSourceInfo> { mediaSource };

@ -137,6 +137,7 @@ fon|||Fon|fon
fre|fra|fr|French|français fre|fra|fr|French|français
frm|||French, Middle (ca.1400-1600)|français moyen (1400-1600) frm|||French, Middle (ca.1400-1600)|français moyen (1400-1600)
fro|||French, Old (842-ca.1400)|français ancien (842-ca.1400) fro|||French, Old (842-ca.1400)|français ancien (842-ca.1400)
frc||fr-ca|French (Canada)|french
frr|||Northern Frisian|frison septentrional frr|||Northern Frisian|frison septentrional
frs|||Eastern Frisian|frison oriental frs|||Eastern Frisian|frison oriental
fry||fy|Western Frisian|frison occidental fry||fy|Western Frisian|frison occidental

@ -1885,7 +1885,7 @@ namespace MediaBrowser.Api.Playback
request.AudioCodec = InferAudioCodec(url); request.AudioCodec = InferAudioCodec(url);
} }
var state = new StreamState(MediaSourceManager, Logger) var state = new StreamState(MediaSourceManager, Logger, TranscodingJobType)
{ {
Request = request, Request = request,
RequestedUrl = url, RequestedUrl = url,

@ -309,13 +309,6 @@ namespace MediaBrowser.Api.Playback.Hls
return 0; return 0;
} }
protected bool IsLiveStream(StreamState state)
{
var isLiveStream = (state.RunTimeTicks ?? 0) == 0;
return isLiveStream;
}
public BaseHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer, IAuthorizationContext authorizationContext) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer, authorizationContext) public BaseHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer, IAuthorizationContext authorizationContext) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer, authorizationContext)
{ {
} }

@ -521,7 +521,7 @@ namespace MediaBrowser.Api.Playback.Hls
builder.AppendLine("#EXTM3U"); builder.AppendLine("#EXTM3U");
var isLiveStream = IsLiveStream(state); var isLiveStream = state.IsSegmentedLiveStream;
var queryStringIndex = Request.RawUrl.IndexOf('?'); var queryStringIndex = Request.RawUrl.IndexOf('?');
var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex); var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex);

@ -89,17 +89,25 @@ namespace MediaBrowser.Api.Playback
return 10; return 10;
} }
if (!RunTimeTicks.HasValue) if (IsSegmentedLiveStream)
{ {
return 3; return 3;
} }
return 3; return 6;
} }
return 3; return 3;
} }
} }
public bool IsSegmentedLiveStream
{
get
{
return TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
}
}
public int HlsListSize public int HlsListSize
{ {
get get
@ -119,8 +127,9 @@ namespace MediaBrowser.Api.Playback
public List<string> SupportedAudioCodecs { get; set; } public List<string> SupportedAudioCodecs { get; set; }
public List<string> SupportedVideoCodecs { get; set; } public List<string> SupportedVideoCodecs { get; set; }
public string UserAgent { get; set; } public string UserAgent { get; set; }
public TranscodingJobType TranscodingType { get; set; }
public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger) public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType)
{ {
_mediaSourceManager = mediaSourceManager; _mediaSourceManager = mediaSourceManager;
_logger = logger; _logger = logger;
@ -128,6 +137,7 @@ namespace MediaBrowser.Api.Playback
SupportedVideoCodecs = new List<string>(); SupportedVideoCodecs = new List<string>();
PlayableStreamFileNames = new List<string>(); PlayableStreamFileNames = new List<string>();
RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
TranscodingType = transcodingType;
} }
public string InputAudioSync { get; set; } public string InputAudioSync { get; set; }

@ -65,7 +65,7 @@ namespace MediaBrowser.Controller.Channels
Name = id, Name = id,
Id = id, Id = id,
ReadAtNativeFramerate = ReadAtNativeFramerate, ReadAtNativeFramerate = ReadAtNativeFramerate,
SupportsDirectStream = Protocol == MediaProtocol.File, SupportsDirectStream = false,
SupportsDirectPlay = SupportsDirectPlay SupportsDirectPlay = SupportsDirectPlay
}; };

@ -53,6 +53,7 @@ namespace MediaBrowser.Controller.Entities
ImageInfos = new List<ItemImageInfo>(); ImageInfos = new List<ItemImageInfo>();
InheritedTags = new List<string>(); InheritedTags = new List<string>();
ProductionLocations = new List<string>(); ProductionLocations = new List<string>();
SourceType = SourceType.Library;
} }
public static readonly char[] SlugReplaceChars = { '?', '/', '&' }; public static readonly char[] SlugReplaceChars = { '?', '/', '&' };

@ -160,6 +160,7 @@ namespace MediaBrowser.Controller.Entities
public DateTime? MinDateLastSaved { get; set; } public DateTime? MinDateLastSaved { get; set; }
public DtoOptions DtoOptions { get; set; } public DtoOptions DtoOptions { get; set; }
public int MinSimilarityScore { get; set; }
public bool HasField(ItemFields name) public bool HasField(ItemFields name)
{ {
@ -197,6 +198,8 @@ namespace MediaBrowser.Controller.Entities
public InternalItemsQuery() public InternalItemsQuery()
{ {
MinSimilarityScore = 1;
GroupByPresentationUniqueKey = true; GroupByPresentationUniqueKey = true;
EnableTotalRecordCount = true; EnableTotalRecordCount = true;

@ -20,9 +20,6 @@ using System;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
namespace MediaBrowser.Providers.MediaInfo namespace MediaBrowser.Providers.MediaInfo
@ -35,6 +32,8 @@ namespace MediaBrowser.Providers.MediaInfo
ICustomMetadataProvider<Trailer>, ICustomMetadataProvider<Trailer>,
ICustomMetadataProvider<Video>, ICustomMetadataProvider<Video>,
ICustomMetadataProvider<Audio>, ICustomMetadataProvider<Audio>,
ICustomMetadataProvider<AudioPodcast>,
ICustomMetadataProvider<AudioBook>,
IHasItemChangeMonitor, IHasItemChangeMonitor,
IHasOrder, IHasOrder,
IForcedProvider, IForcedProvider,
@ -100,6 +99,16 @@ namespace MediaBrowser.Providers.MediaInfo
return FetchAudioInfo(item, cancellationToken); return FetchAudioInfo(item, cancellationToken);
} }
public Task<ItemUpdateType> FetchAsync(AudioPodcast item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchAudioInfo(item, cancellationToken);
}
public Task<ItemUpdateType> FetchAsync(AudioBook item, MetadataRefreshOptions options, CancellationToken cancellationToken)
{
return FetchAudioInfo(item, cancellationToken);
}
public FFProbeProvider(ILogger logger, IIsoManager isoManager, IMediaEncoder mediaEncoder, IItemRepository itemRepo, IBlurayExaminer blurayExaminer, ILocalizationManager localization, IApplicationPaths appPaths, IJsonSerializer json, IEncodingManager encodingManager, IFileSystem fileSystem, IServerConfigurationManager config, ISubtitleManager subtitleManager, IChapterManager chapterManager, ILibraryManager libraryManager) public FFProbeProvider(ILogger logger, IIsoManager isoManager, IMediaEncoder mediaEncoder, IItemRepository itemRepo, IBlurayExaminer blurayExaminer, ILocalizationManager localization, IApplicationPaths appPaths, IJsonSerializer json, IEncodingManager encodingManager, IFileSystem fileSystem, IServerConfigurationManager config, ISubtitleManager subtitleManager, IChapterManager chapterManager, ILibraryManager libraryManager)
{ {
_logger = logger; _logger = logger;

@ -849,9 +849,6 @@
<Content Include="dashboard-ui\dashboard\autoorganizelog.js"> <Content Include="dashboard-ui\dashboard\autoorganizelog.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\scripts\externalplayer.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\favorites.js"> <Content Include="dashboard-ui\scripts\favorites.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

Loading…
Cancel
Save