1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 01:37:07 +00:00

Use Season Folder is set in config (also set per Series), default is true.

This commit is contained in:
markus101 2011-02-24 23:20:24 -08:00
parent 3b749a39a7
commit 165beda55b
3 changed files with 30 additions and 4 deletions

View file

@ -45,7 +45,11 @@ namespace NzbDrone.Core.Providers
var series = _seriesProvider.GetSeries(episodeFile.SeriesId);
var erm = new EpisodeRenameModel();
erm.SeriesName = series.Title;
erm.Folder = series.Path + Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.Folder = series.Path;
if (series.SeasonFolder)
erm.Folder += Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.EpisodeFile = episodeFile;
_epsToRename.Add(erm);
StartRename();
@ -62,7 +66,12 @@ namespace NzbDrone.Core.Providers
{
var erm = new EpisodeRenameModel();
erm.SeriesName = series.Title;
erm.Folder = series.Path + Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.Folder = series.Path;
if (series.SeasonFolder)
erm.Folder += Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.EpisodeFile = episodeFile;
_epsToRename.Add(erm);
StartRename();
@ -79,7 +88,12 @@ namespace NzbDrone.Core.Providers
{
var erm = new EpisodeRenameModel();
erm.SeriesName = series.Title;
erm.Folder = series.Path + Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.Folder = series.Path;
if (series.SeasonFolder)
erm.Folder += Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.EpisodeFile = episodeFile;
_epsToRename.Add(erm);
StartRename();
@ -96,7 +110,12 @@ namespace NzbDrone.Core.Providers
var erm = new EpisodeRenameModel();
erm.SeriesName = series.Title;
erm.Folder = series.Path + Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.Folder = series.Path;
if (series.SeasonFolder)
erm.Folder += Path.DirectorySeparatorChar + GetSeasonFolder(episodeFile.Episodes[0].SeasonNumber);
erm.EpisodeFile = episodeFile;
_epsToRename.Add(erm);
StartRename();

View file

@ -111,6 +111,11 @@ namespace NzbDrone.Core.Providers
repoSeries.CleanTitle = Parser.NormalizeTitle(series.SeriesName);
repoSeries.Monitored = true; //New shows should be monitored
repoSeries.QualityProfileId = Convert.ToInt32(_config.GetValue("DefaultQualityProfile", "1", true));
repoSeries.SeasonFolder = true;
if (!Convert.ToBoolean(_config.GetValue("SeasonFolder", true, true)))
repoSeries.SeasonFolder = false;
_sonioRepo.Add(repoSeries);
}

View file

@ -32,6 +32,8 @@ namespace NzbDrone.Core.Repository
public int QualityProfileId { get; set; }
public bool SeasonFolder { get; set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual QualityProfile QualityProfile { get; private set; }