Cleaner URLs, fixed dynamics in jobs

This commit is contained in:
Mark McDowall 2012-10-22 00:05:27 -07:00
parent 7065898165
commit 12c4f4423c
7 changed files with 17 additions and 11 deletions

View File

@ -46,7 +46,7 @@ namespace NzbDrone.Core.Jobs
if (options != null)
{
var series = _seriesProvider.GetSeries(options.SeriesId);
Series series = _seriesProvider.GetSeries(options.SeriesId);
if (series != null && !String.IsNullOrEmpty(series.BannerUrl))
{

View File

@ -5,6 +5,7 @@ using NLog;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Converting;
using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Jobs
{
@ -41,7 +42,7 @@ namespace NzbDrone.Core.Jobs
if (options == null || options.EpisodeId <= 0)
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);
var outputFile = _handbrakeProvider.ConvertFile(episode, notification);

View File

@ -54,7 +54,7 @@ namespace NzbDrone.Core.Jobs
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);
var episodeFiles = _mediaFileProvider.GetSeasonFiles(options.SeriesId, options.SeasonNumber);
IList<EpisodeFile> episodeFiles = _mediaFileProvider.GetSeasonFiles(options.SeriesId, options.SeasonNumber);
if (episodeFiles == null || !episodeFiles.Any())
{

View File

@ -26,12 +26,17 @@ namespace NzbDrone.Web
routes.IgnoreRoute("{*robotstxt}", new { robotstxt = @"(.*/)?robots.txt(/.*)?" });
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(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Series", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
name: "SeriesId",
url: "{controller}/{action}/{seriesId}",
defaults: new { controller = "Series", action = "Index", seriesId = UrlParameter.Optional }
);
}
protected override void OnApplicationStarted()

View File

@ -40,7 +40,7 @@
function seriesTitle (source, type, val) {
// 'display' and 'filter' use our fancy naming
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
return source["SeriesTitleSorter"];

View File

@ -146,7 +146,7 @@
{ sWidth: 'auto', "mDataProp": function (source, type, val) {
// 'display' and 'filter' use our fancy naming
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
return source["TitleSorter"];

View File

@ -23,9 +23,9 @@
@*Commands Column*@
<th>
<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>
@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>
</tr>
</thead>