mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 14:33:06 +03:00
add mark for removal options
This commit is contained in:
@@ -684,5 +684,41 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
|
||||
await processor.UpdateJobStatus(jobItem.JobId).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task MarkJobItemForRemoval(string id)
|
||||
{
|
||||
var jobItem = _repo.GetJobItem(id);
|
||||
|
||||
if (jobItem.Status != SyncJobItemStatus.Synced)
|
||||
{
|
||||
throw new ArgumentException("Operation is not valid for this job item");
|
||||
}
|
||||
|
||||
jobItem.IsMarkedForRemoval = true;
|
||||
|
||||
await _repo.Update(jobItem).ConfigureAwait(false);
|
||||
|
||||
var processor = GetSyncJobProcessor();
|
||||
|
||||
await processor.UpdateJobStatus(jobItem.JobId).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task UnmarkJobItemForRemoval(string id)
|
||||
{
|
||||
var jobItem = _repo.GetJobItem(id);
|
||||
|
||||
if (jobItem.Status != SyncJobItemStatus.Synced)
|
||||
{
|
||||
throw new ArgumentException("Operation is not valid for this job item");
|
||||
}
|
||||
|
||||
jobItem.IsMarkedForRemoval = false;
|
||||
|
||||
await _repo.Update(jobItem).ConfigureAwait(false);
|
||||
|
||||
var processor = GetSyncJobProcessor();
|
||||
|
||||
await processor.UpdateJobStatus(jobItem.JobId).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user