diff --git a/PlexRequests.UI/Modules/IssuesModule.cs b/PlexRequests.UI/Modules/IssuesModule.cs index 5371ae260..dd789c5fc 100644 --- a/PlexRequests.UI/Modules/IssuesModule.cs +++ b/PlexRequests.UI/Modules/IssuesModule.cs @@ -42,26 +42,8 @@ namespace PlexRequests.UI.Modules public async Task IssueCount() { var issues = await IssuesService.GetAllAsync(); - var settings = PlexRequestSettings.GetSettings(); - - IEnumerable myIssues; - - if (IsAdmin) - { - myIssues = issues.Where(x => x.Deleted == false).SelectMany(i => i.Issues); - } - else if (settings.UsersCanViewOnlyOwnRequests) - { - myIssues = (from issuesModel in issues - from i in issuesModel.Issues - where i.UserReported.Equals(Username, StringComparison.CurrentCultureIgnoreCase) - select i).ToList(); - } - else - { - myIssues = issues.Where(x => x.Deleted == false).SelectMany(i => i.Issues); - } + var myIssues = await FilterIssues(issues); var count = myIssues.Count(); @@ -125,5 +107,29 @@ namespace PlexRequests.UI.Modules return Response.AsJson(new JsonResponseModel { Result = true }); } + + private async Task> FilterIssues(IEnumerable issues) + { + var settings = await PlexRequestSettings.GetSettingsAsync(); + IEnumerable myIssues; + if (IsAdmin) + { + myIssues = issues.Where(x => x.Deleted == false).SelectMany(i => i.Issues); + } + else if (settings.UsersCanViewOnlyOwnRequests) + { + myIssues = (from issuesModel in issues + from i in issuesModel.Issues + where i.UserReported.Equals(Username, StringComparison.CurrentCultureIgnoreCase) + select i).ToList(); + } + else + { + myIssues = issues.Where(x => x.Deleted == false).SelectMany(i => i.Issues); + } + + return myIssues; + } + } } diff --git a/PlexRequests.UI/PlexRequests.UI.csproj b/PlexRequests.UI/PlexRequests.UI.csproj index 5abede801..708e7f098 100644 --- a/PlexRequests.UI/PlexRequests.UI.csproj +++ b/PlexRequests.UI/PlexRequests.UI.csproj @@ -513,6 +513,9 @@ Always + + Always + web.config diff --git a/PlexRequests.UI/Views/Issues/Details.cshtml b/PlexRequests.UI/Views/Issues/Details.cshtml new file mode 100644 index 000000000..b323e7495 --- /dev/null +++ b/PlexRequests.UI/Views/Issues/Details.cshtml @@ -0,0 +1,15 @@ + +

Details

+

Issues For @Model.Title

+
+ + + +@foreach (var issue in Model.Issues) +{ +
Type: @issue.Issue
+
User Reported: @issue.UserReported
+
User Note: @issue.UserNote
+
Admin Note: @issue.AdminNote
+
Status: @issue.IssueStatus
+} \ No newline at end of file