2017-10-13 04:14:54 +00:00
|
|
|
|
namespace NadekoBot.Core.Services.Database.Models
|
2016-09-01 00:17:48 +00:00
|
|
|
|
{
|
|
|
|
|
public class FollowedStream : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public ulong ChannelId { get; set; }
|
|
|
|
|
public string Username { get; set; }
|
|
|
|
|
public FollowedStreamType Type { get; set; }
|
|
|
|
|
public ulong GuildId { get; set; }
|
|
|
|
|
|
|
|
|
|
public enum FollowedStreamType
|
|
|
|
|
{
|
2017-08-06 15:34:52 +00:00
|
|
|
|
Twitch, Smashcast, Mixer
|
2016-09-01 00:17:48 +00:00
|
|
|
|
}
|
2016-12-03 02:36:02 +00:00
|
|
|
|
|
|
|
|
|
public override int GetHashCode() =>
|
2016-12-03 17:59:38 +00:00
|
|
|
|
ChannelId.GetHashCode() ^
|
|
|
|
|
Username.GetHashCode() ^
|
|
|
|
|
Type.GetHashCode();
|
2016-12-03 02:36:02 +00:00
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
var fs = obj as FollowedStream;
|
|
|
|
|
if (fs == null)
|
|
|
|
|
return false;
|
|
|
|
|
|
2016-12-03 17:59:38 +00:00
|
|
|
|
return fs.ChannelId == ChannelId &&
|
|
|
|
|
fs.Username.ToLowerInvariant().Trim() == Username.ToLowerInvariant().Trim() &&
|
|
|
|
|
fs.Type == Type;
|
2016-12-03 02:36:02 +00:00
|
|
|
|
}
|
2016-09-01 00:17:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|