mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-03 22:57:18 +02:00
New: Added column in Queue
(cherry picked from commit 57445bbe57a84990e284ef97d42455a06587e1ee) Closes #9621
This commit is contained in:
parent
3e55b1cf25
commit
c2d8bc85d0
@ -97,6 +97,7 @@ class QueueRow extends Component {
|
||||
outputPath,
|
||||
downloadClient,
|
||||
estimatedCompletionTime,
|
||||
added,
|
||||
timeleft,
|
||||
size,
|
||||
sizeleft,
|
||||
@ -315,6 +316,15 @@ class QueueRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'added') {
|
||||
return (
|
||||
<RelativeDateCellConnector
|
||||
key={name}
|
||||
date={added}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'actions') {
|
||||
return (
|
||||
<TableRowCell
|
||||
@ -393,6 +403,7 @@ QueueRow.propTypes = {
|
||||
outputPath: PropTypes.string,
|
||||
downloadClient: PropTypes.string,
|
||||
estimatedCompletionTime: PropTypes.string,
|
||||
added: PropTypes.string,
|
||||
timeleft: PropTypes.string,
|
||||
size: PropTypes.number,
|
||||
year: PropTypes.number,
|
||||
|
@ -147,6 +147,12 @@ export const defaultState = {
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'added',
|
||||
label: () => translate('Added'),
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'progress',
|
||||
label: () => translate('Progress'),
|
||||
|
@ -28,6 +28,7 @@ interface Queue extends ModelBase {
|
||||
sizeleft: number;
|
||||
timeleft: string;
|
||||
estimatedCompletionTime: string;
|
||||
added?: string;
|
||||
status: string;
|
||||
trackedDownloadStatus: QueueTrackedDownloadStatus;
|
||||
trackedDownloadState: QueueTrackedDownloadState;
|
||||
|
@ -203,6 +203,7 @@ public List<RemoteMovie> GetPendingRemoteMovies(int movieId)
|
||||
RemoteMovie = pendingRelease.RemoteMovie,
|
||||
Timeleft = timeleft,
|
||||
EstimatedCompletionTime = ect,
|
||||
Added = pendingRelease.Added,
|
||||
Status = pendingRelease.Reason.ToString(),
|
||||
Protocol = pendingRelease.RemoteMovie.Release.DownloadProtocol,
|
||||
Indexer = pendingRelease.RemoteMovie.Release.Indexer
|
||||
|
@ -15,6 +15,7 @@ public class TrackedDownload
|
||||
public TrackedDownloadStatusMessage[] StatusMessages { get; private set; }
|
||||
public DownloadProtocol Protocol { get; set; }
|
||||
public string Indexer { get; set; }
|
||||
public DateTime? Added { get; set; }
|
||||
public bool IsTrackable { get; set; }
|
||||
public bool HasNotifiedManualInteractionRequired { get; set; }
|
||||
|
||||
|
@ -141,6 +141,7 @@ public TrackedDownload TrackDownload(DownloadClientDefinition downloadClient, Do
|
||||
var grabbedEvent = historyItems.FirstOrDefault(v => v.EventType == MovieHistoryEventType.Grabbed);
|
||||
|
||||
trackedDownload.Indexer = grabbedEvent?.Data["indexer"];
|
||||
trackedDownload.Added = grabbedEvent?.Date;
|
||||
|
||||
if (parsedMovieInfo == null ||
|
||||
trackedDownload.RemoteMovie == null ||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace NzbDrone.Core.Queue
|
||||
{
|
||||
public class EstimatedCompletionTimeComparer : IComparer<DateTime?>
|
||||
public class DatetimeComparer : IComparer<DateTime?>
|
||||
{
|
||||
public int Compare(DateTime? x, DateTime? y)
|
||||
{
|
@ -20,6 +20,7 @@ public class Queue : ModelBase
|
||||
public decimal Sizeleft { get; set; }
|
||||
public TimeSpan? Timeleft { get; set; }
|
||||
public DateTime? EstimatedCompletionTime { get; set; }
|
||||
public DateTime? Added { get; set; }
|
||||
public string Status { get; set; }
|
||||
public TrackedDownloadStatus? TrackedDownloadStatus { get; set; }
|
||||
public TrackedDownloadState? TrackedDownloadState { get; set; }
|
||||
|
@ -75,7 +75,8 @@ private Queue MapMovie(TrackedDownload trackedDownload, Movie movie)
|
||||
Movie = movie,
|
||||
DownloadClient = trackedDownload.DownloadItem.DownloadClientInfo.Name,
|
||||
Indexer = trackedDownload.Indexer,
|
||||
OutputPath = trackedDownload.DownloadItem.OutputPath.ToString()
|
||||
OutputPath = trackedDownload.DownloadItem.OutputPath.ToString(),
|
||||
Added = trackedDownload.Added
|
||||
};
|
||||
|
||||
queue.Id = HashConverter.GetHashInt31($"trackedDownload-{trackedDownload.DownloadClient}-{trackedDownload.DownloadItem.DownloadId}");
|
||||
|
@ -188,9 +188,16 @@ public PagingResource<QueueResource> GetQueue([FromQuery] PagingRequestResource
|
||||
else if (pagingSpec.SortKey == "estimatedCompletionTime")
|
||||
{
|
||||
ordered = ascending
|
||||
? fullQueue.OrderBy(q => q.EstimatedCompletionTime, new EstimatedCompletionTimeComparer())
|
||||
? fullQueue.OrderBy(q => q.EstimatedCompletionTime, new DatetimeComparer())
|
||||
: fullQueue.OrderByDescending(q => q.EstimatedCompletionTime,
|
||||
new EstimatedCompletionTimeComparer());
|
||||
new DatetimeComparer());
|
||||
}
|
||||
else if (pagingSpec.SortKey == "added")
|
||||
{
|
||||
ordered = ascending
|
||||
? fullQueue.OrderBy(q => q.Added, new DatetimeComparer())
|
||||
: fullQueue.OrderByDescending(q => q.Added,
|
||||
new DatetimeComparer());
|
||||
}
|
||||
else if (pagingSpec.SortKey == "protocol")
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ public class QueueResource : RestResource
|
||||
public decimal Sizeleft { get; set; }
|
||||
public TimeSpan? Timeleft { get; set; }
|
||||
public DateTime? EstimatedCompletionTime { get; set; }
|
||||
public DateTime? Added { get; set; }
|
||||
public string Status { get; set; }
|
||||
public TrackedDownloadStatus? TrackedDownloadStatus { get; set; }
|
||||
public TrackedDownloadState? TrackedDownloadState { get; set; }
|
||||
@ -63,6 +64,7 @@ public static QueueResource ToResource(this NzbDrone.Core.Queue.Queue model, boo
|
||||
Sizeleft = model.Sizeleft,
|
||||
Timeleft = model.Timeleft,
|
||||
EstimatedCompletionTime = model.EstimatedCompletionTime,
|
||||
Added = model.Added,
|
||||
Status = model.Status.FirstCharToLower(),
|
||||
TrackedDownloadStatus = model.TrackedDownloadStatus,
|
||||
TrackedDownloadState = model.TrackedDownloadState,
|
||||
|
Loading…
Reference in New Issue
Block a user