RenameAll implemented in view and Controller + Rename Series, Season & Episode in Controller

pull/6/head
markus101 14 years ago
parent 9d24ccd97a
commit d0a9851a4c

@ -20,12 +20,15 @@ namespace NzbDrone.Web.Controllers
private readonly IRssSyncProvider _rssSyncProvider;
private readonly IQualityProvider _qualityProvider;
private readonly IMediaFileProvider _mediaFileProvider;
private readonly IRenameProvider _renameProvider;
//
// GET: /Series/
public SeriesController(ISyncProvider syncProvider, ISeriesProvider seriesProvider,
IEpisodeProvider episodeProvider, IRssSyncProvider rssSyncProvider,
IQualityProvider qualityProvider, IMediaFileProvider mediaFileProvider)
IQualityProvider qualityProvider, IMediaFileProvider mediaFileProvider,
IRenameProvider renameProvider)
{
_seriesProvider = seriesProvider;
_episodeProvider = episodeProvider;
@ -33,6 +36,7 @@ namespace NzbDrone.Web.Controllers
_rssSyncProvider = rssSyncProvider;
_qualityProvider = qualityProvider;
_mediaFileProvider = mediaFileProvider;
_renameProvider = renameProvider;
}
public ActionResult Index()
@ -202,5 +206,31 @@ namespace NzbDrone.Web.Controllers
return RedirectToAction("Details", new { seriesId });
}
public ActionResult RenameAll()
{
_renameProvider.RenameAll();
return RedirectToAction("Index");
}
public ActionResult RenameSeries(int seriesId)
{
_renameProvider.RenameSeries(seriesId);
return RedirectToAction("Index");
}
public ActionResult RenameSeason(int seasonId)
{
//Todo: Stay of Series Detail... AJAX?
_renameProvider.RenameSeason(seasonId);
return RedirectToAction("Index");
}
public ActionResult RenameEpisode(int episodeId)
{
//Todo: Stay of Series Detail... AJAX?
_renameProvider.RenameEpisode(episodeId);
return RedirectToAction("Index");
}
}
}

@ -10,6 +10,7 @@
Html.Telerik().Menu().Name("telerikGrid").Items(items => { items.Add().Text("View Unmapped Folders").Action("Unmapped", "Series"); })
.Items(items => items.Add().Text("Sync With Disk").Action("Sync", "Series"))
.Items(items => items.Add().Text("Start RSS Sync").Action("RssSync", "Series"))
.Items(items => items.Add().Text("Rename All").Action("RenameAll", "Series"))
.Render();
%>
</asp:Content>

Loading…
Cancel
Save