Got mostly everything working for #254 Ready for testing

This commit is contained in:
tidusjar 2016-08-07 18:54:49 +01:00
commit 0699d777d6
7 changed files with 84 additions and 40 deletions

View file

@ -108,9 +108,29 @@ namespace PlexRequests.Store
Other = 4, // Provide a message
}
public class EpisodesModel
public class EpisodesModel : IEquatable<EpisodesModel>
{
public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; }
public bool Equals(EpisodesModel other)
{
// Check whether the compared object is null.
if (ReferenceEquals(other, null)) return false;
//Check whether the compared object references the same data.
if (ReferenceEquals(this, other)) return true;
//Check whether the properties are equal.
return SeasonNumber.Equals(other.SeasonNumber) && EpisodeNumber.Equals(other.EpisodeNumber);
}
public override int GetHashCode()
{
var hashSeason = SeasonNumber.GetHashCode();
var hashEp = EpisodeNumber.GetHashCode();
//Calculate the hash code.
return hashSeason + hashEp;
}
}
}