Merge pull request #883 from tidusjar/dev

Dev
pull/927/head^2
Jamie 8 years ago committed by GitHub
commit 92eacb9cc6

@ -0,0 +1,8 @@
using System;
namespace Ombi.Api.Models
{
public class WatcherResponse<T>
{
}
}

@ -74,6 +74,8 @@
} }
} }
if(Array.isArray($scope.users)){
var existingUsername = $scope.users.some(function (u) { var existingUsername = $scope.users.some(function (u) {
return u.username === $scope.user.username; return u.username === $scope.user.username;
}); });
@ -81,6 +83,7 @@
if (existingUsername) { if (existingUsername) {
return generateNotify("A user with the username " + $scope.user.username + " already exists!", 'danger'); return generateNotify("A user with the username " + $scope.user.username + " already exists!", 'danger');
} }
}
userManagementService.addUser($scope.user, $scope.selectedPermissions, $scope.selectedFeatures) userManagementService.addUser($scope.user, $scope.selectedPermissions, $scope.selectedFeatures)
.then(function (data) { .then(function (data) {
@ -92,6 +95,8 @@
clearCheckboxes(); clearCheckboxes();
}; };
}); });
}; };
// Watch the checkboxes for updates (Creating a user) // Watch the checkboxes for updates (Creating a user)

@ -86,23 +86,20 @@ namespace Ombi.UI.Modules
{ {
//Get Plex Users //Get Plex Users
var plexUsers = PlexApi.GetUsers(plexSettings.PlexAuthToken); var plexUsers = PlexApi.GetUsers(plexSettings.PlexAuthToken);
if (plexUsers != null && plexUsers.User != null) {
foreach (var u in plexUsers.User) foreach (var u in plexUsers.User) {
{ var dbUser = plexDbUsers.FirstOrDefault (x => x.PlexUserId == u.Id);
var dbUser = plexDbUsers.FirstOrDefault(x => x.PlexUserId == u.Id); var userDb = userLogins.FirstOrDefault (x => x.UserId == u.Id);
var userDb = userLogins.FirstOrDefault(x => x.UserId == u.Id);
// We don't have the user in the database yet
// We don't have the user in the database yet if (dbUser == null) {
if (dbUser == null) model.Add (MapPlexUser (u, null, userDb?.LastLoggedIn ?? DateTime.MinValue));
{ } else {
model.Add(MapPlexUser(u, null, userDb?.LastLoggedIn ?? DateTime.MinValue)); // The Plex User is in the database
} model.Add (MapPlexUser (u, dbUser, userDb?.LastLoggedIn ?? DateTime.MinValue));
else }
{ }
// The Plex User is in the database }
model.Add(MapPlexUser(u, dbUser, userDb?.LastLoggedIn ?? DateTime.MinValue));
}
}
// Also get the server admin // Also get the server admin
var account = PlexApi.GetAccount(plexSettings.PlexAuthToken); var account = PlexApi.GetAccount(plexSettings.PlexAuthToken);

@ -1,27 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">/************************************************************************&#xD;
Copyright (c) $CURRENT_YEAR$ Jamie Rees&#xD;
File: $FILENAME$&#xD;
Created By: $USER_NAME$&#xD;
&#xD;
Permission is hereby granted, free of charge, to any person obtaining&#xD;
a copy of this software and associated documentation files (the&#xD;
"Software"), to deal in the Software without restriction, including&#xD;
without limitation the rights to use, copy, modify, merge, publish,&#xD;
distribute, sublicense, and/or sell copies of the Software, and to&#xD;
permit persons to whom the Software is furnished to do so, subject to&#xD;
the following conditions:&#xD;
&#xD;
The above copyright notice and this permission notice shall be&#xD;
included in all copies or substantial portions of the Software.&#xD;
&#xD;
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,&#xD;
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF&#xD;
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND&#xD;
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE&#xD;
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION&#xD;
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION&#xD;
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&#xD;
************************************************************************/&#xD;
</s:String>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderRegionName/@EntryValue">Copyright</s:String></wpf:ResourceDictionary>
Loading…
Cancel
Save