mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-02 05:04:31 -04:00
update program titles
This commit is contained in:
parent
0bf95da493
commit
2ef30a3ba8
@ -161,12 +161,6 @@ namespace Emby.Common.Implementations
|
|||||||
/// <value>The name.</value>
|
/// <value>The name.</value>
|
||||||
public abstract string Name { get; }
|
public abstract string Name { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance is running as service.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
|
||||||
public abstract bool IsRunningAsService { get; }
|
|
||||||
|
|
||||||
protected ICryptoProvider CryptographyProvider = new CryptographyProvider();
|
protected ICryptoProvider CryptographyProvider = new CryptographyProvider();
|
||||||
|
|
||||||
protected IEnvironmentInfo EnvironmentInfo { get; private set; }
|
protected IEnvironmentInfo EnvironmentInfo { get; private set; }
|
||||||
|
@ -326,6 +326,8 @@ namespace Emby.Server.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract bool IsRunningAsService { get; }
|
||||||
|
|
||||||
private Assembly GetAssembly(Type type)
|
private Assembly GetAssembly(Type type)
|
||||||
{
|
{
|
||||||
return type.GetTypeInfo().Assembly;
|
return type.GetTypeInfo().Assembly;
|
||||||
@ -1247,7 +1249,6 @@ namespace Emby.Server.Core
|
|||||||
HasUpdateAvailable = HasUpdateAvailable,
|
HasUpdateAvailable = HasUpdateAvailable,
|
||||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||||
IsRunningAsService = IsRunningAsService,
|
|
||||||
SupportsRunningAsService = SupportsRunningAsService,
|
SupportsRunningAsService = SupportsRunningAsService,
|
||||||
ServerName = FriendlyName,
|
ServerName = FriendlyName,
|
||||||
LocalAddress = localAddress,
|
LocalAddress = localAddress,
|
||||||
|
@ -2384,8 +2384,17 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
var excludeIds = query.ExcludeItemIds.ToList();
|
var excludeIds = query.ExcludeItemIds.ToList();
|
||||||
excludeIds.Add(item.Id.ToString("N"));
|
excludeIds.Add(item.Id.ToString("N"));
|
||||||
query.ExcludeItemIds = excludeIds.ToArray();
|
|
||||||
|
|
||||||
|
if (query.IncludeItemTypes.Length == 0 || query.IncludeItemTypes.Contains(typeof(Trailer).Name))
|
||||||
|
{
|
||||||
|
var hasTrailers = item as IHasTrailers;
|
||||||
|
if (hasTrailers != null)
|
||||||
|
{
|
||||||
|
excludeIds.AddRange(hasTrailers.GetTrailerIds().Select(i => i.ToString("N")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query.ExcludeItemIds = excludeIds.ToArray();
|
||||||
query.ExcludeProviderIds = item.ProviderIds;
|
query.ExcludeProviderIds = item.ProviderIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2821,8 +2830,9 @@ namespace Emby.Server.Implementations.Data
|
|||||||
{
|
{
|
||||||
if (orderBy.Count == 0)
|
if (orderBy.Count == 0)
|
||||||
{
|
{
|
||||||
orderBy.Add(new Tuple<string, SortOrder>("SimilarityScore", SortOrder.Descending));
|
|
||||||
orderBy.Add(new Tuple<string, SortOrder>(ItemSortBy.Random, SortOrder.Ascending));
|
orderBy.Add(new Tuple<string, SortOrder>(ItemSortBy.Random, SortOrder.Ascending));
|
||||||
|
orderBy.Add(new Tuple<string, SortOrder>("SimilarityScore", SortOrder.Descending));
|
||||||
|
//orderBy.Add(new Tuple<string, SortOrder>(ItemSortBy.Random, SortOrder.Ascending));
|
||||||
query.SortOrder = SortOrder.Descending;
|
query.SortOrder = SortOrder.Descending;
|
||||||
enableOrderInversion = false;
|
enableOrderInversion = false;
|
||||||
}
|
}
|
||||||
|
@ -6,15 +6,16 @@ using System.Threading.Tasks;
|
|||||||
using MediaBrowser.Model.System;
|
using MediaBrowser.Model.System;
|
||||||
using MediaBrowser.Controller.Plugins;
|
using MediaBrowser.Controller.Plugins;
|
||||||
using MediaBrowser.Common;
|
using MediaBrowser.Common;
|
||||||
|
using MediaBrowser.Controller;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.EntryPoints
|
namespace Emby.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
public class SystemEvents : IServerEntryPoint
|
public class SystemEvents : IServerEntryPoint
|
||||||
{
|
{
|
||||||
private readonly ISystemEvents _systemEvents;
|
private readonly ISystemEvents _systemEvents;
|
||||||
private readonly IApplicationHost _appHost;
|
private readonly IServerApplicationHost _appHost;
|
||||||
|
|
||||||
public SystemEvents(ISystemEvents systemEvents, IApplicationHost appHost)
|
public SystemEvents(ISystemEvents systemEvents, IServerApplicationHost appHost)
|
||||||
{
|
{
|
||||||
_systemEvents = systemEvents;
|
_systemEvents = systemEvents;
|
||||||
_appHost = appHost;
|
_appHost = appHost;
|
||||||
|
@ -10,6 +10,7 @@ using System.Collections.Concurrent;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using MediaBrowser.Controller;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.EntryPoints
|
namespace Emby.Server.Implementations.EntryPoints
|
||||||
@ -19,7 +20,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class UsageEntryPoint : IServerEntryPoint
|
public class UsageEntryPoint : IServerEntryPoint
|
||||||
{
|
{
|
||||||
private readonly IApplicationHost _applicationHost;
|
private readonly IServerApplicationHost _applicationHost;
|
||||||
private readonly IHttpClient _httpClient;
|
private readonly IHttpClient _httpClient;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly ISessionManager _sessionManager;
|
private readonly ISessionManager _sessionManager;
|
||||||
@ -28,7 +29,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||||||
|
|
||||||
private readonly ConcurrentDictionary<Guid, ClientInfo> _apps = new ConcurrentDictionary<Guid, ClientInfo>();
|
private readonly ConcurrentDictionary<Guid, ClientInfo> _apps = new ConcurrentDictionary<Guid, ClientInfo>();
|
||||||
|
|
||||||
public UsageEntryPoint(ILogger logger, IApplicationHost applicationHost, IHttpClient httpClient, ISessionManager sessionManager, IUserManager userManager, IServerConfigurationManager config)
|
public UsageEntryPoint(ILogger logger, IServerApplicationHost applicationHost, IHttpClient httpClient, ISessionManager sessionManager, IUserManager userManager, IServerConfigurationManager config)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_applicationHost = applicationHost;
|
_applicationHost = applicationHost;
|
||||||
|
@ -8,19 +8,20 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using MediaBrowser.Controller;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.EntryPoints
|
namespace Emby.Server.Implementations.EntryPoints
|
||||||
{
|
{
|
||||||
public class UsageReporter
|
public class UsageReporter
|
||||||
{
|
{
|
||||||
private readonly IApplicationHost _applicationHost;
|
private readonly IServerApplicationHost _applicationHost;
|
||||||
private readonly IHttpClient _httpClient;
|
private readonly IHttpClient _httpClient;
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
|
private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
|
||||||
|
|
||||||
public UsageReporter(IApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger)
|
public UsageReporter(IServerApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger)
|
||||||
{
|
{
|
||||||
_applicationHost = applicationHost;
|
_applicationHost = applicationHost;
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
|
@ -188,11 +188,13 @@ namespace Emby.Server.Implementations.FileOrganization
|
|||||||
seriesFolderName = string.Format("{0} ({1})", seriesFolderName, series.ProductionYear);
|
seriesFolderName = string.Format("{0} ({1})", seriesFolderName, series.ProductionYear);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seriesFolderName = _fileSystem.GetValidFilename(seriesFolderName);
|
||||||
|
|
||||||
series.Path = Path.Combine(request.TargetFolder, seriesFolderName);
|
series.Path = Path.Combine(request.TargetFolder, seriesFolderName);
|
||||||
|
|
||||||
series.ProviderIds = request.NewSeriesProviderIds;
|
series.ProviderIds = request.NewSeriesProviderIds;
|
||||||
|
|
||||||
await series.RefreshMetadata(refreshOptions, cancellationToken);
|
await series.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (series == null)
|
if (series == null)
|
||||||
|
@ -118,8 +118,7 @@ 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 * 4,
|
Limit = config.TrailerLimit * 4,
|
||||||
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))
|
.Where(i => string.IsNullOrWhiteSpace(i.GetProviderId(MetadataProviders.Imdb)) || !string.Equals(i.GetProviderId(MetadataProviders.Imdb), item.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase))
|
||||||
.Where(i => i.IsVisibleStandalone(user))
|
.Where(i => i.IsVisibleStandalone(user))
|
||||||
|
@ -199,6 +199,8 @@ namespace Emby.Server.Implementations.Library
|
|||||||
|
|
||||||
foreach (var mediaSource in list)
|
foreach (var mediaSource in list)
|
||||||
{
|
{
|
||||||
|
mediaSource.InferTotalBitrate();
|
||||||
|
|
||||||
SetKeyProperties(provider, mediaSource);
|
SetKeyProperties(provider, mediaSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1064,6 +1064,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
var isAudio = false;
|
var isAudio = false;
|
||||||
await new LiveStreamHelper(_mediaEncoder, _logger).AddMediaInfoWithProbe(stream, isAudio, cancellationToken).ConfigureAwait(false);
|
await new LiveStreamHelper(_mediaEncoder, _logger).AddMediaInfoWithProbe(stream, isAudio, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
stream.InferTotalBitrate();
|
||||||
|
|
||||||
return new List<MediaSourceInfo>
|
return new List<MediaSourceInfo>
|
||||||
{
|
{
|
||||||
stream
|
stream
|
||||||
|
@ -96,15 +96,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to estimate this
|
// Try to estimate this
|
||||||
if (!mediaSource.Bitrate.HasValue)
|
mediaSource.InferTotalBitrate();
|
||||||
{
|
|
||||||
var total = mediaSource.MediaStreams.Select(i => i.BitRate ?? 0).Sum();
|
|
||||||
|
|
||||||
if (total > 0)
|
|
||||||
{
|
|
||||||
mediaSource.Bitrate = total;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -459,15 +459,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the total bitrate if not already supplied
|
// Set the total bitrate if not already supplied
|
||||||
if (!mediaSource.Bitrate.HasValue)
|
mediaSource.InferTotalBitrate();
|
||||||
{
|
|
||||||
var total = mediaSource.MediaStreams.Select(i => i.BitRate ?? 0).Sum();
|
|
||||||
|
|
||||||
if (total > 0)
|
|
||||||
{
|
|
||||||
mediaSource.Bitrate = total;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(service is EmbyTV.EmbyTV))
|
if (!(service is EmbyTV.EmbyTV))
|
||||||
{
|
{
|
||||||
|
@ -200,15 +200,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to estimate this
|
// Try to estimate this
|
||||||
if (!mediaSource.Bitrate.HasValue)
|
mediaSource.InferTotalBitrate();
|
||||||
{
|
|
||||||
var total = mediaSource.MediaStreams.Select(i => i.BitRate ?? 0).Sum();
|
|
||||||
|
|
||||||
if (total > 0)
|
|
||||||
{
|
|
||||||
mediaSource.Bitrate = total;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task CloseMediaSource(string liveStreamId)
|
public Task CloseMediaSource(string liveStreamId)
|
||||||
|
@ -431,6 +431,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|||||||
IsInfiniteStream = true
|
IsInfiniteStream = true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mediaSource.InferTotalBitrate();
|
||||||
|
|
||||||
return mediaSource;
|
return mediaSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|||||||
private readonly TaskCompletionSource<bool> _liveStreamTaskCompletionSource = new TaskCompletionSource<bool>();
|
private readonly TaskCompletionSource<bool> _liveStreamTaskCompletionSource = new TaskCompletionSource<bool>();
|
||||||
private readonly MulticastStream _multicastStream;
|
private readonly MulticastStream _multicastStream;
|
||||||
|
|
||||||
|
|
||||||
public HdHomerunLiveStream(MediaSourceInfo mediaSource, string originalStreamId, IFileSystem fileSystem, IHttpClient httpClient, ILogger logger, IServerApplicationPaths appPaths, IServerApplicationHost appHost)
|
public HdHomerunLiveStream(MediaSourceInfo mediaSource, string originalStreamId, IFileSystem fileSystem, IHttpClient httpClient, ILogger logger, IServerApplicationPaths appPaths, IServerApplicationHost appHost)
|
||||||
: base(mediaSource)
|
: base(mediaSource)
|
||||||
{
|
{
|
||||||
|
@ -164,6 +164,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
|||||||
IsRemote = true
|
IsRemote = true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mediaSource.InferTotalBitrate();
|
||||||
|
|
||||||
return new List<MediaSourceInfo> { mediaSource };
|
return new List<MediaSourceInfo> { mediaSource };
|
||||||
}
|
}
|
||||||
return new List<MediaSourceInfo>();
|
return new List<MediaSourceInfo>();
|
||||||
|
@ -175,6 +175,15 @@ namespace MediaBrowser.Api.Playback
|
|||||||
return ToOptimizedResult(info);
|
return ToOptimizedResult(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private T Clone<T>(T obj)
|
||||||
|
{
|
||||||
|
// Since we're going to be setting properties on MediaSourceInfos that come out of _mediaSourceManager, we should clone it
|
||||||
|
// Should we move this directly into MediaSourceManager?
|
||||||
|
|
||||||
|
var json = _json.SerializeToString(obj);
|
||||||
|
return _json.DeserializeFromString<T>(json);
|
||||||
|
}
|
||||||
|
|
||||||
private async Task<PlaybackInfoResponse> GetPlaybackInfo(string id, string userId, string[] supportedLiveMediaTypes, string mediaSourceId = null, string liveStreamId = null)
|
private async Task<PlaybackInfoResponse> GetPlaybackInfo(string id, string userId, string[] supportedLiveMediaTypes, string mediaSourceId = null, string liveStreamId = null)
|
||||||
{
|
{
|
||||||
var result = new PlaybackInfoResponse();
|
var result = new PlaybackInfoResponse();
|
||||||
@ -217,6 +226,8 @@ namespace MediaBrowser.Api.Playback
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
result.MediaSources = Clone(result.MediaSources);
|
||||||
|
|
||||||
result.PlaySessionId = Guid.NewGuid().ToString("N");
|
result.PlaySessionId = Guid.NewGuid().ToString("N");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,12 +36,6 @@ namespace MediaBrowser.Common
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
event EventHandler<GenericEventArgs<PackageVersionInfo>> ApplicationUpdated;
|
event EventHandler<GenericEventArgs<PackageVersionInfo>> ApplicationUpdated;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance is running as service.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
|
||||||
bool IsRunningAsService { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance has pending kernel reload.
|
/// Gets or sets a value indicating whether this instance has pending kernel reload.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -72,12 +72,7 @@ namespace MediaBrowser.Controller.Channels
|
|||||||
IsRemote = true
|
IsRemote = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var bitrate = (AudioBitrate ?? 0) + (VideoBitrate ?? 0);
|
source.InferTotalBitrate();
|
||||||
|
|
||||||
if (bitrate > 0)
|
|
||||||
{
|
|
||||||
source.Bitrate = bitrate;
|
|
||||||
}
|
|
||||||
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
@ -267,15 +267,8 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var bitrate = i.TotalBitrate ??
|
info.Bitrate = i.TotalBitrate;
|
||||||
info.MediaStreams.Where(m => m.Type == MediaStreamType.Audio)
|
info.InferTotalBitrate();
|
||||||
.Select(m => m.BitRate ?? 0)
|
|
||||||
.Sum();
|
|
||||||
|
|
||||||
if (bitrate > 0)
|
|
||||||
{
|
|
||||||
info.Bitrate = bitrate;
|
|
||||||
}
|
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
public InternalItemsQuery()
|
public InternalItemsQuery()
|
||||||
{
|
{
|
||||||
MinSimilarityScore = 1;
|
MinSimilarityScore = 20;
|
||||||
|
|
||||||
GroupByPresentationUniqueKey = true;
|
GroupByPresentationUniqueKey = true;
|
||||||
EnableTotalRecordCount = true;
|
EnableTotalRecordCount = true;
|
||||||
|
@ -649,22 +649,8 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
info.Bitrate = i.TotalBitrate;
|
||||||
{
|
info.InferTotalBitrate();
|
||||||
var bitrate = i.TotalBitrate ??
|
|
||||||
info.MediaStreams.Where(m => m.Type != MediaStreamType.Subtitle && !string.Equals(m.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase))
|
|
||||||
.Select(m => m.BitRate ?? 0)
|
|
||||||
.Sum();
|
|
||||||
|
|
||||||
if (bitrate > 0)
|
|
||||||
{
|
|
||||||
info.Bitrate = bitrate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (OverflowException ex)
|
|
||||||
{
|
|
||||||
Logger.ErrorException("Error calculating total bitrate", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,12 @@ namespace MediaBrowser.Controller
|
|||||||
/// <returns>SystemInfo.</returns>
|
/// <returns>SystemInfo.</returns>
|
||||||
Task<SystemInfo> GetSystemInfo();
|
Task<SystemInfo> GetSystemInfo();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether this instance is running as service.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
||||||
|
bool IsRunningAsService { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether [supports automatic run at startup].
|
/// Gets a value indicating whether [supports automatic run at startup].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Entities;
|
|
||||||
using MediaBrowser.Model.Extensions;
|
using MediaBrowser.Model.Extensions;
|
||||||
using MediaBrowser.Model.MediaInfo;
|
using MediaBrowser.Model.MediaInfo;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using MediaBrowser.Model.Serialization;
|
using MediaBrowser.Model.Serialization;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Dto
|
namespace MediaBrowser.Model.Dto
|
||||||
@ -72,6 +72,32 @@ namespace MediaBrowser.Model.Dto
|
|||||||
SupportsProbing = true;
|
SupportsProbing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InferTotalBitrate()
|
||||||
|
{
|
||||||
|
if (Bitrate.HasValue || MediaStreams == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var internalStreams = MediaStreams
|
||||||
|
.Where(i => !i.IsExternal)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (internalStreams.Count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bitrate = internalStreams
|
||||||
|
.Select(m => m.BitRate ?? 0)
|
||||||
|
.Sum();
|
||||||
|
|
||||||
|
if (bitrate > 0)
|
||||||
|
{
|
||||||
|
Bitrate = bitrate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int? DefaultAudioStreamIndex { get; set; }
|
public int? DefaultAudioStreamIndex { get; set; }
|
||||||
public int? DefaultSubtitleStreamIndex { get; set; }
|
public int? DefaultSubtitleStreamIndex { get; set; }
|
||||||
|
|
||||||
|
@ -16,12 +16,6 @@ namespace MediaBrowser.Model.System
|
|||||||
/// <value>The display name of the operating system.</value>
|
/// <value>The display name of the operating system.</value>
|
||||||
public string OperatingSystemDisplayName { get; set; }
|
public string OperatingSystemDisplayName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether this instance is running as service.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
|
||||||
public bool IsRunningAsService { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether [supports running as service].
|
/// Gets or sets a value indicating whether [supports running as service].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -578,7 +578,7 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
return SaveMetadata(item, updateType, _savers.Where(i => savers.Contains(i.Name, StringComparer.OrdinalIgnoreCase)));
|
return SaveMetadata(item, updateType, _savers.Where(i => savers.Contains(i.Name, StringComparer.OrdinalIgnoreCase)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly SemaphoreSlim _saveLock = new SemaphoreSlim(1,1);
|
private readonly SemaphoreSlim _saveLock = new SemaphoreSlim(1, 1);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the metadata.
|
/// Saves the metadata.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -958,10 +958,13 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
{
|
{
|
||||||
var cancellationToken = CancellationToken.None;
|
var cancellationToken = CancellationToken.None;
|
||||||
|
|
||||||
var albums = _libraryManagerFactory().RootFolder
|
var albums = _libraryManagerFactory()
|
||||||
.GetRecursiveChildren()
|
.GetItemList(new InternalItemsQuery
|
||||||
|
{
|
||||||
|
IncludeItemTypes = new[] { typeof(MusicAlbum).Name },
|
||||||
|
ArtistIds = new[] { item.Id.ToString("N") }
|
||||||
|
})
|
||||||
.OfType<MusicAlbum>()
|
.OfType<MusicAlbum>()
|
||||||
.Where(i => i.HasAnyArtist(item.Name))
|
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var musicArtists = albums
|
var musicArtists = albums
|
||||||
|
@ -115,6 +115,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
|
|||||||
RequiresClosing = false
|
RequiresClosing = false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mediaSource.InferTotalBitrate();
|
||||||
|
|
||||||
return new List<MediaSourceInfo> { mediaSource };
|
return new List<MediaSourceInfo> { mediaSource };
|
||||||
}
|
}
|
||||||
return new List<MediaSourceInfo>();
|
return new List<MediaSourceInfo>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user