show the requested by user from legacy request models

pull/110/head
Drewster727 9 years ago
parent b8a01b62b9
commit cee7bee024

@ -87,7 +87,12 @@ namespace PlexRequests.UI.Modules
dbMovies = dbMovies.Where(x => x.UserHasRequested(Session[SessionKeys.UsernameKey].ToString()));
}
var viewModel = dbMovies.Select(movie => new RequestViewModel
var viewModel = dbMovies.Select(movie => {
if (!string.IsNullOrEmpty(movie.RequestedBy) && !movie.RequestedUsers.Any(x => x.Equals(movie.RequestedBy, StringComparison.OrdinalIgnoreCase)))
{
movie.RequestedUsers.Add(movie.RequestedBy);
}
return new RequestViewModel
{
ProviderId = movie.ProviderId,
Type = movie.Type,
@ -109,6 +114,7 @@ namespace PlexRequests.UI.Modules
Issues = movie.Issues.Humanize(LetterCasing.Title),
OtherMessage = movie.OtherMessage,
AdminNotes = movie.AdminNote
};
}).ToList();
return Response.AsJson(viewModel);
@ -124,7 +130,12 @@ namespace PlexRequests.UI.Modules
dbTv = dbTv.Where(x => x.UserHasRequested(Session[SessionKeys.UsernameKey].ToString()));
}
var viewModel = dbTv.Select(tv => new RequestViewModel
var viewModel = dbTv.Select(tv => {
if (!string.IsNullOrEmpty(tv.RequestedBy) && !tv.RequestedUsers.Any(x => x.Equals(tv.RequestedBy, StringComparison.OrdinalIgnoreCase)))
{
tv.RequestedUsers.Add(tv.RequestedBy);
}
return new RequestViewModel
{
ProviderId = tv.ProviderId,
Type = tv.Type,
@ -147,6 +158,7 @@ namespace PlexRequests.UI.Modules
OtherMessage = tv.OtherMessage,
AdminNotes = tv.AdminNote,
TvSeriesRequestType = tv.SeasonsRequested
};
}).ToList();
return Response.AsJson(viewModel);

Loading…
Cancel
Save