Fixed issue with quality view

pull/6/head
Mark McDowall 12 years ago
parent d50e31f994
commit 363ece3939

@ -173,7 +173,7 @@ namespace NzbDrone.Web.Controllers
Bluray1080pMaxSize = qualityTypesFromDb.Single(q => q.QualityTypeId == 7).MaxSize Bluray1080pMaxSize = qualityTypesFromDb.Single(q => q.QualityTypeId == 7).MaxSize
}; };
ViewData["Profiles"] = profiles; ViewData["Profiles"] = profiles.Select(s => s.QualityProfileId).ToList();
return View(model); return View(model);
} }
@ -269,13 +269,15 @@ namespace NzbDrone.Web.Controllers
Cutoff = QualityTypes.Unknown Cutoff = QualityTypes.Unknown
}; };
qualityProfile.QualityProfileId = _qualityProvider.Add(qualityProfile); var qualityProfileId = _qualityProvider.Add(qualityProfile);
return GetQualityProfileView(qualityProfile); return GetQualityProfileView(qualityProfileId);
} }
public PartialViewResult GetQualityProfileView(QualityProfile profile) public PartialViewResult GetQualityProfileView(int profileId)
{ {
var profile = _qualityProvider.Get(profileId);
var model = new QualityProfileModel(); var model = new QualityProfileModel();
model.QualityProfileId = profile.QualityProfileId; model.QualityProfileId = profile.QualityProfileId;
model.Name = profile.Name; model.Name = profile.Name;

@ -27,9 +27,9 @@
</a> </a>
</div> </div>
<div id="profiles"> <div id="profiles">
@foreach (var item in (List<QualityProfile>)ViewData["Profiles"]) @foreach (var profileId in (List<Int32>)ViewData["Profiles"])
{ {
Html.RenderAction("GetQualityProfileView", item); Html.RenderAction("GetQualityProfileView", new { profileId = profileId });
} }
</div> </div>
</div> </div>

Loading…
Cancel
Save