SabProvider now gets JSON instead of XML for history and queue.

This commit is contained in:
Mark McDowall 2012-01-18 20:05:03 -08:00
commit b4eed1a657
25 changed files with 503 additions and 6505 deletions

View file

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Model
{
public class SabQueueItem
{
public string Id { get; set; }
public string Title { get; set; }
}
}

View file

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace NzbDrone.Core.Model
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabnzbdCategoryModel
public class SabCategoryModel
{
public List<string> categories { get; set; }
}

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabHistory
{
public bool Paused { get; set; }
[JsonProperty(PropertyName = "slots")]
public List<SabHistoryItem> Items { get; set; }
}
}

View file

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabHistoryItem
{
[JsonProperty(PropertyName = "fail_message")]
public string FailMessage { get; set; }
public string Size { get; set; }
public string Category { get; set; }
[JsonProperty(PropertyName = "nzb_name")]
public string NzbName { get; set; }
[JsonProperty(PropertyName = "download_time")]
public int DownloadTime { get; set; }
public string Storage { get; set; }
public string Status { get; set; }
[JsonProperty(PropertyName = "nzo_id")]
public string Id { get; set; }
[JsonProperty(PropertyName = "name")]
public string Title { get; set; }
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabJsonError
{
public string Status { get; set; }
public string Error { get; set; }
}
}

View file

@ -1,6 +1,6 @@
namespace NzbDrone.Core.Model
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabnzbdInfoModel
public class SabModel
{
public string Host { get; set; }
public int Port { get; set; }

View file

@ -1,6 +1,6 @@
namespace NzbDrone.Core.Model
namespace NzbDrone.Core.Model.Sabnzbd
{
public enum SabnzbdPriorityType
public enum SabPriorityType
{
Default = -100,
Paused = -2,

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabQueue
{
public bool Paused { get; set; }
[JsonProperty(PropertyName = "slots")]
public List<SabQueueItem> Items { get; set; }
}
}

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace NzbDrone.Core.Model.Sabnzbd
{
public class SabQueueItem
{
public string Status { get; set; }
public int Index { get; set; }
public TimeSpan Timeleft { get; set; }
[JsonProperty(PropertyName = "mb")]
public decimal Size { get; set; }
[JsonProperty(PropertyName = "filename")]
public string Title { get; set; }
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; }
}
}