mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Initial quality is only setup if no other quality profiles exists.
This commit is contained in:
parent
452b5c8f84
commit
edf9d1d2cc
2 changed files with 50 additions and 20 deletions
|
@ -58,9 +58,10 @@ namespace NzbDrone.Core.Providers
|
|||
|
||||
public virtual void SetupDefaultProfiles()
|
||||
{
|
||||
Logger.Info("Setting up default quality profiles");
|
||||
if (GetAllProfiles().Count != 0)
|
||||
return;
|
||||
|
||||
var profiles = GetAllProfiles();
|
||||
Logger.Info("Setting up default quality profiles");
|
||||
|
||||
var sd = new QualityProfile { Name = "SD", Allowed = new List<QualityTypes> { QualityTypes.SDTV, QualityTypes.DVD }, Cutoff = QualityTypes.SDTV };
|
||||
|
||||
|
@ -71,23 +72,9 @@ namespace NzbDrone.Core.Providers
|
|||
Cutoff = QualityTypes.HDTV
|
||||
};
|
||||
|
||||
//Add or Update SD
|
||||
Logger.Debug(String.Format("Checking for default QualityProfile: {0}", sd.Name));
|
||||
var sdDb = profiles.Where(p => p.Name == sd.Name).FirstOrDefault();
|
||||
if (sdDb == null)
|
||||
{
|
||||
Logger.Debug(String.Format("Adding new default QualityProfile: {0}", sd.Name));
|
||||
Add(sd);
|
||||
}
|
||||
Add(sd);
|
||||
Add(hd);
|
||||
|
||||
//Add or Update HD
|
||||
Logger.Debug(String.Format("Checking for default QualityProfile: {0}", hd.Name));
|
||||
var hdDb = profiles.Where(p => p.Name == hd.Name).FirstOrDefault();
|
||||
if (hdDb == null)
|
||||
{
|
||||
Logger.Debug(String.Format("Adding new default QualityProfile: {0}", hd.Name));
|
||||
Add(hd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue