mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 10:32:35 +01:00
Cleaner URLs, fixed dynamics in jobs
This commit is contained in:
parent
7065898165
commit
12c4f4423c
@ -46,7 +46,7 @@ public virtual void Start(ProgressNotification notification, dynamic options)
|
|||||||
|
|
||||||
if (options != null)
|
if (options != null)
|
||||||
{
|
{
|
||||||
var series = _seriesProvider.GetSeries(options.SeriesId);
|
Series series = _seriesProvider.GetSeries(options.SeriesId);
|
||||||
|
|
||||||
if (series != null && !String.IsNullOrEmpty(series.BannerUrl))
|
if (series != null && !String.IsNullOrEmpty(series.BannerUrl))
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
using NzbDrone.Core.Model.Notification;
|
using NzbDrone.Core.Model.Notification;
|
||||||
using NzbDrone.Core.Providers;
|
using NzbDrone.Core.Providers;
|
||||||
using NzbDrone.Core.Providers.Converting;
|
using NzbDrone.Core.Providers.Converting;
|
||||||
|
using NzbDrone.Core.Repository;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Jobs
|
namespace NzbDrone.Core.Jobs
|
||||||
{
|
{
|
||||||
@ -41,7 +42,7 @@ public void Start(ProgressNotification notification, dynamic options)
|
|||||||
if (options == null || options.EpisodeId <= 0)
|
if (options == null || options.EpisodeId <= 0)
|
||||||
throw new ArgumentNullException(options);
|
throw new ArgumentNullException(options);
|
||||||
|
|
||||||
var episode = _episodeProvider.GetEpisode(options.EpisodeId);
|
Episode episode = _episodeProvider.GetEpisode(options.EpisodeId);
|
||||||
notification.CurrentMessage = String.Format("Starting Conversion for {0}", episode);
|
notification.CurrentMessage = String.Format("Starting Conversion for {0}", episode);
|
||||||
var outputFile = _handbrakeProvider.ConvertFile(episode, notification);
|
var outputFile = _handbrakeProvider.ConvertFile(episode, notification);
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public void Start(ProgressNotification notification, dynamic options)
|
|||||||
notification.CurrentMessage = String.Format("Renaming episodes for {0} Season {1}", series.Title, options.SeasonNumber);
|
notification.CurrentMessage = String.Format("Renaming episodes for {0} Season {1}", series.Title, options.SeasonNumber);
|
||||||
|
|
||||||
logger.Debug("Getting episodes from database for series: {0} and season: {1}", options.SeriesId, options.SeasonNumber);
|
logger.Debug("Getting episodes from database for series: {0} and season: {1}", options.SeriesId, options.SeasonNumber);
|
||||||
var episodeFiles = _mediaFileProvider.GetSeasonFiles(options.SeriesId, options.SeasonNumber);
|
IList<EpisodeFile> episodeFiles = _mediaFileProvider.GetSeasonFiles(options.SeriesId, options.SeasonNumber);
|
||||||
|
|
||||||
if (episodeFiles == null || !episodeFiles.Any())
|
if (episodeFiles == null || !episodeFiles.Any())
|
||||||
{
|
{
|
||||||
|
@ -26,11 +26,16 @@ public static void RegisterRoutes(RouteCollection routes)
|
|||||||
routes.IgnoreRoute("{*robotstxt}", new { robotstxt = @"(.*/)?robots.txt(/.*)?" });
|
routes.IgnoreRoute("{*robotstxt}", new { robotstxt = @"(.*/)?robots.txt(/.*)?" });
|
||||||
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
|
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
|
||||||
|
|
||||||
|
routes.MapRouteLowercase(
|
||||||
|
name: "WithSeasonNumber",
|
||||||
|
url: "{controller}/{action}/{seriesId}/{seasonNumber}",
|
||||||
|
defaults: new { controller = "Series", action = "Index", seriesId = UrlParameter.Optional, seasonNumber = UrlParameter.Optional }
|
||||||
|
);
|
||||||
|
|
||||||
routes.MapRouteLowercase(
|
routes.MapRouteLowercase(
|
||||||
"Default", // Route name
|
name: "SeriesId",
|
||||||
"{controller}/{action}/{id}", // URL with parameters
|
url: "{controller}/{action}/{seriesId}",
|
||||||
new { controller = "Series", action = "Index", id = UrlParameter.Optional } // Parameter defaults
|
defaults: new { controller = "Series", action = "Index", seriesId = UrlParameter.Optional }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
function seriesTitle (source, type, val) {
|
function seriesTitle (source, type, val) {
|
||||||
// 'display' and 'filter' use our fancy naming
|
// 'display' and 'filter' use our fancy naming
|
||||||
if (type === 'display' || type === 'filter') {
|
if (type === 'display' || type === 'filter') {
|
||||||
return "<a href='/Series/Details?seriesId=" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
|
return "<a href='/series/details/" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
|
||||||
}
|
}
|
||||||
// 'sort' and 'type' both just use the raw data
|
// 'sort' and 'type' both just use the raw data
|
||||||
return source["SeriesTitleSorter"];
|
return source["SeriesTitleSorter"];
|
||||||
|
@ -146,7 +146,7 @@
|
|||||||
{ sWidth: 'auto', "mDataProp": function (source, type, val) {
|
{ sWidth: 'auto', "mDataProp": function (source, type, val) {
|
||||||
// 'display' and 'filter' use our fancy naming
|
// 'display' and 'filter' use our fancy naming
|
||||||
if (type === 'display' || type === 'filter') {
|
if (type === 'display' || type === 'filter') {
|
||||||
return "<a href='/Series/Details?seriesId=" + source["SeriesId"] + "'>" + source["Title"] + "</a>";
|
return "<a href='/series/details/" + source["SeriesId"] + "'>" + source["Title"] + "</a>";
|
||||||
}
|
}
|
||||||
// 'sort' and 'type' both just use the raw data
|
// 'sort' and 'type' both just use the raw data
|
||||||
return source["TitleSorter"];
|
return source["TitleSorter"];
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
@*Commands Column*@
|
@*Commands Column*@
|
||||||
<th>
|
<th>
|
||||||
<i class="icon-eye-open ignoredEpisodesMaster ignoreEpisode @(Model.Ignored ? " ignored" : " ") gridAction" title="Click to toggle season ignore status" data-season="@Model.SeasonNumber"></i>
|
<i class="icon-eye-open ignoredEpisodesMaster ignoreEpisode @(Model.Ignored ? " ignored" : " ") gridAction" title="Click to toggle season ignore status" data-season="@Model.SeasonNumber"></i>
|
||||||
@Ajax.IconActionLink("icon-search gridAction", "", "SearchSeason", "Episode", new { SeriesId = Model.SeriesId, SeasonNumber = Model.SeasonNumber }, null, new { title = "Search for all episodes in this season" })
|
@Ajax.IconActionLink("icon-search gridAction", "", "SearchSeason", "Episode", new { SeriesId = Model.SeriesId, seasonnumber = Model.SeasonNumber }, null, new { title = "Search for all episodes in this season" })
|
||||||
<i class="icon-tag changeQuality gridAction" title="Click to change the quality of all episode files in this season" data-changetype="season"></i>
|
<i class="icon-tag changeQuality gridAction" title="Click to change the quality of all episode files in this season" data-changetype="season"></i>
|
||||||
@Ajax.IconActionLink("icon-pencil gridAction", "", "RenameSeason", "Episode", new { SeriesId = Model.SeriesId, SeasonNumber = Model.SeasonNumber }, null, new { Title = "Rename all episodes in this season" })
|
@Ajax.IconActionLink("icon-pencil gridAction", "", "RenameSeason", "Episode", new { SeriesId = Model.SeriesId, seasonnumber = Model.SeasonNumber }, null, new { Title = "Rename all episodes in this season" })
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
Loading…
Reference in New Issue
Block a user