mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 11:38:32 -07:00
Fixed an issue where we were retrying the API call when the Plex users login creds were invalid.
#1217 Also removed the Auto update button from the Update page
This commit is contained in:
parent
af023fb9d5
commit
41021240c9
4 changed files with 27 additions and 21 deletions
|
@ -77,8 +77,7 @@ namespace Ombi.Api
|
||||||
|
|
||||||
request.AddJsonBody(userModel);
|
request.AddJsonBody(userModel);
|
||||||
|
|
||||||
var obj = RetryHandler.Execute<PlexAuthentication>(() => Api.Execute<PlexAuthentication> (request, new Uri(SignInUri)),
|
var obj = Api.Execute<PlexAuthentication> (request, new Uri(SignInUri));
|
||||||
(exception, timespan) => Log.Error (exception, "Exception when calling SignIn for Plex, Retrying {0}", timespan));
|
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -520,14 +520,14 @@ namespace Ombi.UI.Modules.Admin
|
||||||
Message = "Plex is enabled, we cannot enable Plex and Emby"
|
Message = "Plex is enabled, we cannot enable Plex and Emby"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Get the users
|
// Get the users
|
||||||
var users = EmbyApi.GetUsers(emby.FullUri, emby.ApiKey);
|
var users = EmbyApi.GetUsers(emby.FullUri, emby.ApiKey);
|
||||||
// Find admin
|
// Find admin
|
||||||
var admin = users.FirstOrDefault(x => x.Policy.IsAdministrator);
|
var admin = users.FirstOrDefault(x => x.Policy.IsAdministrator);
|
||||||
emby.AdministratorId = admin?.Id;
|
emby.AdministratorId = admin?.Id;
|
||||||
|
}
|
||||||
var result = await EmbySettings.SaveSettingsAsync(emby);
|
var result = await EmbySettings.SaveSettingsAsync(emby);
|
||||||
|
|
||||||
return Response.AsJson(result
|
return Response.AsJson(result
|
||||||
|
|
|
@ -164,6 +164,8 @@ namespace Ombi.UI.Modules
|
||||||
if (plexSettings.Enable)
|
if (plexSettings.Enable)
|
||||||
{
|
{
|
||||||
if (settings.UserAuthentication) // Check against the users in Plex
|
if (settings.UserAuthentication) // Check against the users in Plex
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Log.Debug("Need to auth");
|
Log.Debug("Need to auth");
|
||||||
authenticated = CheckIfUserIsInPlexFriends(username, plexSettings.PlexAuthToken);
|
authenticated = CheckIfUserIsInPlexFriends(username, plexSettings.PlexAuthToken);
|
||||||
|
@ -180,6 +182,11 @@ namespace Ombi.UI.Modules
|
||||||
}
|
}
|
||||||
Log.Debug("Friends list result = {0}", authenticated);
|
Log.Debug("Friends list result = {0}", authenticated);
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return Response.AsJson(new { result = false, message = Resources.UI.UserLogin_IncorrectUserPass })
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (!settings.UserAuthentication) // No auth, let them pass!
|
else if (!settings.UserAuthentication) // No auth, let them pass!
|
||||||
{
|
{
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
|
|
|
@ -57,11 +57,11 @@
|
||||||
<label class="control-label"><a href="@Model.Status.UpdateUri" target="_blank"><i class="fa fa-check"></i></a> @Html.ToolTip("Click the 'tick' to manually go to the page")</label>
|
<label class="control-label"><a href="@Model.Status.UpdateUri" target="_blank"><i class="fa fa-check"></i></a> @Html.ToolTip("Click the 'tick' to manually go to the page")</label>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<label class="control-label">Launch Arguments</label>
|
@*<label class="control-label">Launch Arguments</label>
|
||||||
@Html.ToolTip("This is if you run Ombi outside of a regular install e.g. you are launching with a custom port. This field will be used after we have updated to launch the application.")
|
@Html.ToolTip("This is if you run Ombi outside of a regular install e.g. you are launching with a custom port. This field will be used after we have updated to launch the application.")
|
||||||
<input id="args" class="form-control form-control-custom " placeholder="/etc/mono /opt/Ombi.exe">
|
<input id="args" class="form-control form-control-custom " placeholder="/etc/mono /opt/Ombi.exe">
|
||||||
<br />
|
<br />
|
||||||
<button id="autoUpdate" class="btn btn-success-outline">Automatic Update (beta) <i class="fa fa-download"></i></button>
|
<button id="autoUpdate" class="btn btn-success-outline">Automatic Update (beta) <i class="fa fa-download"></i></button>*@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue