mirror of https://github.com/jellyfin/jellyfin.git
update sync task
This commit is contained in:
parent
63fe0239e3
commit
52a42229cd
|
@ -170,6 +170,17 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
|
||||||
QueueScheduledTask<T>(new TaskExecutionOptions());
|
QueueScheduledTask<T>(new TaskExecutionOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void QueueIfNotRunning<T>()
|
||||||
|
where T : IScheduledTask
|
||||||
|
{
|
||||||
|
var task = ScheduledTasks.First(t => t.ScheduledTask.GetType() == typeof(T));
|
||||||
|
|
||||||
|
if (task.State != TaskState.Running)
|
||||||
|
{
|
||||||
|
QueueScheduledTask<T>(new TaskExecutionOptions());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Execute<T>()
|
public void Execute<T>()
|
||||||
where T : IScheduledTask
|
where T : IScheduledTask
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,6 +50,9 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||||
void QueueScheduledTask<T>()
|
void QueueScheduledTask<T>()
|
||||||
where T : IScheduledTask;
|
where T : IScheduledTask;
|
||||||
|
|
||||||
|
void QueueIfNotRunning<T>()
|
||||||
|
where T : IScheduledTask;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Queues the scheduled task.
|
/// Queues the scheduled task.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -979,12 +979,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.HasOverview.HasValue)
|
|
||||||
{
|
|
||||||
Logger.Debug("Query requires post-filtering due to HasOverview");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (query.HasImdbId.HasValue)
|
if (query.HasImdbId.HasValue)
|
||||||
{
|
{
|
||||||
Logger.Debug("Query requires post-filtering due to HasImdbId");
|
Logger.Debug("Query requires post-filtering due to HasImdbId");
|
||||||
|
@ -1078,13 +1072,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply official rating filter
|
|
||||||
if (query.OfficialRatings.Length > 0)
|
|
||||||
{
|
|
||||||
Logger.Debug("Query requires post-filtering due to OfficialRatings");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply person filter
|
// Apply person filter
|
||||||
if (query.ItemIdsFromPersonFilters != null)
|
if (query.ItemIdsFromPersonFilters != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2080,6 +2080,18 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (query.HasOverview.HasValue)
|
||||||
|
{
|
||||||
|
if (query.HasOverview.Value)
|
||||||
|
{
|
||||||
|
whereClauses.Add("(Overview not null AND Overview<>'')");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
whereClauses.Add("(Overview is null OR Overview='')");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (query.HasDeadParentId.HasValue)
|
if (query.HasDeadParentId.HasValue)
|
||||||
{
|
{
|
||||||
if (query.HasDeadParentId.Value)
|
if (query.HasDeadParentId.Value)
|
||||||
|
|
|
@ -641,6 +641,8 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||||
ReadInputAtNativeFramerate = !syncOptions.EnableFullSpeedTranscoding
|
ReadInputAtNativeFramerate = !syncOptions.EnableFullSpeedTranscoding
|
||||||
|
|
||||||
}, innerProgress, cancellationToken);
|
}, innerProgress, cancellationToken);
|
||||||
|
|
||||||
|
_syncManager.OnConversionComplete(jobItem, job);
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
{
|
{
|
||||||
|
@ -825,6 +827,8 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||||
CpuCoreLimit = syncOptions.TranscodingCpuCoreLimit
|
CpuCoreLimit = syncOptions.TranscodingCpuCoreLimit
|
||||||
|
|
||||||
}, innerProgress, cancellationToken);
|
}, innerProgress, cancellationToken);
|
||||||
|
|
||||||
|
_syncManager.OnConversionComplete(jobItem, job);
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1325,5 +1325,16 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected internal void OnConversionComplete(SyncJobItem item, SyncJob job)
|
||||||
|
{
|
||||||
|
var syncProvider = GetSyncProvider(item, job);
|
||||||
|
if (syncProvider is AppSyncProvider)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_taskManager.QueueIfNotRunning<ServerSyncScheduledTask>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue