mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Nzbget support added to core
#ND-145 In Progress
This commit is contained in:
parent
0b9a4e1a46
commit
bf2c811a09
22 changed files with 618 additions and 11 deletions
|
@ -4,6 +4,7 @@
|
|||
{
|
||||
Sabnzbd = 0,
|
||||
Blackhole = 1,
|
||||
Pneumatic = 2
|
||||
Pneumatic = 2,
|
||||
Nzbget = 3
|
||||
}
|
||||
}
|
13
NzbDrone.Core/Model/Nzbget/EnqueueResponse.cs
Normal file
13
NzbDrone.Core/Model/Nzbget/EnqueueResponse.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public class EnqueueResponse
|
||||
{
|
||||
public String Version { get; set; }
|
||||
public Boolean Result { get; set; }
|
||||
}
|
||||
}
|
19
NzbDrone.Core/Model/Nzbget/ErrorModel.cs
Normal file
19
NzbDrone.Core/Model/Nzbget/ErrorModel.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public class ErrorModel
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public Int32 Code { get; set; }
|
||||
public String Message { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("Name: {0}, Code: {1}, Message: {2}", Name, Code, Message);
|
||||
}
|
||||
}
|
||||
}
|
13
NzbDrone.Core/Model/Nzbget/JsonError.cs
Normal file
13
NzbDrone.Core/Model/Nzbget/JsonError.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public class JsonError
|
||||
{
|
||||
public String Version { get; set; }
|
||||
public ErrorModel Error { get; set; }
|
||||
}
|
||||
}
|
17
NzbDrone.Core/Model/Nzbget/JsonRequest.cs
Normal file
17
NzbDrone.Core/Model/Nzbget/JsonRequest.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public class JsonRequest
|
||||
{
|
||||
[JsonProperty(PropertyName = "method")]
|
||||
public String Method { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "params")]
|
||||
public object[] Params { get; set; }
|
||||
}
|
||||
}
|
11
NzbDrone.Core/Model/Nzbget/PriorityType.cs
Normal file
11
NzbDrone.Core/Model/Nzbget/PriorityType.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public enum PriorityType
|
||||
{
|
||||
VeryLow = -100,
|
||||
Low = -50,
|
||||
Normal = 0,
|
||||
High = 50,
|
||||
VeryHigh = 100
|
||||
}
|
||||
}
|
16
NzbDrone.Core/Model/Nzbget/Queue.cs
Normal file
16
NzbDrone.Core/Model/Nzbget/Queue.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public class Queue
|
||||
{
|
||||
public String Version { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "result")]
|
||||
public List<QueueItem> QueueItems { get; set; }
|
||||
}
|
||||
}
|
32
NzbDrone.Core/Model/Nzbget/QueueItem.cs
Normal file
32
NzbDrone.Core/Model/Nzbget/QueueItem.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public class QueueItem
|
||||
{
|
||||
private string _title;
|
||||
|
||||
public Int32 NzbId { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "NzbName")]
|
||||
public string Title
|
||||
{
|
||||
get { return _title; }
|
||||
set
|
||||
{
|
||||
_title = value;
|
||||
ParseResult = Parser.ParseTitle(value.Replace("DUPLICATE / ", String.Empty));
|
||||
}
|
||||
}
|
||||
|
||||
public String Category { get; set; }
|
||||
public Int32 FileSizeMb { get; set; }
|
||||
public Int32 RemainingSizeMb { get; set; }
|
||||
|
||||
public EpisodeParseResult ParseResult { private set; get; }
|
||||
}
|
||||
}
|
13
NzbDrone.Core/Model/Nzbget/VersionModel.cs
Normal file
13
NzbDrone.Core/Model/Nzbget/VersionModel.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Model.Nzbget
|
||||
{
|
||||
public class VersionModel
|
||||
{
|
||||
public String Version { get; set; }
|
||||
public String Result { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue