Don't generate TrickPlay images for files that don't exist (#11653)

This commit is contained in:
Bond-009 2024-05-16 01:26:42 +02:00 committed by GitHub
parent a5d60c4521
commit c1615419b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -121,6 +121,13 @@ public class TrickplayManager : ITrickplayManager
return;
}
var mediaPath = mediaSource.Path;
if (!File.Exists(mediaPath))
{
_logger.LogWarning("Media source {MediaSourceId} not found at {Path} for item {ItemID}", mediaSource.Id, mediaPath, video.Id);
return;
}
// The width has to be even, otherwise a lot of filters will not be able to sample it
var actualWidth = 2 * (width / 2);
@ -139,7 +146,6 @@ public class TrickplayManager : ITrickplayManager
return;
}
var mediaPath = mediaSource.Path;
var mediaStream = mediaSource.VideoStream;
var container = mediaSource.Container;