mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
moved Series,Seasons,Episodes to their own folders.
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
using System;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Model;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Repository
|
||||
{
|
||||
[TableName("Episodes")]
|
||||
[PrimaryKey("EpisodeId", autoIncrement = true)]
|
||||
public class Episode
|
||||
{
|
||||
public int EpisodeId { get; set; }
|
||||
|
||||
public int? TvDbEpisodeId { get; set; }
|
||||
|
||||
public int SeriesId { get; set; }
|
||||
public int EpisodeFileId { get; set; }
|
||||
public int SeasonNumber { get; set; }
|
||||
public int EpisodeNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public DateTime? AirDate { get; set; }
|
||||
public string Overview { get; set; }
|
||||
public Boolean Ignored { get; set; }
|
||||
public PostDownloadStatusType PostDownloadStatus { get; set; }
|
||||
public int AbsoluteEpisodeNumber { get; set; }
|
||||
public int SceneAbsoluteEpisodeNumber { get; set; }
|
||||
public int SceneSeasonNumber { get; set; }
|
||||
public int SceneEpisodeNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the grab date.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used to specify when the episode was grapped.
|
||||
/// this filed is used by status as an expirable "Grabbed" status.
|
||||
/// </remarks>
|
||||
public DateTime? GrabDate { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public EpisodeStatusType Status
|
||||
{
|
||||
get
|
||||
{
|
||||
if (EpisodeFileId != 0) return EpisodeStatusType.Ready;
|
||||
|
||||
if (GrabDate != null)
|
||||
{
|
||||
if (PostDownloadStatus == PostDownloadStatusType.Unpacking)
|
||||
return EpisodeStatusType.Unpacking;
|
||||
|
||||
if (PostDownloadStatus == PostDownloadStatusType.Failed)
|
||||
return EpisodeStatusType.Failed;
|
||||
|
||||
if (GrabDate.Value.AddDays(1) >= DateTime.Now)
|
||||
return EpisodeStatusType.Downloading;
|
||||
}
|
||||
|
||||
if (GrabDate != null && GrabDate.Value.AddDays(1) >= DateTime.Now)
|
||||
return EpisodeStatusType.Downloading;
|
||||
|
||||
if (AirDate != null && AirDate.Value.Date == DateTime.Today)
|
||||
return EpisodeStatusType.AirsToday;
|
||||
|
||||
if (AirDate != null && AirDate.Value.Date < DateTime.Now)
|
||||
return EpisodeStatusType.Missing;
|
||||
|
||||
return EpisodeStatusType.NotAired;
|
||||
}
|
||||
}
|
||||
|
||||
[ResultColumn]
|
||||
public Series Series { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public EpisodeFile EpisodeFile { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string seriesTitle = Series == null ? "[NULL]" : Series.Title;
|
||||
|
||||
if (Series != null && Series.IsDaily && AirDate.HasValue)
|
||||
return string.Format("{0} - {1:yyyy-MM-dd}", seriesTitle, AirDate.Value);
|
||||
|
||||
return string.Format("{0} - S{1:00}E{2:00}", seriesTitle, SeasonNumber, EpisodeNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Repository
|
||||
{
|
||||
[TableName("EpisodeFiles")]
|
||||
[PrimaryKey("EpisodeFileId", autoIncrement = true)]
|
||||
public class EpisodeFile
|
||||
{
|
||||
public EpisodeFile()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public EpisodeFile(EpisodeFile source)
|
||||
{
|
||||
EpisodeFileId = source.EpisodeFileId;
|
||||
SeriesId = source.SeriesId;
|
||||
SeasonNumber = source.SeasonNumber;
|
||||
Path = source.Path;
|
||||
Quality = source.Quality;
|
||||
Proper = source.Proper;
|
||||
Size = source.Size;
|
||||
}
|
||||
|
||||
public int EpisodeFileId { get; set; }
|
||||
|
||||
public int SeriesId { get; set; }
|
||||
public int SeasonNumber { get; set; }
|
||||
public string Path { get; set; }
|
||||
public QualityTypes Quality { get; set; }
|
||||
public bool Proper { get; set; }
|
||||
public long Size { get; set; }
|
||||
public DateTime DateAdded { get; set; }
|
||||
public string SceneName { get; set; }
|
||||
public string ReleaseGroup { get; set; }
|
||||
|
||||
[Ignore]
|
||||
public Model.QualityModel QualityWrapper
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Model.QualityModel(Quality, Proper);
|
||||
}
|
||||
set
|
||||
{
|
||||
Quality = value.Quality;
|
||||
Proper = value.Proper;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
using PetaPoco;
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Model;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Repository
|
||||
{
|
||||
[TableName("Seasons")]
|
||||
[PrimaryKey("SeasonId", autoIncrement = true)]
|
||||
public class Season
|
||||
{
|
||||
public int SeasonId { get; set; }
|
||||
public int SeriesId { get; set; }
|
||||
public int SeasonNumber { get; set; }
|
||||
public Boolean Ignored { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public List<Episode> Episodes { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Repository
|
||||
{
|
||||
[PrimaryKey("SeriesId", autoIncrement = false)]
|
||||
public class Series
|
||||
{
|
||||
public virtual int SeriesId { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public string CleanTitle { get; set; }
|
||||
|
||||
public string Status { get; set; }
|
||||
|
||||
public string Overview { get; set; }
|
||||
|
||||
[DisplayName("Air on")]
|
||||
public DayOfWeek? AirsDayOfWeek { get; set; }
|
||||
|
||||
[Column("AirTimes")]
|
||||
public String AirTime { get; set; }
|
||||
|
||||
public string Language { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
public bool Monitored { get; set; }
|
||||
|
||||
public virtual int QualityProfileId { get; set; }
|
||||
|
||||
public bool SeasonFolder { get; set; }
|
||||
|
||||
public DateTime? LastInfoSync { get; set; }
|
||||
|
||||
public DateTime? LastDiskSync { get; set; }
|
||||
|
||||
public int Runtime { get; set; }
|
||||
|
||||
public string BannerUrl { get; set; }
|
||||
|
||||
public bool IsDaily { get; set; }
|
||||
|
||||
public BacklogSettingType BacklogSetting { get; set; }
|
||||
|
||||
public string Network { get; set; }
|
||||
|
||||
public DateTime? CustomStartDate { get; set; }
|
||||
|
||||
public bool UseSceneNumbering { get; set; }
|
||||
|
||||
public int TvRageId { get; set; }
|
||||
|
||||
public string TvRageTitle { get; set; }
|
||||
|
||||
//Todo: This should be a double since there are timezones that aren't on a full hour offset
|
||||
public int UtcOffset { get; set; }
|
||||
|
||||
public DateTime? FirstAired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Series"/> is hidden.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if hidden; otherwise, <c>false</c>.</value>
|
||||
/// <remarks>This field will be used for shows that are pending delete or
|
||||
/// new series that haven't been successfully imported</remarks>
|
||||
[PetaPoco.Ignore]
|
||||
public bool Hidden { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public QualityProfile QualityProfile { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public int EpisodeCount { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public int EpisodeFileCount { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public int SeasonCount { get; set; }
|
||||
|
||||
[ResultColumn]
|
||||
public DateTime? NextAiring { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user