Fixed issue with quality view

This commit is contained in:
Mark McDowall 2012-11-13 20:03:00 -08:00
parent d50e31f994
commit 363ece3939
2 changed files with 8 additions and 6 deletions

View File

@ -173,7 +173,7 @@ namespace NzbDrone.Web.Controllers
Bluray1080pMaxSize = qualityTypesFromDb.Single(q => q.QualityTypeId == 7).MaxSize
};
ViewData["Profiles"] = profiles;
ViewData["Profiles"] = profiles.Select(s => s.QualityProfileId).ToList();
return View(model);
}
@ -269,13 +269,15 @@ namespace NzbDrone.Web.Controllers
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();
model.QualityProfileId = profile.QualityProfileId;
model.Name = profile.Name;

View File

@ -27,9 +27,9 @@
</a>
</div>
<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>