mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-05 05:42:52 +01:00
Added some null checks and logging when parsing ffprobe output
This commit is contained in:
parent
b15c064bba
commit
863ca986bd
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Controller.Events;
|
||||
using MediaBrowser.Controller.FFMpeg;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@@ -47,6 +48,12 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
private void Fetch(Video video, FFProbeResult data)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
Logger.LogInfo("Null FFProbeResult for {0} {1}", video.Id, video.Name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(data.format.duration))
|
||||
{
|
||||
video.RunTimeTicks = TimeSpan.FromSeconds(double.Parse(data.format.duration)).Ticks;
|
||||
|
||||
Reference in New Issue
Block a user