mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Fix the exception in #440
This commit is contained in:
parent
f03392691c
commit
85baa67f29
3 changed files with 120 additions and 113 deletions
|
@ -60,6 +60,7 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
public static JsonResponseModel SendSonarrError(List<string> result)
|
||||
{
|
||||
|
||||
var model = new JsonResponseModel {Result = false};
|
||||
if (!result.Any())
|
||||
{
|
||||
|
|
|
@ -637,8 +637,8 @@ namespace PlexRequests.UI.Modules
|
|||
{
|
||||
return await AddRequest(model, settings, $"{fullShowName} {Resources.UI.Search_SuccessfullyAdded}");
|
||||
}
|
||||
|
||||
return Response.AsJson(ValidationHelper.SendSonarrError(result?.ErrorMessages));
|
||||
Log.Debug("Error with sending to sonarr.");
|
||||
return Response.AsJson(ValidationHelper.SendSonarrError(result?.ErrorMessages ?? new List<string>()));
|
||||
}
|
||||
|
||||
var srSettings = SickRageService.GetSettings();
|
||||
|
|
|
@ -157,9 +157,15 @@
|
|||
</div>
|
||||
<div class="col-sm-5 ">
|
||||
<div>
|
||||
{{#if_eq type "movie"}}
|
||||
<a href="https://www.themoviedb.org/movie/{{id}}/" target="_blank">
|
||||
<h4>{{title}} ({{year}})</h4>
|
||||
</a>
|
||||
{{else}}
|
||||
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
|
||||
<h4>{{title}} ({{year}})</h4>
|
||||
</a>
|
||||
{{/if_eq}}
|
||||
</div>
|
||||
<p>{{overview}}</p>
|
||||
</div>
|
||||
|
@ -167,30 +173,30 @@
|
|||
<form method="POST" action="@url/search/request/{{type}}" id="form{{id}}">
|
||||
<input name="{{type}}Id" type="text" value="{{id}}" hidden="hidden" />
|
||||
{{#if_eq type "movie"}}
|
||||
{{#if_eq available true}}
|
||||
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button>
|
||||
{{else}}
|
||||
{{#if_eq requested true}}
|
||||
<button style="text-align: right" class="btn btn-primary-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Requested</button>
|
||||
{{else}}
|
||||
<button id="{{id}}" style="text-align: right" class="btn btn-primary-outline requestMovie" type="submit"><i class="fa fa-plus"></i> @UI.Search_Request</button>
|
||||
{{/if_eq}}
|
||||
{{/if_eq}}
|
||||
{{#if_eq available true}}
|
||||
<button style="text-align: right" class="btn btn-success-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Available</button>
|
||||
{{else}}
|
||||
{{#if_eq requested true}}
|
||||
<button style="text-align: right" class="btn btn-primary-outline disabled" disabled><i class="fa fa-check"></i> @UI.Search_Requested</button>
|
||||
{{else}}
|
||||
<button id="{{id}}" style="text-align: right" class="btn btn-primary-outline requestMovie" type="submit"><i class="fa fa-plus"></i> @UI.Search_Request</button>
|
||||
{{/if_eq}}
|
||||
{{/if_eq}}
|
||||
{{/if_eq}}
|
||||
{{#if_eq type "tv"}}
|
||||
<div class="dropdown">
|
||||
<button id="{{id}}" class="btn btn-primary-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<i class="fa fa-plus"></i> @UI.Search_Request
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
|
||||
<li><a id="{{id}}" season-select="0" class="dropdownTv " href="#">@UI.Search_AllSeasons</a></li>
|
||||
<li><a id="{{id}}" season-select="1" class="dropdownTv" href="#">@UI.Search_FirstSeason</a></li>
|
||||
<li><a id="{{id}}" season-select="2" class="dropdownTv" href="#">@UI.Search_LatestSeason</a></li>
|
||||
<li><a id="SeasonSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#seasonsModal" href="#">@UI.Search_SelectSeason...</a></li>
|
||||
<li><a id="EpisodeSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#episodesModal" href="#">@UI.Search_SelectEpisode...</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<button id="{{id}}" class="btn btn-primary-outline dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<i class="fa fa-plus"></i> @UI.Search_Request
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
|
||||
<li><a id="{{id}}" season-select="0" class="dropdownTv " href="#">@UI.Search_AllSeasons</a></li>
|
||||
<li><a id="{{id}}" season-select="1" class="dropdownTv" href="#">@UI.Search_FirstSeason</a></li>
|
||||
<li><a id="{{id}}" season-select="2" class="dropdownTv" href="#">@UI.Search_LatestSeason</a></li>
|
||||
<li><a id="SeasonSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#seasonsModal" href="#">@UI.Search_SelectSeason...</a></li>
|
||||
<li><a id="EpisodeSelect" data-identifier="{{id}}" data-toggle="modal" data-target="#episodesModal" href="#">@UI.Search_SelectEpisode...</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{{/if_eq}}
|
||||
|
||||
|
||||
|
@ -341,9 +347,9 @@
|
|||
</script>
|
||||
|
||||
<script id="seasonNumber-template" type="text/x-handlebars-template">
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<div id="seasonNumber{{seasonNumber}}">
|
||||
<strong>@UI.Search_Season {{seasonNumber}}</strong>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue