1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00

Removed Core/Model Core/Provider

This commit is contained in:
Keivan Beigi
2013-09-18 18:09:26 -07:00
parent 0cc182b01d
commit 487519a09f
36 changed files with 72 additions and 177 deletions
@@ -5,7 +5,7 @@ using System.Linq;
using System.Xml.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Core.Model.Xbmc;
using NzbDrone.Core.Notifications.Xbmc.Model;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Xbmc
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using NzbDrone.Core.Model.Xbmc;
using NzbDrone.Core.Notifications.Xbmc.Model;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Xbmc
@@ -5,7 +5,7 @@ using NLog;
using Newtonsoft.Json.Linq;
using NzbDrone.Common;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Model.Xbmc;
using NzbDrone.Core.Notifications.Xbmc.Model;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Xbmc
@@ -0,0 +1,14 @@
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class ActivePlayer
{
public int PlayerId { get; set; }
public string Type { get; set; }
public ActivePlayer(int playerId, string type)
{
PlayerId = playerId;
Type = type;
}
}
}
@@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class ActivePlayersDharmaResult
{
public string Id { get; set; }
public string JsonRpc { get; set; }
public Dictionary<string, bool> Result { get; set; }
}
}
@@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class ActivePlayersEdenResult
{
public string Id { get; set; }
public string JsonRpc { get; set; }
public List<ActivePlayer> Result { get; set; }
}
}
@@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class ErrorResult
{
public string Id { get; set; }
public string JsonRpc { get; set; }
public Dictionary<string, string> Error { get; set; }
}
}
@@ -0,0 +1,10 @@
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class TvShow
{
public int TvShowId { get; set; }
public string Label { get; set; }
public int ImdbNumber { get; set; }
public string File { get; set; }
}
}
@@ -0,0 +1,9 @@
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class TvShowResponse
{
public string Id { get; set; }
public string JsonRpc { get; set; }
public TvShowResult Result { get; set; }
}
}
@@ -0,0 +1,10 @@
using System.Collections.Generic;
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class TvShowResult
{
public Dictionary<string, int> Limits { get; set; }
public List<TvShow> TvShows;
}
}
@@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class VersionResult
{
public string Id { get; set; }
public string JsonRpc { get; set; }
public Dictionary<string, int> Result { get; set; }
}
}
@@ -0,0 +1,9 @@
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class XbmcJsonResult<T>
{
public string Id { get; set; }
public string JsonRpc { get; set; }
public T Result { get; set; }
}
}
@@ -0,0 +1,125 @@
using System;
namespace NzbDrone.Core.Notifications.Xbmc.Model
{
public class XbmcVersion : IComparable<XbmcVersion>
{
public XbmcVersion()
{
}
public XbmcVersion(int major)
{
Major = major;
}
public XbmcVersion(int major, int minor, int patch)
{
Major = major;
Minor = minor;
Patch = patch;
}
public int Major { get; set; }
public int Minor { get; set; }
public int Patch { get; set; }
public int CompareTo(XbmcVersion other)
{
if(other.Major > Major)
return -1;
if(other.Major < Major)
return 1;
if (other.Minor > Minor)
return -1;
if (other.Minor < Minor)
return 1;
if (other.Patch > Patch)
return -1;
if (other.Patch < Patch)
return 1;
return 0;
}
public static bool operator !=(XbmcVersion x, XbmcVersion y)
{
return !(x == y);
}
public static bool operator ==(XbmcVersion x, XbmcVersion y)
{
var xObj = (Object)x;
var yObj = (object)y;
if (xObj == null || yObj == null)
{
return xObj == yObj;
}
return x.CompareTo(y) == 0;
}
public static bool operator >(XbmcVersion x, XbmcVersion y)
{
return x.CompareTo(y) > 0;
}
public static bool operator <(XbmcVersion x, XbmcVersion y)
{
return x.CompareTo(y) < 0;
}
public static bool operator <=(XbmcVersion x, XbmcVersion y)
{
return x.CompareTo(y) <= 0;
}
public static bool operator >=(XbmcVersion x, XbmcVersion y)
{
return x.CompareTo(y) >= 0;
}
public override string ToString()
{
return String.Format("{0}.{1}.{2}", Major, Minor, Patch);
}
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hash = 17;
hash = hash * 23 + Major.GetHashCode();
hash = hash * 23 + Minor.GetHashCode();
hash = hash * 23 + Patch.GetHashCode();
return hash;
}
}
public bool Equals(XbmcVersion other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return (Equals(other.Major, Major) && Equals(other.Minor, Minor) && Equals(other.Patch, Patch));
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != typeof(XbmcVersion)) return false;
return Equals((XbmcVersion)obj);
}
public static XbmcVersion NONE = new XbmcVersion(0, 0, 0);
public static XbmcVersion DHARMA = new XbmcVersion(2, 0, 0);
public static XbmcVersion EDEN = new XbmcVersion(4, 0, 0);
public static XbmcVersion FRODO = new XbmcVersion(6, 0, 0);
}
}
@@ -7,8 +7,8 @@ using NzbDrone.Common;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Notifications.Xbmc.Model;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Model.Xbmc;
namespace NzbDrone.Core.Notifications.Xbmc
{