mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
fixed ffprobe running over and over
This commit is contained in:
parent
3ee73bb7c2
commit
2d9b48d00f
@ -180,7 +180,7 @@ namespace MediaBrowser.Api
|
||||
|
||||
if (job.ActiveRequestCount == 0)
|
||||
{
|
||||
var timerDuration = type == TranscodingJobType.Progressive ? 1000 : 60000;
|
||||
var timerDuration = type == TranscodingJobType.Progressive ? 1000 : 180000;
|
||||
|
||||
if (job.KillTimer == null)
|
||||
{
|
||||
|
@ -385,7 +385,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var extensions = FileStampExtensionsDictionary;
|
||||
var numExtensions = extensions.Count;
|
||||
var numExtensions = FilestampExtensions.Length;
|
||||
|
||||
// Record the name of each file
|
||||
// Need to sort these because accoring to msdn docs, our i/o methods are not guaranteed in any order
|
||||
|
@ -83,7 +83,7 @@ namespace MediaBrowser.Controller.Session
|
||||
/// </summary>
|
||||
/// <value>The name of the now viewing item.</value>
|
||||
public string NowViewingItemName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the now playing item.
|
||||
/// </summary>
|
||||
@ -107,7 +107,7 @@ namespace MediaBrowser.Controller.Session
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value>
|
||||
public bool IsMuted { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the device id.
|
||||
/// </summary>
|
||||
@ -139,7 +139,7 @@ namespace MediaBrowser.Controller.Session
|
||||
return WebSockets.Any(i => i.State == WebSocketState.Open);
|
||||
}
|
||||
|
||||
return (DateTime.UtcNow - LastActivityDate).TotalMinutes <= 5;
|
||||
return (DateTime.UtcNow - LastActivityDate).TotalMinutes <= 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,6 +178,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
}
|
||||
}
|
||||
|
||||
SetLastRefreshed(item, DateTime.UtcNow);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -58,7 +59,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { });
|
||||
|
||||
// Set last refreshed so that the provider doesn't trigger after the file save
|
||||
PersonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -70,7 +71,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { });
|
||||
|
||||
// Set last refreshed so that the provider doesn't trigger after the file save
|
||||
ArtistProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -57,7 +58,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { });
|
||||
|
||||
BoxSetProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -87,7 +88,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new[]
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>
|
||||
{
|
||||
"FirstAired",
|
||||
"SeasonNumber",
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
@ -77,7 +78,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { });
|
||||
|
||||
FolderProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Providers.Movies;
|
||||
@ -66,7 +67,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
if (!string.IsNullOrEmpty(game.GameSystem))
|
||||
{
|
||||
builder.Append("<GameSystem><![CDATA[" + game.GameSystem + "]]></GameSystem>");
|
||||
builder.Append("<GameSystem>" + SecurityElement.Escape(game.GameSystem) + "</GameSystem>");
|
||||
}
|
||||
|
||||
XmlSaverHelpers.AddCommonNodes(item, builder);
|
||||
@ -75,7 +76,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new[]
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>
|
||||
{
|
||||
"Players",
|
||||
"GameSystem"
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -103,7 +104,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new[]
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>
|
||||
{
|
||||
"IMDBrating",
|
||||
"Description",
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Security;
|
||||
using System.Collections.Generic;
|
||||
using System.Security;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Providers.Movies;
|
||||
@ -57,7 +58,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new[]
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>
|
||||
{
|
||||
"PlaceOfBirth"
|
||||
});
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
@ -57,7 +58,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new string[] { });
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { });
|
||||
|
||||
SeasonProviderFromXml.Current.SetLastRefreshed(item, DateTime.UtcNow);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -105,7 +106,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
|
||||
var xmlFilePath = GetSavePath(item);
|
||||
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new[]
|
||||
XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>
|
||||
{
|
||||
"id",
|
||||
"SeriesName",
|
||||
|
@ -29,13 +29,11 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <param name="xml">The XML.</param>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="xmlTagsUsed">The XML tags used.</param>
|
||||
public static void Save(StringBuilder xml, string path, IEnumerable<string> xmlTagsUsed)
|
||||
public static void Save(StringBuilder xml, string path, List<string> xmlTagsUsed)
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var tags = xmlTagsUsed.ToList();
|
||||
|
||||
tags.AddRange(new[]
|
||||
xmlTagsUsed.AddRange(new[]
|
||||
{
|
||||
"MediaInfo",
|
||||
"ContentRating",
|
||||
@ -88,7 +86,7 @@ namespace MediaBrowser.Providers.Savers
|
||||
});
|
||||
|
||||
var position = xml.ToString().LastIndexOf("</", StringComparison.OrdinalIgnoreCase);
|
||||
xml.Insert(position, GetCustomTags(path, tags));
|
||||
xml.Insert(position, GetCustomTags(path, xmlTagsUsed));
|
||||
}
|
||||
|
||||
var xmlDocument = new XmlDocument();
|
||||
@ -142,17 +140,46 @@ namespace MediaBrowser.Providers.Savers
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="xmlTagsUsed">The XML tags used.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private static string GetCustomTags(string path, ICollection<string> xmlTagsUsed)
|
||||
private static string GetCustomTags(string path, IEnumerable<string> xmlTagsUsed)
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.Load(path);
|
||||
var settings = new XmlReaderSettings
|
||||
{
|
||||
CheckCharacters = false,
|
||||
IgnoreProcessingInstructions = true,
|
||||
IgnoreComments = true,
|
||||
ValidationType = ValidationType.None
|
||||
};
|
||||
|
||||
var nodes = doc.DocumentElement.ChildNodes.Cast<XmlNode>()
|
||||
.Where(i => !xmlTagsUsed.Contains(i.Name))
|
||||
.Select(i => i.OuterXml)
|
||||
.ToArray();
|
||||
var tagsDictionary = xmlTagsUsed.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
return string.Join(Environment.NewLine, nodes);
|
||||
var builder = new StringBuilder();
|
||||
|
||||
using (var streamReader = new StreamReader(path, Encoding.UTF8))
|
||||
{
|
||||
// Use XmlReader for best performance
|
||||
using (var reader = XmlReader.Create(streamReader, settings))
|
||||
{
|
||||
reader.MoveToContent();
|
||||
|
||||
// Loop through each element
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.NodeType == XmlNodeType.Element)
|
||||
{
|
||||
if (!tagsDictionary.ContainsKey(reader.Name))
|
||||
{
|
||||
builder.AppendLine(reader.ReadOuterXml());
|
||||
}
|
||||
else
|
||||
{
|
||||
reader.Skip();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -57,7 +57,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
||||
/// <summary>
|
||||
/// The FF probe resource pool
|
||||
/// </summary>
|
||||
private readonly SemaphoreSlim _ffProbeResourcePool = new SemaphoreSlim(2, 2);
|
||||
private readonly SemaphoreSlim _ffProbeResourcePool = new SemaphoreSlim(1, 1);
|
||||
|
||||
public string FFMpegPath { get; private set; }
|
||||
|
||||
|
@ -159,6 +159,10 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||
{
|
||||
previouslyFailedImages = new List<string>();
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
previouslyFailedImages = new List<string>();
|
||||
}
|
||||
|
||||
foreach (var video in videos)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user