Fixed an issue where the table didn't match the model.

Fixed #67
pull/83/head
tidusjar 9 years ago
parent c4f57169ad
commit 59cf379d56

@ -73,7 +73,7 @@ namespace PlexRequests.Core
var passwordMatch = PasswordHasher.VerifyPassword(password, u.Salt, u.Hash);
if (passwordMatch)
{
return new Guid(u.User);
return new Guid(u.UserGuid);
}
}
}
@ -93,12 +93,12 @@ namespace PlexRequests.Core
var repo = new UserRepository<UsersModel>(Db);
var salt = PasswordHasher.GenerateSalt();
var userModel = new UsersModel { UserName = username, User = Guid.NewGuid().ToString(), Salt = salt, Hash = PasswordHasher.ComputeHash(password, salt)};
var userModel = new UsersModel { UserName = username, UserGuid = Guid.NewGuid().ToString(), Salt = salt, Hash = PasswordHasher.ComputeHash(password, salt)};
repo.Insert(userModel);
var userRecord = repo.Get(userModel.User);
var userRecord = repo.Get(userModel.UserGuid);
return new Guid(userRecord.User);
return new Guid(userRecord.UserGuid);
}
public static bool UpdateUser(string username, string oldPassword, string newPassword)

@ -32,7 +32,8 @@ namespace PlexRequests.Store
{
[Key]
public int Id { get; set; }
public string User { get; set; }
public string UserName { get; set; }
public string UserGuid { get; set; }
}
}

@ -39,7 +39,7 @@ namespace PlexRequests.Store
Config = config;
}
private ISqliteConfiguration Config { get; set; }
private ISqliteConfiguration Config { get; }
public long Insert(T entity)
{
using (var cnn = Config.DbConnection())
@ -65,7 +65,7 @@ namespace PlexRequests.Store
{
db.Open();
var result = db.GetAll<T>();
var selected = result.FirstOrDefault(x => x.User == id);
var selected = result.FirstOrDefault(x => x.UserGuid == id);
return selected;
}
}

@ -337,7 +337,8 @@ function buildRequestContext(result, type) {
issues: result.issues,
otherMessage: result.otherMessage,
requestId: result.id,
adminNote: result.adminNotes
adminNote: result.adminNotes,
imdb: result.imdbId
};
return context;

@ -139,7 +139,8 @@ function buildMovieContext(result) {
voteCount: result.voteCount,
voteAverage: result.voteAverage,
year: year,
type: "movie"
type: "movie",
imdb: result.imdbId
};
return context;
@ -154,7 +155,8 @@ function buildTvShowContext(result) {
title: result.seriesName,
overview: result.overview,
year: year,
type: "tv"
type: "tv",
imdb: result.imdbId
};
return context;
}

@ -94,7 +94,7 @@
</div>
<div class="col-sm-5 ">
<div>
<a href="https://www.themoviedb.org/{{type}}/{{id}}">
<a href="http://www.imdb.com/title/{{imdb}}/" targe="_blank">
<h4 class="request-title">{{title}} ({{year}})</h4>
</a>
<span class="label label-success">{{status}}</span>

@ -76,7 +76,7 @@
</div>
<div class="col-sm-5 ">
<div>
<a href="https://www.themoviedb.org/{{type}}/{{id}}">
<a href="http://www.imdb.com/title/{{imdb}}/" targe="_blank">
<h4>{{title}} ({{year}})</h4>
</a>
</div>

Loading…
Cancel
Save