Merge pull request #2374 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-12-30 00:57:11 -05:00 committed by GitHub
commit 0577c38714
15 changed files with 54 additions and 109 deletions

View File

@ -261,10 +261,11 @@ namespace Emby.Server.Implementations.IO
// In order to determine if the file is being written to, we have to request write access
// But if the server only has readonly access, this is going to cause this entire algorithm to fail
// So we'll take a best guess about our access level
var requestedFileAccess = ConfigurationManager.Configuration.SaveLocalMeta
? FileAccessMode.ReadWrite
: FileAccessMode.Read;
//var requestedFileAccess = ConfigurationManager.Configuration.SaveLocalMeta
// ? FileAccessMode.ReadWrite
// : FileAccessMode.Read;
var requestedFileAccess = FileAccessMode.Read;
try
{
using (_fileSystem.GetFileStream(path, FileOpenMode.Open, requestedFileAccess, FileShareMode.ReadWrite))

View File

@ -1956,30 +1956,6 @@ namespace Emby.Server.Implementations.Library
var options = collectionFolder == null ? new LibraryOptions() : collectionFolder.GetLibraryOptions();
if (options.SchemaVersion < 3)
{
options.SaveLocalMetadata = ConfigurationManager.Configuration.SaveLocalMeta;
options.EnableInternetProviders = ConfigurationManager.Configuration.EnableInternetProviders;
}
if (options.SchemaVersion < 2)
{
var chapterOptions = ConfigurationManager.GetConfiguration<ChapterOptions>("chapters");
options.ExtractChapterImagesDuringLibraryScan = chapterOptions.ExtractDuringLibraryScan;
if (collectionFolder != null)
{
if (string.Equals(collectionFolder.CollectionType, "movies", StringComparison.OrdinalIgnoreCase))
{
options.EnableChapterImageExtraction = chapterOptions.EnableMovieChapterImageExtraction;
}
else if (string.Equals(collectionFolder.CollectionType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))
{
options.EnableChapterImageExtraction = chapterOptions.EnableEpisodeChapterImageExtraction;
}
}
}
return options;
}

View File

@ -1975,7 +1975,7 @@ namespace MediaBrowser.Api.Playback
if (state.OutputVideoBitrate.HasValue && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
{
var resolution = ResolutionNormalizer.Normalize(
state.VideoStream == null ? (int?) null : state.VideoStream.BitRate,
state.VideoStream == null ? (int?)null : state.VideoStream.BitRate,
state.OutputVideoBitrate.Value,
state.VideoStream == null ? null : state.VideoStream.Codec,
state.OutputVideoCodec,
@ -2691,6 +2691,28 @@ namespace MediaBrowser.Api.Playback
{
//inputModifier += " -noaccurate_seek";
}
foreach (var stream in state.MediaSource.MediaStreams)
{
if (!stream.IsExternal && stream.Type != MediaStreamType.Subtitle)
{
if (!string.IsNullOrWhiteSpace(stream.Codec) && stream.Index != -1)
{
inputModifier += " -codec:" + stream.Index.ToString(UsCulture) + " " + stream.Codec;
}
}
}
//var videoStream = state.VideoStream;
//if (videoStream != null && !string.IsNullOrWhiteSpace(videoStream.Codec))
//{
// inputModifier += " -codec:0 " + videoStream.Codec;
// var audioStream = state.AudioStream;
// if (audioStream != null && !string.IsNullOrWhiteSpace(audioStream.Codec))
// {
// inputModifier += " -codec:1 " + audioStream.Codec;
// }
//}
}
return inputModifier;

View File

@ -223,6 +223,7 @@ namespace MediaBrowser.Api.Playback.Hls
protected Stream GetPlaylistFileStream(string path)
{
var tmpPath = path + ".tmp";
tmpPath = path;
try
{

View File

@ -26,11 +26,5 @@ namespace MediaBrowser.Controller.Chapters
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SaveChapters(string itemId, List<ChapterInfo> chapters, CancellationToken cancellationToken);
/// <summary>
/// Gets the configuration.
/// </summary>
/// <returns>ChapterOptions.</returns>
ChapterOptions GetConfiguration();
}
}

View File

@ -121,7 +121,6 @@ namespace MediaBrowser.Controller.Entities
{
LibraryOptions[path] = options;
options.SchemaVersion = 3;
XmlSerializer.SerializeToFile(options, GetLibraryOptionsPath(path));
}
}

View File

@ -533,8 +533,10 @@ namespace MediaBrowser.MediaEncoding.Encoder
probeSize = probeSize + " " + analyzeDuration;
probeSize = probeSize.Trim();
var forceEnableLogging = request.Protocol != MediaProtocol.File;
return GetMediaInfoInternal(GetInputArgument(inputFiles, request.Protocol), request.InputPath, request.Protocol, extractChapters,
probeSize, request.MediaType == DlnaProfileType.Audio, request.VideoType, cancellationToken);
probeSize, request.MediaType == DlnaProfileType.Audio, request.VideoType, forceEnableLogging, cancellationToken);
}
/// <summary>
@ -577,14 +579,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
/// <summary>
/// Gets the media info internal.
/// </summary>
/// <param name="inputPath">The input path.</param>
/// <param name="primaryPath">The primary path.</param>
/// <param name="protocol">The protocol.</param>
/// <param name="extractChapters">if set to <c>true</c> [extract chapters].</param>
/// <param name="probeSizeArgument">The probe size argument.</param>
/// <param name="isAudio">if set to <c>true</c> [is audio].</param>
/// <param name="videoType">Type of the video.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{MediaInfoResult}.</returns>
private async Task<MediaInfo> GetMediaInfoInternal(string inputPath,
string primaryPath,
@ -593,6 +587,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
string probeSizeArgument,
bool isAudio,
VideoType videoType,
bool forceEnableLogging,
CancellationToken cancellationToken)
{
var args = extractChapters
@ -614,7 +609,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
EnableRaisingEvents = true
});
_logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
if (forceEnableLogging)
{
_logger.Info("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
}
else
{
_logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
}
using (var processWrapper = new ProcessWrapper(process, this, _logger))
{

View File

@ -1,11 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public class ChapterOptions
{
public bool EnableMovieChapterImageExtraction { get; set; }
public bool EnableEpisodeChapterImageExtraction { get; set; }
public bool EnableOtherVideoChapterImageExtraction { get; set; }
public bool ExtractDuringLibraryScan { get; set; }
}
}

View File

@ -5,7 +5,6 @@
public bool EnableArchiveMediaFiles { get; set; }
public bool EnablePhotos { get; set; }
public bool EnableRealtimeMonitor { get; set; }
public int SchemaVersion { get; set; }
public bool EnableChapterImageExtraction { get; set; }
public bool ExtractChapterImagesDuringLibraryScan { get; set; }
public bool DownloadImagesInAdvance { get; set; }

View File

@ -54,12 +54,6 @@ namespace MediaBrowser.Model.Configuration
/// <value>The value pointing to the file system where the ssl certiifcate is located..</value>
public string CertificatePath { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable internet providers].
/// </summary>
/// <value><c>true</c> if [enable internet providers]; otherwise, <c>false</c>.</value>
public bool EnableInternetProviders { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is port authorized.
/// </summary>
@ -87,12 +81,6 @@ namespace MediaBrowser.Model.Configuration
/// <value>The display name of the season zero.</value>
public string SeasonZeroDisplayName { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [save local meta].
/// </summary>
/// <value><c>true</c> if [save local meta]; otherwise, <c>false</c>.</value>
public bool SaveLocalMeta { get; set; }
/// <summary>
/// Gets or sets the preferred metadata language.
/// </summary>
@ -243,8 +231,6 @@ namespace MediaBrowser.Model.Configuration
LibraryMonitorDelay = 60;
EnableInternetProviders = true;
PathSubstitutions = new PathSubstitution[] { };
ContentTypes = new NameValuePair[] { };

View File

@ -78,7 +78,6 @@
<Compile Include="Collections\CollectionCreationResult.cs" />
<Compile Include="Configuration\AccessSchedule.cs" />
<Compile Include="Configuration\ChannelOptions.cs" />
<Compile Include="Configuration\ChapterOptions.cs" />
<Compile Include="Configuration\CinemaModeConfiguration.cs" />
<Compile Include="Configuration\EncodingOptions.cs" />
<Compile Include="Configuration\FanartOptions.cs" />

View File

@ -43,25 +43,5 @@ namespace MediaBrowser.Providers.Chapters
{
return _itemRepo.SaveChapters(new Guid(itemId), chapters, cancellationToken);
}
public ChapterOptions GetConfiguration()
{
return _config.GetConfiguration<ChapterOptions>("chapters");
}
}
public class ChapterConfigurationStore : IConfigurationFactory
{
public IEnumerable<ConfigurationStore> GetConfigurations()
{
return new List<ConfigurationStore>
{
new ConfigurationStore
{
Key = "chapters",
ConfigurationType = typeof (ChapterOptions)
}
};
}
}
}

View File

@ -510,25 +510,19 @@ namespace MediaBrowser.Providers.Manager
Type = MetadataPluginType.LocalMetadataProvider
}));
if (item.IsInternetMetadataEnabled())
// Fetchers
list.AddRange(providers.Where(i => (i is IRemoteMetadataProvider)).Select(i => new MetadataPlugin
{
// Fetchers
list.AddRange(providers.Where(i => (i is IRemoteMetadataProvider)).Select(i => new MetadataPlugin
{
Name = i.Name,
Type = MetadataPluginType.MetadataFetcher
}));
}
Name = i.Name,
Type = MetadataPluginType.MetadataFetcher
}));
if (item.IsSaveLocalMetadataEnabled())
// Savers
list.AddRange(_savers.Where(i => IsSaverEnabledForItem(i, item, ItemUpdateType.MetadataEdit, true)).OrderBy(i => i.Name).Select(i => new MetadataPlugin
{
// Savers
list.AddRange(_savers.Where(i => IsSaverEnabledForItem(i, item, ItemUpdateType.MetadataEdit, true)).OrderBy(i => i.Name).Select(i => new MetadataPlugin
{
Name = i.Name,
Type = MetadataPluginType.MetadataSaver
}));
}
Name = i.Name,
Type = MetadataPluginType.MetadataSaver
}));
}
private void AddImagePlugins<T>(List<MetadataPlugin> list, T item, List<IImageProvider> imageProviders)

View File

@ -417,7 +417,7 @@ namespace MediaBrowser.Providers.MediaInfo
}
if (!string.IsNullOrWhiteSpace(data.Name))
{
if (string.IsNullOrWhiteSpace(video.Name) || string.Equals(video.Name, Path.GetFileNameWithoutExtension(video.Path), StringComparison.OrdinalIgnoreCase))
if (string.IsNullOrWhiteSpace(video.Name) || (string.Equals(video.Name, Path.GetFileNameWithoutExtension(video.Path), StringComparison.OrdinalIgnoreCase) && !video.ProviderIds.Any()))
{
// Don't use the embedded name for extras because it will often be the same name as the movie
if (!video.ExtraType.HasValue && !video.IsOwnedItem)

View File

@ -156,6 +156,9 @@
<Content Include="dashboard-ui\components\navdrawer\navdrawer.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\components\playerselection.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\components\remotecontrol.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>