mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
update
This commit is contained in:
parent
6c649a7e72
commit
d448cc18ea
@ -128,6 +128,7 @@ public class TrickplayController : BaseJellyfinApiController
|
||||
var layout = tilesInfo.TileWidth.ToString(CultureInfo.InvariantCulture) + "x" + tilesInfo.TileHeight.ToString(CultureInfo.InvariantCulture);
|
||||
var tilesPerGrid = tilesInfo.TileWidth * tilesInfo.TileHeight;
|
||||
var tileDuration = (decimal)tilesInfo.Interval / 1000;
|
||||
var infDuration = tileDuration * tilesPerGrid;
|
||||
var tileGridCount = (int)Math.Ceiling((decimal)tilesInfo.TileCount / tilesPerGrid);
|
||||
|
||||
builder.AppendLine("#EXTM3U");
|
||||
@ -144,9 +145,9 @@ public class TrickplayController : BaseJellyfinApiController
|
||||
if (i == tileGridCount - 1)
|
||||
{
|
||||
tilesPerGrid = tilesInfo.TileCount - (i * tilesPerGrid);
|
||||
infDuration = tileDuration * tilesPerGrid;
|
||||
}
|
||||
|
||||
var infDuration = tileDuration * tilesPerGrid;
|
||||
var url = string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
urlFormat,
|
||||
|
@ -127,7 +127,7 @@ namespace MediaBrowser.Providers.Trickplay
|
||||
|
||||
// Create tiles
|
||||
var tilesTempDir = Path.Combine(imgTempDir, Guid.NewGuid().ToString("N"));
|
||||
var tilesInfo = CreateTiles(images, width, interval, tileWidth, tileHeight, tilesTempDir, outputDir);
|
||||
var tilesInfo = CreateTiles(images, width, interval, tileWidth, tileHeight, 100/* todo _config.JpegQuality*/, tilesTempDir, outputDir);
|
||||
|
||||
// Save tiles info
|
||||
try
|
||||
@ -166,7 +166,7 @@ namespace MediaBrowser.Providers.Trickplay
|
||||
}
|
||||
}
|
||||
|
||||
private TrickplayTilesInfo CreateTiles(List<FileSystemMetadata> images, int width, int interval, int tileWidth, int tileHeight, string workDir, string outputDir)
|
||||
private TrickplayTilesInfo CreateTiles(List<FileSystemMetadata> images, int width, int interval, int tileWidth, int tileHeight, int quality, string workDir, string outputDir)
|
||||
{
|
||||
if (images.Count == 0)
|
||||
{
|
||||
@ -244,7 +244,7 @@ namespace MediaBrowser.Providers.Trickplay
|
||||
var tileGridPath = Path.Combine(workDir, $"{imgNo}.jpg");
|
||||
using (var stream = File.OpenWrite(tileGridPath))
|
||||
{
|
||||
tileGrid.Encode(stream, SKEncodedImageFormat.Jpeg, 100/* todo _config.JpegQuality*/);
|
||||
tileGrid.Encode(stream, SKEncodedImageFormat.Jpeg, quality);
|
||||
}
|
||||
|
||||
var bitrate = (int)Math.Ceiling((decimal)new FileInfo(tileGridPath).Length * 8 / tilesInfo.TileWidth / tilesInfo.TileHeight / (tilesInfo.Interval / 1000));
|
||||
|
@ -107,14 +107,12 @@ namespace MediaBrowser.Providers.Trickplay
|
||||
|
||||
if (options.IsAutomated && !enableDuringScan.GetValueOrDefault(false))
|
||||
{
|
||||
_logger.LogDebug("exit refresh: automated - {0} enable scan - {1}", options.IsAutomated, enableDuringScan.GetValueOrDefault(false));
|
||||
return ItemUpdateType.None;
|
||||
}
|
||||
|
||||
// TODO: this is always blocking for metadata collection, make non-blocking option
|
||||
if (true)
|
||||
{
|
||||
_logger.LogDebug("called refresh");
|
||||
await _trickplayManager.RefreshTrickplayData(video, replace, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user