mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-30 15:37:55 +02:00
Merge branch 'markus101'
Conflicts: NzbDrone.Web/NzbDrone.Web.csproj NzbDrone.Web/Views/Log/Index.cshtml
This commit is contained in:
@@ -94,7 +94,6 @@ namespace NzbDrone.Web.Controllers
|
||||
"QualityProfileId",
|
||||
"Name",
|
||||
defaultQuality);
|
||||
;
|
||||
|
||||
return PartialView("AddSeriesItem", suggestions);
|
||||
}
|
||||
|
@@ -38,7 +38,10 @@ namespace NzbDrone.Web.Controllers
|
||||
[GridAction]
|
||||
public ActionResult _AjaxBinding()
|
||||
{
|
||||
var history = _historyProvider.AllItems().Select(h => new HistoryModel
|
||||
|
||||
//TODO: possible subsonic bug, IQuarible causes some issues so ToList() is called
|
||||
|
||||
var history = _historyProvider.AllItems().ToList().Select(h => new HistoryModel
|
||||
{
|
||||
HistoryId = h.HistoryId,
|
||||
SeasonNumber = h.Episode.SeasonNumber,
|
||||
@@ -47,11 +50,13 @@ namespace NzbDrone.Web.Controllers
|
||||
EpisodeOverview = h.Episode.Overview,
|
||||
SeriesTitle = h.Episode.Series.Title,
|
||||
NzbTitle = h.NzbTitle,
|
||||
Quality = h.Quality.ToString("G"),
|
||||
Quality = h.Quality.ToString(),
|
||||
IsProper = h.IsProper,
|
||||
Date = h.Date
|
||||
});
|
||||
|
||||
history.ToList();
|
||||
|
||||
return View(new GridModel(history));
|
||||
}
|
||||
}
|
||||
|
@@ -69,22 +69,15 @@ namespace NzbDrone.Web.Controllers
|
||||
var episodes = _episodeProvider.GetEpisodeBySeason(seasonId).Select(c => new EpisodeModel
|
||||
{
|
||||
EpisodeId = c.EpisodeId,
|
||||
EpisodeNumber =
|
||||
c.EpisodeNumber,
|
||||
SeasonNumber =
|
||||
c.SeasonNumber,
|
||||
EpisodeNumber = c.EpisodeNumber,
|
||||
SeasonNumber = c.SeasonNumber,
|
||||
Title = c.Title,
|
||||
Overview = c.Overview,
|
||||
AirDate = c.AirDate,
|
||||
Path =
|
||||
GetEpisodePath(
|
||||
c.EpisodeFile),
|
||||
Quality =
|
||||
c.EpisodeFile == null
|
||||
Path = GetEpisodePath(c.EpisodeFile),
|
||||
Quality = c.EpisodeFile == null
|
||||
? String.Empty
|
||||
: c.EpisodeFile.
|
||||
Quality.
|
||||
ToString()
|
||||
: c.EpisodeFile.Quality.ToString()
|
||||
});
|
||||
return View(new GridModel(episodes));
|
||||
}
|
||||
|
@@ -210,7 +210,35 @@ namespace NzbDrone.Web.Controllers
|
||||
|
||||
ViewData["Qualities"] = qualityTypes;
|
||||
|
||||
return View("UserProfileSection", new QualityProfile { Name = "New Profile", UserProfile = true });
|
||||
var qualityProfile = new QualityProfile
|
||||
{
|
||||
Name = "New Profile",
|
||||
UserProfile = true,
|
||||
Allowed = new List<QualityTypes> {QualityTypes.Unknown},
|
||||
Cutoff = QualityTypes.Unknown,
|
||||
};
|
||||
|
||||
var id = _qualityProvider.Add(qualityProfile);
|
||||
qualityProfile.QualityProfileId = id;
|
||||
qualityProfile.Allowed = null;
|
||||
|
||||
ViewData["ProfileId"] = id;
|
||||
|
||||
return View("UserProfileSection", qualityProfile);
|
||||
}
|
||||
|
||||
public ActionResult GetQualityProfileView(QualityProfile profile)
|
||||
{
|
||||
var qualityTypes = new List<QualityTypes>();
|
||||
|
||||
foreach (QualityTypes qual in Enum.GetValues(typeof(QualityTypes)))
|
||||
{
|
||||
qualityTypes.Add(qual);
|
||||
}
|
||||
ViewData["Qualities"] = qualityTypes;
|
||||
ViewData["ProfileId"] = profile.QualityProfileId;
|
||||
|
||||
return PartialView("UserProfileSection", profile);
|
||||
}
|
||||
|
||||
public ViewResult AddRootDir()
|
||||
@@ -233,6 +261,21 @@ namespace NzbDrone.Web.Controllers
|
||||
return new QualityModel { DefaultQualityProfileId = defaultQualityQualityProfileId, SelectList = selectList };
|
||||
}
|
||||
|
||||
public JsonResult DeleteQualityProfile(int profileId)
|
||||
{
|
||||
try
|
||||
{
|
||||
_qualityProvider.Delete(profileId);
|
||||
}
|
||||
|
||||
catch (Exception)
|
||||
{
|
||||
return new JsonResult { Data = "failed" };
|
||||
}
|
||||
|
||||
return new JsonResult { Data = "ok" };
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult SaveGeneral(SettingsModel data)
|
||||
{
|
||||
@@ -343,12 +386,6 @@ namespace NzbDrone.Web.Controllers
|
||||
if (data.UserProfiles == null)
|
||||
return Content(SETTINGS_SAVED);
|
||||
|
||||
foreach (var dbProfile in _qualityProvider.GetAllProfiles().Where(q => q.UserProfile))
|
||||
{
|
||||
if (!data.UserProfiles.Exists(p => p.QualityProfileId == dbProfile.QualityProfileId))
|
||||
_qualityProvider.Delete(dbProfile.QualityProfileId);
|
||||
}
|
||||
|
||||
foreach (var profile in data.UserProfiles)
|
||||
{
|
||||
Logger.Debug(String.Format("Updating User Profile: {0}", profile));
|
||||
@@ -365,14 +402,9 @@ namespace NzbDrone.Web.Controllers
|
||||
return Content("Error Saving Settings, please fix any errors");
|
||||
//profile.Cutoff = profile.Allowed.Last();
|
||||
|
||||
if (profile.QualityProfileId > 0)
|
||||
_qualityProvider.Update(profile);
|
||||
|
||||
else
|
||||
_qualityProvider.Add(profile);
|
||||
|
||||
return Content(SETTINGS_SAVED);
|
||||
_qualityProvider.Update(profile);
|
||||
}
|
||||
return Content(SETTINGS_SAVED);
|
||||
}
|
||||
|
||||
return Content(SETTINGS_FAILED);
|
||||
|
Reference in New Issue
Block a user