mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-05 21:33:02 +02:00
fix video probing
This commit is contained in:
parent
3e9efeb44f
commit
84ec2aab95
|
@ -1624,14 +1624,19 @@ namespace MediaBrowser.Api.Playback
|
||||||
var archivable = item as IArchivable;
|
var archivable = item as IArchivable;
|
||||||
state.IsInputArchive = archivable != null && archivable.IsArchive;
|
state.IsInputArchive = archivable != null && archivable.IsArchive;
|
||||||
|
|
||||||
MediaSourceInfo mediaSource = null;
|
MediaSourceInfo mediaSource;
|
||||||
if (string.IsNullOrWhiteSpace(request.LiveStreamId))
|
if (string.IsNullOrWhiteSpace(request.LiveStreamId))
|
||||||
{
|
{
|
||||||
var mediaSources = await MediaSourceManager.GetPlayackMediaSources(request.Id, false, cancellationToken).ConfigureAwait(false);
|
var mediaSources = (await MediaSourceManager.GetPlayackMediaSources(request.Id, false, cancellationToken).ConfigureAwait(false)).ToList();
|
||||||
|
|
||||||
mediaSource = string.IsNullOrEmpty(request.MediaSourceId)
|
mediaSource = string.IsNullOrEmpty(request.MediaSourceId)
|
||||||
? mediaSources.First()
|
? mediaSources.First()
|
||||||
: mediaSources.First(i => string.Equals(i.Id, request.MediaSourceId));
|
: mediaSources.FirstOrDefault(i => string.Equals(i.Id, request.MediaSourceId));
|
||||||
|
|
||||||
|
if (mediaSource == null && string.Equals(request.Id, request.MediaSourceId, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
mediaSource = mediaSources.First();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
var options = GetOptions();
|
var options = GetOptions();
|
||||||
|
|
||||||
if (/*options.EnableThrottling &&*/ IsThrottleAllowed(_job, options.ThrottleThresholdSeconds))
|
if (options.EnableThrottling && IsThrottleAllowed(_job, options.ThrottleThresholdSeconds))
|
||||||
{
|
{
|
||||||
PauseTranscoding();
|
PauseTranscoding();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,11 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (data.format != null && !string.IsNullOrEmpty(data.format.duration))
|
||||||
|
{
|
||||||
|
info.RunTimeTicks = TimeSpan.FromSeconds(double.Parse(data.format.duration, _usCulture)).Ticks;
|
||||||
|
}
|
||||||
|
|
||||||
FetchWtvInfo(info, data);
|
FetchWtvInfo(info, data);
|
||||||
|
|
||||||
if (data.Chapters != null)
|
if (data.Chapters != null)
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
"HeaderSplitMedia": "Split Media Apart",
|
"HeaderSplitMedia": "Split Media Apart",
|
||||||
"MessageConfirmSplitMedia": "Are you sure you wish to split the media sources into separate items?",
|
"MessageConfirmSplitMedia": "Are you sure you wish to split the media sources into separate items?",
|
||||||
"HeaderError": "Error",
|
"HeaderError": "Error",
|
||||||
|
"MessageChromecastConnectionError": "Your Chromecast receiver is unable to connect to your Emby Server. Please check their connections and try again.",
|
||||||
"MessagePleaseSelectOneItem": "Please select at least one item.",
|
"MessagePleaseSelectOneItem": "Please select at least one item.",
|
||||||
"MessagePleaseSelectTwoItems": "Please select at least two items.",
|
"MessagePleaseSelectTwoItems": "Please select at least two items.",
|
||||||
"MessageTheFollowingItemsWillBeGrouped": "The following titles will be grouped into one item:",
|
"MessageTheFollowingItemsWillBeGrouped": "The following titles will be grouped into one item:",
|
||||||
|
|
|
@ -51,8 +51,10 @@ namespace XmlRpcHandler
|
||||||
XmlWriterSettings sett = new XmlWriterSettings();
|
XmlWriterSettings sett = new XmlWriterSettings();
|
||||||
sett.Indent = true;
|
sett.Indent = true;
|
||||||
|
|
||||||
|
var requestXmlPath = Path.Combine(Path.GetTempPath(), "request.xml");
|
||||||
|
|
||||||
sett.Encoding = Encoding.UTF8;
|
sett.Encoding = Encoding.UTF8;
|
||||||
FileStream str = new FileStream(Path.GetTempPath() + "\\request.xml", FileMode.Create, FileAccess.Write);
|
FileStream str = new FileStream(requestXmlPath, FileMode.Create, FileAccess.Write);
|
||||||
|
|
||||||
XmlWriter XMLwrt = XmlWriter.Create(str, sett);
|
XmlWriter XMLwrt = XmlWriter.Create(str, sett);
|
||||||
// Let's write the methods
|
// Let's write the methods
|
||||||
|
@ -88,7 +90,7 @@ namespace XmlRpcHandler
|
||||||
XMLwrt.Flush();
|
XMLwrt.Flush();
|
||||||
XMLwrt.Close();
|
XMLwrt.Close();
|
||||||
str.Close();
|
str.Close();
|
||||||
string requestContent = File.ReadAllText(Path.GetTempPath() + "\\request.xml");
|
string requestContent = File.ReadAllText(requestXmlPath);
|
||||||
return Encoding.UTF8.GetBytes(requestContent);
|
return Encoding.UTF8.GetBytes(requestContent);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue