mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
turn task type enum into string
This commit is contained in:
parent
fa89d33900
commit
3501e33722
@ -60,7 +60,7 @@ public void Setup()
|
||||
Id = "id1",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Waiting,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -83,7 +83,7 @@ public void Setup()
|
||||
Id = "id2",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Finished,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -106,7 +106,7 @@ public void Setup()
|
||||
Id = "id2",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Seeding,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -129,7 +129,7 @@ public void Setup()
|
||||
Id = "id3",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Downloading,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -152,7 +152,7 @@ public void Setup()
|
||||
Id = "id4",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Error,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -175,7 +175,7 @@ public void Setup()
|
||||
Id = "id5",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Seeding,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "a.mkv",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -198,7 +198,7 @@ public void Setup()
|
||||
Id = "id6",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Seeding,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -221,7 +221,7 @@ public void Setup()
|
||||
Id = "id6",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Finished,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "a.mkv",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -244,7 +244,7 @@ public void Setup()
|
||||
Id = "id6",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Finished,
|
||||
Type = DownloadStationTaskType.BT,
|
||||
Type = DownloadStationTaskType.BT.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
|
@ -58,7 +58,7 @@ public void Setup()
|
||||
Id = "id1",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Waiting,
|
||||
Type = DownloadStationTaskType.NZB,
|
||||
Type = DownloadStationTaskType.NZB.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -81,7 +81,7 @@ public void Setup()
|
||||
Id = "id2",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Finished,
|
||||
Type = DownloadStationTaskType.NZB,
|
||||
Type = DownloadStationTaskType.NZB.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -104,7 +104,7 @@ public void Setup()
|
||||
Id = "id2",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Seeding,
|
||||
Type = DownloadStationTaskType.NZB,
|
||||
Type = DownloadStationTaskType.NZB.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -127,7 +127,7 @@ public void Setup()
|
||||
Id = "id3",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Downloading,
|
||||
Type = DownloadStationTaskType.NZB,
|
||||
Type = DownloadStationTaskType.NZB.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
@ -150,7 +150,7 @@ public void Setup()
|
||||
Id = "id4",
|
||||
Size = 1000,
|
||||
Status = DownloadStationTaskStatus.Error,
|
||||
Type = DownloadStationTaskType.NZB,
|
||||
Type = DownloadStationTaskType.NZB.ToString(),
|
||||
Username = "admin",
|
||||
Title = "title",
|
||||
Additional = new DownloadStationTaskAdditional
|
||||
|
@ -15,8 +15,10 @@ public class DownloadStationTask
|
||||
|
||||
public long Size { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public DownloadStationTaskType Type { get; set; }
|
||||
/// <summary>
|
||||
/// /// Possible values are: BT, NZB, http, ftp, eMule and https
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "status_extra")]
|
||||
public Dictionary<string, string> StatusExtra { get; set; }
|
||||
@ -34,7 +36,7 @@ public override string ToString()
|
||||
|
||||
public enum DownloadStationTaskType
|
||||
{
|
||||
BT, NZB, http, ftp, eMule
|
||||
BT, NZB, http, ftp, eMule, https
|
||||
}
|
||||
|
||||
public enum DownloadStationTaskStatus
|
||||
|
@ -76,7 +76,7 @@ public IEnumerable<DownloadStationTask> GetTasks(DownloadStationTaskType type, D
|
||||
{
|
||||
var response = ProcessRequest<DownloadStationTaskInfoResponse>(DiskStationApi.DownloadStationTask, arguments, settings, "get tasks");
|
||||
|
||||
return response.Data.Tasks.Where(t => t.Type == type);
|
||||
return response.Data.Tasks.Where(t => t.Type == type.ToString());
|
||||
}
|
||||
catch (DownloadClientException e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user