Added basic episode support

This commit is contained in:
Keivan
2010-10-04 23:21:18 -07:00
parent 606140832d
commit 81e155ae42
33 changed files with 458 additions and 290 deletions
+1
View File
@@ -2,6 +2,7 @@
namespace NzbDrone.Core.Repository
{
[SubSonicTableNameOverride("Config")]
public class Config
{
[SubSonicPrimaryKey]
-27
View File
@@ -1,27 +0,0 @@
using System;
using NzbDrone.Core.Repository.Quality;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Repository
{
public class Episode
{
[SubSonicPrimaryKey(false)]
public long EpisodeId { get; set; }
public long SeriesId { get; set; }
public string Title { get; set; }
public long SeasonId { get; set; }
public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; }
public DateTime AirDate { get; set; }
public QualityTypes Quality { get; set; }
public bool Proper { get; set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual Season Season { get; private set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual Series Series { get; private set; }
}
}
@@ -0,0 +1,16 @@
using System;
using NzbDrone.Core.Repository.Quality;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Repository.Episode
{
public class Episode
{
public virtual int SeriesId { get; set; }
public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual Series Series { get; private set; }
}
}
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Repository.Episode
{
[SubSonicTableNameOverride("EpisodeInfo")]
public class EpisodeInfo : Episode
{
[SubSonicPrimaryKey(false)]
public virtual int EpisodeId { get; set; }
public int SeasonId { get; set; }
public string Title { get; set; }
public DateTime AirDate { get; set; }
[SubSonicLongString]
public string Overview { get; set; }
public string Language { get; set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual Season Season { get; set; }
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Text;
using NzbDrone.Core.Repository.Quality;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Repository.Episode
{
public class RemoteEpisode : Episode
{
public QualityTypes Quality { get; set; }
public SyndicationItem Feed { get; set; }
public bool Proper { get; set; }
}
}
-11
View File
@@ -1,11 +0,0 @@
using System;
using System.ServiceModel.Syndication;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Repository
{
public class LocalEpisode : Episode
{
public String Path { get; set; }
}
}
-12
View File
@@ -1,12 +0,0 @@
using System;
using System.ServiceModel.Syndication;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Repository
{
public class RemoteEpisode : Episode
{
[SubSonicIgnore]
public SyndicationItem Feed { get; set; }
}
}
+3 -3
View File
@@ -8,16 +8,16 @@ namespace NzbDrone.Core.Repository
public class Season
{
[SubSonicPrimaryKey(false)]
public long SeasonId { get; set; }
public virtual long SeasonId { get; set; }
public long SeriesId { get; set; }
public int SeasonNumber { get; set; }
public bool Monitored { get; set; }
public string Folder { get; set; }
[SubSonicToManyRelation]
public virtual List<Episode> Episodes { get; set; }
public virtual List<Episode.Episode> Episodes { get; private set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual Series Series { get; set; }
public virtual Series Series { get; private set; }
}
}
+4 -3
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using NzbDrone.Core.Repository.Episode;
using SubSonic.SqlGeneration.Schema;
namespace NzbDrone.Core.Repository
@@ -7,7 +8,7 @@ namespace NzbDrone.Core.Repository
public class Series
{
[SubSonicPrimaryKey(false)]
public int TvdbId { get; set; }
public virtual int SeriesId { get; set; }
public string Title { get; set; }
@@ -32,8 +33,8 @@ namespace NzbDrone.Core.Repository
public virtual List<Season> Seasons { get; private set; }
[SubSonicToManyRelation]
public virtual List<Episode> Episodes { get; private set; }
public virtual List<EpisodeInfo> Episodes { get; private set; }
}
}