mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-23 21:47:14 -04:00
fix video probing
This commit is contained in:
parent
3e9efeb44f
commit
84ec2aab95
5 changed files with 19 additions and 6 deletions
|
@ -1624,14 +1624,19 @@ namespace MediaBrowser.Api.Playback
|
|||
var archivable = item as IArchivable;
|
||||
state.IsInputArchive = archivable != null && archivable.IsArchive;
|
||||
|
||||
MediaSourceInfo mediaSource = null;
|
||||
MediaSourceInfo mediaSource;
|
||||
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)
|
||||
? 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
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace MediaBrowser.Api.Playback
|
|||
|
||||
var options = GetOptions();
|
||||
|
||||
if (/*options.EnableThrottling &&*/ IsThrottleAllowed(_job, options.ThrottleThresholdSeconds))
|
||||
if (options.EnableThrottling && IsThrottleAllowed(_job, options.ThrottleThresholdSeconds))
|
||||
{
|
||||
PauseTranscoding();
|
||||
}
|
||||
|
|
|
@ -63,6 +63,11 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
}
|
||||
else
|
||||
{
|
||||
if (data.format != null && !string.IsNullOrEmpty(data.format.duration))
|
||||
{
|
||||
info.RunTimeTicks = TimeSpan.FromSeconds(double.Parse(data.format.duration, _usCulture)).Ticks;
|
||||
}
|
||||
|
||||
FetchWtvInfo(info, data);
|
||||
|
||||
if (data.Chapters != null)
|
||||
|
|
|
@ -199,6 +199,7 @@
|
|||
"HeaderSplitMedia": "Split Media Apart",
|
||||
"MessageConfirmSplitMedia": "Are you sure you wish to split the media sources into separate items?",
|
||||
"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.",
|
||||
"MessagePleaseSelectTwoItems": "Please select at least two items.",
|
||||
"MessageTheFollowingItemsWillBeGrouped": "The following titles will be grouped into one item:",
|
||||
|
|
|
@ -51,8 +51,10 @@ namespace XmlRpcHandler
|
|||
XmlWriterSettings sett = new XmlWriterSettings();
|
||||
sett.Indent = true;
|
||||
|
||||
var requestXmlPath = Path.Combine(Path.GetTempPath(), "request.xml");
|
||||
|
||||
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);
|
||||
// Let's write the methods
|
||||
|
@ -88,7 +90,7 @@ namespace XmlRpcHandler
|
|||
XMLwrt.Flush();
|
||||
XMLwrt.Close();
|
||||
str.Close();
|
||||
string requestContent = File.ReadAllText(Path.GetTempPath() + "\\request.xml");
|
||||
string requestContent = File.ReadAllText(requestXmlPath);
|
||||
return Encoding.UTF8.GetBytes(requestContent);
|
||||
}
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue