1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-22 07:42:28 +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 @@ public void RenameAll()
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 @@ public void RenameSeries(int 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();
@ -79,7 +88,12 @@ public void RenameSeason(int seasonId)
{
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 @@ public void RenameEpisode(int episodeId)
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 @@ public void AddSeries(string path, TvdbSeries series)
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 @@ public class Series
public int QualityProfileId { get; set; }
public bool SeasonFolder { get; set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual QualityProfile QualityProfile { get; private set; }