shorten image task delay
This commit is contained in:
parent
99959f5d10
commit
3fc0b768d1
|
@ -46,7 +46,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
private readonly List<Audio> _newlyAddedItems = new List<Audio>();
|
private readonly List<Audio> _newlyAddedItems = new List<Audio>();
|
||||||
|
|
||||||
private const int NewItemDelay = 300000;
|
private const int NewItemDelay = 60000;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current new item timer
|
/// The current new item timer
|
||||||
|
@ -118,7 +118,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
foreach (var item in newSongs
|
foreach (var item in newSongs
|
||||||
.Where(i => i.LocationType == LocationType.FileSystem && string.IsNullOrEmpty(i.PrimaryImagePath) && i.MediaStreams.Any(m => m.Type == MediaStreamType.Video))
|
.Where(i => i.LocationType == LocationType.FileSystem && string.IsNullOrEmpty(i.PrimaryImagePath) && i.MediaStreams.Any(m => m.Type == MediaStreamType.Video))
|
||||||
.Take(20))
|
.Take(10))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -216,7 +216,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
var filename = item.Album ?? string.Empty;
|
var filename = item.Album ?? string.Empty;
|
||||||
|
|
||||||
filename += album == null ? item.Id.ToString("N") + item.DateModified.Ticks : album.Id.ToString() + album.DateModified.Ticks;
|
filename += album == null ? item.Id.ToString("N") + item.DateModified.Ticks : album.Id.ToString("N") + album.DateModified.Ticks;
|
||||||
|
|
||||||
var path = ImageCache.GetResourcePath(filename + "_primary", ".jpg");
|
var path = ImageCache.GetResourcePath(filename + "_primary", ".jpg");
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _mediaEncoder.ExtractImage(new[] {item.Path}, InputType.AudioFile, null, path, cancellationToken).ConfigureAwait(false);
|
await _mediaEncoder.ExtractImage(new[] { item.Path }, InputType.AudioFile, null, path, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
private readonly List<Video> _newlyAddedItems = new List<Video>();
|
private readonly List<Video> _newlyAddedItems = new List<Video>();
|
||||||
|
|
||||||
private const int NewItemDelay = 300000;
|
private const int NewItemDelay = 60000;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current new item timer
|
/// The current new item timer
|
||||||
|
@ -95,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
foreach (var item in newItems
|
foreach (var item in newItems
|
||||||
.Where(i => i.LocationType == LocationType.FileSystem && string.IsNullOrEmpty(i.PrimaryImagePath) && i.MediaStreams.Any(m => m.Type == MediaStreamType.Video))
|
.Where(i => i.LocationType == LocationType.FileSystem && string.IsNullOrEmpty(i.PrimaryImagePath) && i.MediaStreams.Any(m => m.Type == MediaStreamType.Video))
|
||||||
.Take(5))
|
.Take(1))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
using MediaBrowser.Common.ScheduledTasks;
|
using MediaBrowser.Common.ScheduledTasks;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.Tasks;
|
using MediaBrowser.Model.Tasks;
|
||||||
|
using MediaBrowser.Server.Implementations.Library;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Server.Implementations.Library;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
private readonly List<BaseItem> _newlyAddedItems = new List<BaseItem>();
|
private readonly List<BaseItem> _newlyAddedItems = new List<BaseItem>();
|
||||||
|
|
||||||
private const int NewItemDelay = 300000;
|
private const int NewItemDelay = 60000;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current new item timer
|
/// The current new item timer
|
||||||
|
@ -124,7 +124,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
NewItemTimer = null;
|
NewItemTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in GetItemsForExtraction(newItems.Take(5)))
|
foreach (var item in GetItemsForExtraction(newItems.Take(3)))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -215,7 +215,8 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
var videos = allItems.OfType<Video>().ToList();
|
var videos = allItems.OfType<Video>().ToList();
|
||||||
|
|
||||||
var items = videos;
|
var items = videos.ToList();
|
||||||
|
|
||||||
items.AddRange(localTrailers);
|
items.AddRange(localTrailers);
|
||||||
|
|
||||||
items.AddRange(themeVideos);
|
items.AddRange(themeVideos);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user