mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
Fixed issue with storing and retrieving quality profile, checking the profile.
This commit is contained in:
parent
a7780fab67
commit
309e1ba249
@ -58,7 +58,7 @@ public bool IsMonitored(long id)
|
||||
public bool QualityWanted(int seriesId, QualityTypes quality)
|
||||
{
|
||||
var series = _sonioRepo.Single<Series>(seriesId);
|
||||
var profile = _quality.Find(series.QualityProfile.ProfileId);
|
||||
var profile = _quality.Find(series.ProfileId);
|
||||
|
||||
return profile.Allowed.Contains(quality);
|
||||
}
|
||||
@ -108,7 +108,7 @@ public void AddSeries(string path, TvdbSeries series)
|
||||
repoSeries.Path = path;
|
||||
repoSeries.CleanTitle = Parser.NormalizeTitle(series.SeriesName);
|
||||
repoSeries.Monitored = true; //New shows should be monitored
|
||||
repoSeries.QualityProfile = _quality.Find(Convert.ToInt32(_config.GetValue("Quality", 1, true)));
|
||||
repoSeries.ProfileId = Convert.ToInt32(_config.GetValue("Quality", 1, true));
|
||||
_sonioRepo.Add(repoSeries);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ public class QualityProfile
|
||||
[SubSonicPrimaryKey(true)]
|
||||
public int ProfileId { get; set; }
|
||||
|
||||
[Required (ErrorMessage = "A Name is Required")]
|
||||
[Required(ErrorMessage = "A Name is Required")]
|
||||
[DisplayName("Name")]
|
||||
[DisplayFormat(ConvertEmptyStringToNull = false)]
|
||||
public string Name { get; set; }
|
||||
@ -52,5 +52,8 @@ private set
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SubSonicToManyRelation]
|
||||
public virtual List<string> Series { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,10 @@ public class Series
|
||||
|
||||
public bool Monitored { get; set; }
|
||||
|
||||
public QualityProfile QualityProfile { get; set; }
|
||||
public virtual int ProfileId { get; set; }
|
||||
|
||||
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
|
||||
public virtual QualityProfile QualityProfile { get; set; }
|
||||
|
||||
[SubSonicToManyRelation]
|
||||
public virtual List<Season> Seasons { get; private set; }
|
||||
|
Loading…
Reference in New Issue
Block a user