1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-28 10:48:46 +00:00
Sonarr/NzbDrone.Core/Model/Sabnzbd/SabQueueItem.cs
Mark McDowall c4b57c4a23 Fixed: SABnzbd queue checking will not fail when items in queue are being repaired.
SabQueue priority is parsed with a custom converter to prevent blowing up because SAB decides to use Repair as a queue priority type.
2012-05-19 13:07:30 -07:00

50 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using NzbDrone.Core.Helpers;
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabQueueItem
{
public string Status { get; set; }
public int Index { get; set; }
[JsonConverter(typeof(SabnzbdQueueTimeConverter))]
public TimeSpan Timeleft { get; set; }
[JsonProperty(PropertyName = "mb")]
public decimal Size { get; set; }
private string _title;
[JsonProperty(PropertyName = "filename")]
public string Title
{
get { return _title; }
set
{
_title = value;
ParseResult = Parser.ParseTitle(value.Replace("DUPLICATE / ", String.Empty));
}
}
[JsonConverter(typeof(SabnzbdPriorityTypeConverter))]
public SabPriorityType Priority { get; set; }
[JsonProperty(PropertyName = "cat")]
public string Category { get; set; }
[JsonProperty(PropertyName = "mbleft")]
public decimal SizeLeft { get; set; }
public int Percentage { get; set; }
[JsonProperty(PropertyName = "nzo_id")]
public string Id { get; set; }
public EpisodeParseResult ParseResult { private set; get; }
}
}