From b4bc51c862a400ad0dd350813315319f94ebc620 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 28 Jul 2016 13:59:00 +0100 Subject: [PATCH] #254 --- PlexRequests.UI/Content/search.js | 5 +++-- PlexRequests.UI/Models/EpisodeListViewModel.cs | 1 + PlexRequests.UI/Modules/SearchModule.cs | 9 +++++---- PlexRequests.UI/Resources/UI.resx | 2 +- PlexRequests.UI/Resources/UI1.Designer.cs | 2 +- PlexRequests.UI/Views/Search/Index.cshtml | 4 ++-- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/PlexRequests.UI/Content/search.js b/PlexRequests.UI/Content/search.js index 97d1d1513..0c562738a 100644 --- a/PlexRequests.UI/Content/search.js +++ b/PlexRequests.UI/Content/search.js @@ -603,7 +603,7 @@ $(function () { var url = createBaseUrl(mainBaseUrl, "search/request/tvEpisodes"); var type = $form.prop('method'); - + $('#episodesModal').modal('toggle'); sendRequestAjax(JSON.stringify(finalObj), type, url, tvId); }); @@ -627,7 +627,8 @@ $(function () { name: result.name, season: result.seasonNumber, number: result.episodeNumber, - requested: result.requested + requested: result.requested, + episodeId: result.episodeId } } }); diff --git a/PlexRequests.UI/Models/EpisodeListViewModel.cs b/PlexRequests.UI/Models/EpisodeListViewModel.cs index 555489807..33050c84d 100644 --- a/PlexRequests.UI/Models/EpisodeListViewModel.cs +++ b/PlexRequests.UI/Models/EpisodeListViewModel.cs @@ -33,5 +33,6 @@ namespace PlexRequests.UI.Models public bool Requested { get; set; } public string Name { get; set; } public int Id { get; set; } + public int EpisodeId { get; set; } // Not used other than in the view to keep everything unique } } \ No newline at end of file diff --git a/PlexRequests.UI/Modules/SearchModule.cs b/PlexRequests.UI/Modules/SearchModule.cs index 81aa25b8e..801cf3be3 100644 --- a/PlexRequests.UI/Modules/SearchModule.cs +++ b/PlexRequests.UI/Modules/SearchModule.cs @@ -557,7 +557,7 @@ namespace PlexRequests.UI.Modules var s = await sonarrSettings; if (!s.Enabled) { - return Response.AsJson(new JsonResponseModel { Message = "This is currently only supported with Sonarr", Result = false }); + return Response.AsJson(new JsonResponseModel { Message = "This is currently only supported with Sonarr, Please enable Sonarr for this feature", Result = false }); } } @@ -941,8 +941,8 @@ namespace PlexRequests.UI.Modules var enumerable = allResults as RequestedModel[] ?? allResults.ToArray(); var dbDbShow = enumerable.FirstOrDefault(x => x.Type == RequestType.TvShow && x.TvDbId == seriesId.ToString()); - var show = TvApi.ShowLookupByTheTvDbId(seriesId); - var seasons = TvApi.EpisodeLookup(show.id); + var show = await Task.Run(() => TvApi.ShowLookupByTheTvDbId(seriesId)); + var seasons = await Task.Run(() => TvApi.EpisodeLookup(show.id)); foreach (var ep in seasons) @@ -957,7 +957,8 @@ namespace PlexRequests.UI.Modules SeasonNumber = ep.season, EpisodeNumber = ep.number, Requested = requested ?? false, - Name = ep.name + Name = ep.name, + EpisodeId = ep.id }); } diff --git a/PlexRequests.UI/Resources/UI.resx b/PlexRequests.UI/Resources/UI.resx index b2cfd4ca8..df514d697 100644 --- a/PlexRequests.UI/Resources/UI.resx +++ b/PlexRequests.UI/Resources/UI.resx @@ -231,7 +231,7 @@ Latest Season - Select + Select Season Report Issue diff --git a/PlexRequests.UI/Resources/UI1.Designer.cs b/PlexRequests.UI/Resources/UI1.Designer.cs index 4ab289d34..968fdf5fb 100644 --- a/PlexRequests.UI/Resources/UI1.Designer.cs +++ b/PlexRequests.UI/Resources/UI1.Designer.cs @@ -898,7 +898,7 @@ namespace PlexRequests.UI.Resources { } /// - /// Looks up a localized string similar to Select . + /// Looks up a localized string similar to Select Season. /// public static string Search_SelectSeason { get { diff --git a/PlexRequests.UI/Views/Search/Index.cshtml b/PlexRequests.UI/Views/Search/Index.cshtml index f388710f8..5da08daf6 100644 --- a/PlexRequests.UI/Views/Search/Index.cshtml +++ b/PlexRequests.UI/Views/Search/Index.cshtml @@ -366,9 +366,9 @@
{{#if_eq requested true}} - + {{else}} - + {{/if_eq}}