1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-22 07:42:28 +00:00

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

This commit is contained in:
markus101 2011-02-22 22:49:02 -08:00
parent 9d24ccd97a
commit d0a9851a4c
2 changed files with 32 additions and 1 deletions

View file

@ -20,12 +20,15 @@ public class SeriesController : Controller
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 @@ public SeriesController(ISyncProvider syncProvider, ISeriesProvider seriesProvid
_rssSyncProvider = rssSyncProvider;
_qualityProvider = qualityProvider;
_mediaFileProvider = mediaFileProvider;
_renameProvider = renameProvider;
}
public ActionResult Index()
@ -202,5 +206,31 @@ public ActionResult SyncEpisodesOnDisk(int seriesId)
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");
}
}
}

View file

@ -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>