1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-01-03 05:25:10 +00:00

Fixed: Task progress messages in the UI

(cherry picked from commit c6417337812f3578a27f9dc1e44fdad80f557271)

Closes #4689
This commit is contained in:
Mark McDowall 2024-03-18 16:48:35 -07:00 committed by Bogdan
parent 9f4d821a2d
commit e730cf6307
7 changed files with 19 additions and 8 deletions

View file

@ -137,7 +137,7 @@ private async Task<List<DownloadDecision>> Dispatch(Func<IIndexer, Task<IList<Re
var reports = batch.SelectMany(x => x).ToList();
_logger.Debug("Total of {0} reports were found for {1} from {2} indexers", reports.Count, criteriaBase, indexers.Count);
_logger.ProgressDebug("Total of {0} reports were found for {1} from {2} indexers", reports.Count, criteriaBase, indexers.Count);
// Update the last search time for all albums if at least 1 indexer was searched.
if (indexers.Any())

View file

@ -5,7 +5,6 @@ namespace NzbDrone.Core.Indexers
public class RssSyncCommand : Command
{
public override bool SendUpdatesToClient => true;
public override bool IsLongRunning => true;
}
}

View file

@ -23,7 +23,7 @@ public virtual bool SendUpdatesToClient
}
public virtual bool UpdateScheduledTask => true;
public virtual string CompletionMessage => "Completed";
public virtual string CompletionMessage => null;
public virtual bool RequiresDiskAccess => false;
public virtual bool IsExclusive => false;
public virtual bool IsTypeExclusive => false;

View file

@ -20,5 +20,7 @@ public RefreshAlbumCommand(int? albumId, bool isNewAlbum = false)
public override bool SendUpdatesToClient => true;
public override bool UpdateScheduledTask => !AlbumId.HasValue;
public override string CompletionMessage => "Completed";
}
}

View file

@ -39,5 +39,7 @@ public RefreshArtistCommand(List<int> artistIds, bool isNewArtist = false)
public override bool UpdateScheduledTask => ArtistIds.Empty();
public override bool IsLongRunning => true;
public override string CompletionMessage => "Completed";
}
}

View file

@ -1,10 +1,13 @@
using System;
using System;
using System.Threading;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.ProgressMessaging
{
public static class ProgressMessageContext
{
private static AsyncLocal<CommandModel> _commandModelAsync = new AsyncLocal<CommandModel>();
[ThreadStatic]
private static CommandModel _commandModel;
@ -13,8 +16,15 @@ public static class ProgressMessageContext
public static CommandModel CommandModel
{
get { return _commandModel; }
set { _commandModel = value; }
get
{
return _commandModel ?? _commandModelAsync.Value;
}
set
{
_commandModel = value;
_commandModelAsync.Value = value;
}
}
public static bool LockReentrancy()

View file

@ -6,7 +6,5 @@ public class ApplicationUpdateCommand : Command
{
public override bool SendUpdatesToClient => true;
public override bool IsExclusive => true;
public override string CompletionMessage => null;
}
}