From 068621e05d057a60a3ae53804ac3f611fbdd15bf Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 28 Oct 2018 23:41:18 +0000 Subject: [PATCH 01/80] New translations en.json (Dutch) --- src/Ombi/wwwroot/translations/nl.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ombi/wwwroot/translations/nl.json b/src/Ombi/wwwroot/translations/nl.json index 624650620..2d2178fd6 100644 --- a/src/Ombi/wwwroot/translations/nl.json +++ b/src/Ombi/wwwroot/translations/nl.json @@ -12,8 +12,8 @@ "Common": { "ContinueButton": "Doorgaan", "Available": "Beschikbaar", - "PartiallyAvailable": "Partially Available", - "Monitored": "Monitored", + "PartiallyAvailable": "Deels Beschikbaar", + "Monitored": "Gecontroleerd", "NotAvailable": "Niet Beschikbaar", "ProcessingRequest": "Verzoek wordt verwerkt", "PendingApproval": "Wacht op goedkeuring", @@ -48,7 +48,7 @@ "Requests": "Verzoeklijst", "UserManagement": "Gebruikersbeheer", "Issues": "Problemen", - "Vote": "Vote", + "Vote": "Stem", "Donate": "Doneer!", "DonateLibraryMaintainer": "Doneren aan bibliotheek beheerder", "DonateTooltip": "Zo heb ik mijn vrouw overtuigd dat ik Ombi mag ontwikkelen ;)", @@ -56,9 +56,9 @@ "Settings": "Instellingen", "Welcome": "Welkom {{username}}", "UpdateDetails": "Update gegevens", - "Logout": "Logout", + "Logout": "Afmelden", "OpenMobileApp": "Open Mobiele App", - "RecentlyAdded": "Recently Added" + "RecentlyAdded": "Onlangs Toegevoegd" }, "Search": { "Title": "Zoeken", @@ -68,7 +68,7 @@ "MusicTab": "Muziek", "Suggestions": "Suggesties", "NoResults": "Sorry, we hebben geen resultaten gevonden!", - "DigitalDate": "Digital Release: {{date}}", + "DigitalDate": "Digitale Uitgave: {{date}}", "TheatricalRelease": "Theatrical Release: {{date}}", "ViewOnPlex": "Bekijk op Plex", "ViewOnEmby": "Bekijk op Emby", From 499001e2669122c21d8474e3747ba2d370173a56 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 28 Oct 2018 23:51:19 +0000 Subject: [PATCH 02/80] New translations en.json (Dutch) --- src/Ombi/wwwroot/translations/nl.json | 44 +++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Ombi/wwwroot/translations/nl.json b/src/Ombi/wwwroot/translations/nl.json index 2d2178fd6..717d2287a 100644 --- a/src/Ombi/wwwroot/translations/nl.json +++ b/src/Ombi/wwwroot/translations/nl.json @@ -25,7 +25,7 @@ "Approve": "Accepteer", "PartlyAvailable": "Deels Beschikbaar", "Errors": { - "Validation": "Fout: Controleer de ingevulde waardes" + "Validation": "Controleer de ingevulde waardes" } }, "PasswordReset": { @@ -69,11 +69,11 @@ "Suggestions": "Suggesties", "NoResults": "Sorry, we hebben geen resultaten gevonden!", "DigitalDate": "Digitale Uitgave: {{date}}", - "TheatricalRelease": "Theatrical Release: {{date}}", + "TheatricalRelease": "Bioscoop Uitgave: {{date}}", "ViewOnPlex": "Bekijk op Plex", "ViewOnEmby": "Bekijk op Emby", "RequestAdded": "Aanvraag voor {{title}} is succesvol toegevoegd", - "Similar": "Similar", + "Similar": "Vergelijkbaar", "Movies": { "PopularMovies": "Populaire films", "UpcomingMovies": "Aankomende Films", @@ -108,10 +108,10 @@ "Status": "Status:", "RequestStatus": "Aanvraagstatus:", "Denied": " Geweigerd:", - "TheatricalRelease": "Theatrical Release: {{date}}", - "ReleaseDate": "Released: {{date}}", - "TheatricalReleaseSort": "Theatrical Release", - "DigitalRelease": "Digital Release: {{date}}", + "TheatricalRelease": "Cinema Uitgave: {{date}}", + "ReleaseDate": "Uitgekomen: {{date}}", + "TheatricalReleaseSort": "Bioscoop Uitgave", + "DigitalRelease": "Digitale Uitgave: {{date}}", "RequestDate": "Aanvraag Datum:", "QualityOverride": "Kwaliteit overschrijven:", "RootFolderOverride": "Hoofdmap overschrijven:", @@ -127,20 +127,20 @@ "GridStatus": "Status", "ReportIssue": "Probleem Melden", "Filter": "Filter", - "Sort": "Sort", + "Sort": "Sorteer", "SeasonNumberHeading": "Seizoen: {seasonNumber}", "SortTitleAsc": "Titel ▲", "SortTitleDesc": "Titel ▼", - "SortRequestDateAsc": "Request Date ▲", - "SortRequestDateDesc": "Request Date ▼", + "SortRequestDateAsc": "Aanvraag Datum ▲", + "SortRequestDateDesc": "Aanvraag Datum ▼", "SortStatusAsc": "Status ▲", "SortStatusDesc": "Status ▼", "Remaining": { - "Quota": "{{remaining}}/{{total}} requests remaining", - "NextDays": "Another request will be added in {{time}} days", - "NextHours": "Another request will be added in {{time}} hours", - "NextMinutes": "Another request will be added in {{time}} minutes", - "NextMinute": "Another request will be added in {{time}} minute" + "Quota": "{{remaining}}/{{total}} resterende aanvragen", + "NextDays": "Een ander verzoek zal worden toegevoegd in {{time}} Dagen", + "NextHours": "Een ander verzoek zal worden toegevoegd in {{time}} Dagen", + "NextMinutes": "Een ander verzoek zal worden toegevoegd in {{time}} Minuten", + "NextMinute": "Een ander verzoek zal worden toegevoegd in {{time}} Minuten" } }, "Issues": { @@ -167,18 +167,18 @@ "FilterHeaderAvailability": "Beschikbaarheid", "FilterHeaderRequestStatus": "Status", "Approved": "Goedgekeurd", - "PendingApproval": "Pending Approval" + "PendingApproval": "In afwachting van goedkeuring" }, "UserManagment": { - "TvRemaining": "TV: {{remaining}}/{{total}} remaining", - "MovieRemaining": "Movies: {{remaining}}/{{total}} remaining", - "MusicRemaining": "Music: {{remaining}}/{{total}} remaining", - "TvDue": "TV: {{date}}", + "TvRemaining": "Tv: {{remaining}}/{{total}} Resterend", + "MovieRemaining": "Tv: {{remaining}}/{{total}} Resterend", + "MusicRemaining": "Muziek: {{remaining}}/{{total}} Resterend", + "TvDue": "Tv: {{date}}", "MovieDue": "Film: {{date}}", "MusicDue": "Muziek: {{date}}" }, "Votes": { - "CompletedVotesTab": "Voted", - "VotesTab": "Votes Needed" + "CompletedVotesTab": "Gestemd", + "VotesTab": "Stemmen nodig" } } \ No newline at end of file From 60213b847eb6e00dd10a999c1c6cd12d16aa567e Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 29 Oct 2018 00:41:37 +0000 Subject: [PATCH 03/80] New translations en.json (Dutch) --- src/Ombi/wwwroot/translations/nl.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/wwwroot/translations/nl.json b/src/Ombi/wwwroot/translations/nl.json index 717d2287a..be58ba0d6 100644 --- a/src/Ombi/wwwroot/translations/nl.json +++ b/src/Ombi/wwwroot/translations/nl.json @@ -138,9 +138,9 @@ "Remaining": { "Quota": "{{remaining}}/{{total}} resterende aanvragen", "NextDays": "Een ander verzoek zal worden toegevoegd in {{time}} Dagen", - "NextHours": "Een ander verzoek zal worden toegevoegd in {{time}} Dagen", + "NextHours": "Een ander verzoek zal worden toegevoegd in {{time}} Uren", "NextMinutes": "Een ander verzoek zal worden toegevoegd in {{time}} Minuten", - "NextMinute": "Een ander verzoek zal worden toegevoegd in {{time}} Minuten" + "NextMinute": "Een ander verzoek zal worden toegevoegd in {{time}} Minuut" } }, "Issues": { From 5006bbec55b5e613b69eb1a364586226f95ad7d9 Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Sun, 9 Dec 2018 15:40:34 +0100 Subject: [PATCH 04/80] Rewritten the whole newsletter template. --- .../Templates/NewsletterTemplate.html | 278 ++++++++++++++---- 1 file changed, 213 insertions(+), 65 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index 450e7df2a..469f0dc90 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -1,10 +1,17 @@ - + + Ombi - - - + + +
- - - \ No newline at end of file + + From 2500c062709fd9659518ae49edbb919c73615d59 Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Tue, 11 Dec 2018 13:16:52 +0100 Subject: [PATCH 05/80] Update HtmlTemplateGenerator.cs --- .../Jobs/Ombi/HtmlTemplateGenerator.cs | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index 09b7d9858..0dba6d1d3 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -7,18 +7,18 @@ namespace Ombi.Schedule.Jobs.Ombi { protected virtual void AddBackgroundInsideTable(StringBuilder sb, string url) { - sb.Append(""); - sb.AppendFormat("", url); + sb.Append("
"); + sb.AppendFormat("", url); sb.Append(""); - sb.Append("
"); - sb.Append(""); + sb.Append("
"); + sb.Append(""); } protected virtual void AddPosterInsideTable(StringBuilder sb, string url) { sb.Append(""); - sb.Append("
"); - sb.AppendFormat("", url); + sb.Append("
"); + sb.AppendFormat("", url); } protected virtual void AddMediaServerUrl(StringBuilder sb, string mediaurl, string url) @@ -27,10 +27,10 @@ namespace Ombi.Schedule.Jobs.Ombi { sb.Append(""); sb.Append( - ""); @@ -44,16 +44,16 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddInfoTable(StringBuilder sb) { sb.Append( - "
"); + ""); sb.AppendFormat("", mediaurl); sb.AppendFormat( - "", + "", url); sb.Append(""); sb.Append(""); + ""); sb.Append(""); } protected virtual void AddTitle(StringBuilder sb, string url, string title) { - sb.Append(""); - sb.Append(""); + sb.Append(""); sb.Append(""); @@ -61,30 +61,30 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddParagraph(StringBuilder sb, string text) { - sb.Append(""); - sb.Append(""); + sb.Append(""); sb.Append(""); } protected virtual void AddTvParagraph(StringBuilder sb, string episodes, string summary) { - sb.Append(""); - sb.Append(""); + sb.Append(""); sb.Append(""); } protected virtual void AddGenres(StringBuilder sb, string text) { - sb.Append(""); - sb.Append(""); + sb.Append(""); sb.Append(""); } } -} \ No newline at end of file +} From a1026f8055d2351bf97062f67f95e944cec3681b Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Tue, 11 Dec 2018 13:17:24 +0100 Subject: [PATCH 06/80] Update NewsletterTemplate.html --- .../Templates/NewsletterTemplate.html | 126 ++++++++++++++++-- 1 file changed, 117 insertions(+), 9 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index 469f0dc90..f133cabb7 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -2,8 +2,8 @@ - - + + Ombi -
"); - if(url.HasValue()) sb.AppendFormat("", url); - sb.AppendFormat("

{0}

", title); + sb.Append("
"); + if(url.HasValue()) sb.AppendFormat("", url); + sb.AppendFormat("

{0}

", title); if (url.HasValue()) sb.Append("
"); sb.Append("
"); - sb.AppendFormat("

{0}

", text); + sb.Append("
"); + sb.AppendFormat("

{0}

", text); sb.Append("
"); - sb.AppendFormat("

{0}

", episodes); - sb.AppendFormat("
{0}
", summary); + sb.Append("
"); + sb.AppendFormat("

{0}

", episodes); + sb.AppendFormat("{0}"", summary); sb.Append("
"); - sb.AppendFormat("{0}", text); + sb.Append("
"); + sb.AppendFormat("{0}"", text); sb.Append("
From dfb15150794625f3c7b73427cb2f629d293f8e18 Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Tue, 11 Dec 2018 14:29:48 +0100 Subject: [PATCH 07/80] fixes build --- src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index 0dba6d1d3..96814402a 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -73,7 +73,7 @@ namespace Ombi.Schedule.Jobs.Ombi sb.Append(""); sb.Append(""); sb.Append(""); } @@ -82,7 +82,7 @@ namespace Ombi.Schedule.Jobs.Ombi { sb.Append(""); sb.Append(""); sb.Append(""); } From 960dbbcf4ecb6d32b372e1eb2902ee5d41603c2c Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Tue, 11 Dec 2018 15:00:32 +0100 Subject: [PATCH 08/80] this should fix the build for sure (stupid quotes) --- src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index 96814402a..366f666ac 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -73,7 +73,7 @@ namespace Ombi.Schedule.Jobs.Ombi sb.Append(""); sb.Append(""); sb.Append(""); } @@ -82,7 +82,7 @@ namespace Ombi.Schedule.Jobs.Ombi { sb.Append(""); sb.Append(""); sb.Append(""); } From c8b7229e53cecb893603ddea3756ab37b1c5b900 Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Tue, 11 Dec 2018 16:51:59 +0100 Subject: [PATCH 09/80] fixed titles --- src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index 366f666ac..ea4a071e7 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -50,10 +50,10 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddTitle(StringBuilder sb, string url, string title) { - sb.Append(""); + sb.Append(""); sb.Append(""); sb.Append(""); From b9ab0e486134c7ed8f5d42889de7041495e11aa9 Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Tue, 11 Dec 2018 16:52:13 +0100 Subject: [PATCH 10/80] Update NewsletterTemplate.html --- .../Templates/NewsletterTemplate.html | 116 ++++++++++-------- 1 file changed, 66 insertions(+), 50 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index f133cabb7..9f1f33f28 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -40,8 +40,7 @@ } table td { - font-family: sans-serif; - font-size: 14px; + font-family: 'Open Sans', Helvetica, Arial, sans-serif; vertical-align: top; } @@ -97,6 +96,7 @@ padding-top: 10px; } + .media-card { font-family: 'Open Sans', Helvetica, Arial, sans-serif; vertical-align: top; @@ -106,6 +106,7 @@ max-width: 500px; height: 252px; max-height: 252px; + min-height: 252px; } .card-bg { @@ -150,16 +151,17 @@ height: 227px; } - .title { + .title h1 { font-family: 'Open Sans', Helvetica, Arial, sans-serif; + font-size: 1.5rem; vertical-align: top; text-overflow: ellipsis; - overflow: hidden; - padding: 5px; - max-height: 130px; + padding-left: 5px; + max-height: 50px; max-width: 320px; overflow: hidden; display: block; + margin: 0; } .description { @@ -316,7 +318,8 @@ color: #ff761b; font-family: sans-serif; font-weight: 400; - line-height: 1.4; + font-size: 1.2rem; + line-height: 1.3rem; margin: 0 auto; text-transform: capitalize; } @@ -416,52 +419,65 @@ - - - - "); sb.Append(""); sb.Append(""); @@ -61,7 +61,7 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddParagraph(StringBuilder sb, string text) { - sb.Append(""); + sb.Append(""); sb.Append(""); From 2fbb76555d3c23fdf4acc33f7a3458c419423c0f Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Tue, 11 Dec 2018 22:44:35 +0100 Subject: [PATCH 12/80] Update NewsletterTemplate.html --- .../Templates/NewsletterTemplate.html | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index 9f1f33f28..c1849542d 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -144,7 +144,6 @@ .movie-info { font-family: 'Open Sans', Helvetica, Arial, sans-serif; - font-size: 14px; vertical-align: top; padding-left: 4px; text-align: left; @@ -153,13 +152,12 @@ .title h1 { font-family: 'Open Sans', Helvetica, Arial, sans-serif; - font-size: 1.5rem; + font-size: 1.3rem; + line-height: 1.4rem; vertical-align: top; - text-overflow: ellipsis; - padding-left: 5px; - max-height: 50px; max-width: 320px; overflow: hidden; + text-overflow: ellipsis; display: block; margin: 0; } @@ -167,14 +165,15 @@ .description { font-family: 'Open Sans', Helvetica, Arial, sans-serif; vertical-align: top; - padding: 5px; - height: 100%; + height: 130px; max-height: 130px; max-width: 320px; overflow: hidden; - display: block; + text-overflow: ellipsis; margin: 0px; + display: block; font-size: 0.8rem !important; + text-align: justify; } .meta { @@ -223,7 +222,7 @@ font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-weight: 400; line-height: 1.4rem; - font-size: 1.5rem; + font-size: 1.3rem; margin: 0; text-transform: capitalize; } @@ -234,7 +233,6 @@ font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-weight: normal; margin: 0; - margin-bottom: 15px; } p li, From 3e647249697e88efd32cbc3b794a26519dfce463 Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Thu, 13 Dec 2018 18:33:57 +0100 Subject: [PATCH 13/80] Update HtmlTemplateGenerator.cs --- src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index 000eba669..03f4ef96f 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -50,10 +50,10 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddTitle(StringBuilder sb, string url, string title) { - sb.Append(""); + sb.Append(""); sb.Append(""); sb.Append(""); From 9943a1b5a57fdda390b4bafa3a267ea820c75b6a Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Thu, 13 Dec 2018 18:34:07 +0100 Subject: [PATCH 14/80] Update NewsletterTemplate.html --- .../Templates/NewsletterTemplate.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index c1849542d..7a8baf7f0 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -160,6 +160,9 @@ text-overflow: ellipsis; display: block; margin: 0; + height: 100%; + min-height: 20px; + max-height: 45px; } .description { @@ -313,13 +316,9 @@ @media only screen and (max-width: 1059px) { table[class=body] h1 { - color: #ff761b; - font-family: sans-serif; - font-weight: 400; font-size: 1.2rem; line-height: 1.3rem; margin: 0 auto; - text-transform: capitalize; } table[class=body] p, From 27e15a76bc1236ac8970f75c752e945138f7e6a1 Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Thu, 13 Dec 2018 19:26:11 +0100 Subject: [PATCH 15/80] Update HtmlTemplateGenerator.cs --- src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index 03f4ef96f..a52abb16a 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -50,10 +50,10 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddTitle(StringBuilder sb, string url, string title) { - sb.Append(""); + sb.Append(""); sb.Append(""); sb.Append(""); From 14c40a106ea862f9788e5945167b45a123ba60da Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Thu, 13 Dec 2018 19:26:22 +0100 Subject: [PATCH 16/80] Update NewsletterTemplate.html --- .../Templates/NewsletterTemplate.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index 7a8baf7f0..436d87c28 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -156,8 +156,7 @@ line-height: 1.4rem; vertical-align: top; max-width: 320px; - overflow: hidden; - text-overflow: ellipsis; + white-space: normal; display: block; margin: 0; height: 100%; @@ -319,6 +318,7 @@ font-size: 1.2rem; line-height: 1.3rem; margin: 0 auto; + white-space: normal; } table[class=body] p, From a95e904c8b91cb471edc38de59ce06bb2fceee2d Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Thu, 13 Dec 2018 21:25:12 +0100 Subject: [PATCH 17/80] android please be nice now --- src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs index a52abb16a..412a19943 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/HtmlTemplateGenerator.cs @@ -50,10 +50,10 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddTitle(StringBuilder sb, string url, string title) { - sb.Append(""); + sb.Append(""); sb.Append(""); sb.Append(""); @@ -61,7 +61,7 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddParagraph(StringBuilder sb, string text) { - sb.Append(""); + sb.Append(""); sb.Append(""); @@ -70,7 +70,7 @@ namespace Ombi.Schedule.Jobs.Ombi protected virtual void AddTvParagraph(StringBuilder sb, string episodes, string summary) { - sb.Append(""); + sb.Append(""); sb.Append(""); + sb.Append(""); sb.Append(""); sb.Append(""); From cac08cf808e5cd0e73e4881ec4af63325b0cb6fa Mon Sep 17 00:00:00 2001 From: d1slact0r <3063928+d1slact0r@users.noreply.github.com> Date: Thu, 13 Dec 2018 21:57:40 +0100 Subject: [PATCH 20/80] Update NewsletterTemplate.html --- .../Templates/NewsletterTemplate.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html index 1095e93e5..5456743c9 100644 --- a/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/NewsletterTemplate.html @@ -156,10 +156,11 @@ line-height: 24px; vertical-align: top; max-width: 320px; + white-space: normal; display: block; - height: 100%; - min-height: 20px; - max-height: 45px; + height: 50px; + min-height: 50px; + max-height: 50px; } .description { @@ -312,8 +313,6 @@ @media only screen and (max-width: 1059px) { table[class=body] h1 { font-size: 22px; - padding: 0 !important; - margin: 0 !important; } table[class=body] p, From d67101cc0777094f90d8bb3bc29063a862ddb069 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sat, 15 Dec 2018 01:15:30 +0000 Subject: [PATCH 21/80] Update EmbyEpisodeSync.cs --- src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs index 23ad24268..2bb417d3d 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs @@ -83,7 +83,7 @@ namespace Ombi.Schedule.Jobs.Emby { processed++; - if (ep.LocationType.Equals("Virtual", StringComparison.InvariantCultureIgnoreCase)) + if (ep.LocationType?.Equals("Virtual", StringComparison.InvariantCultureIgnoreCase) ?? false) { // For some reason Emby is not respecting the `IsVirtualItem` field. continue; @@ -154,4 +154,4 @@ namespace Ombi.Schedule.Jobs.Emby GC.SuppressFinalize(this); } } -} \ No newline at end of file +} From 43e30ec0bb509ed6312f259a15755bc284e3273c Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 09:52:04 +0000 Subject: [PATCH 22/80] Updated to .net core 2.2 and included a linux-arm64 build --- appveyor.yml | 12 +++++----- build.cake | 21 ++---------------- .../Ombi.Api.Mattermost.csproj | 2 +- src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj | 2 +- src/Ombi.Api.Service/Ombi.Api.Service.csproj | 2 +- src/Ombi.Api/Ombi.Api.csproj | 4 ++-- src/Ombi.Core.Tests/Ombi.Core.Tests.csproj | 4 ++-- src/Ombi.Core/Ombi.Core.csproj | 8 +++---- .../Ombi.DependencyInjection.csproj | 6 ++--- src/Ombi.Helpers/Ombi.Helpers.csproj | 6 ++--- .../Ombi.Notifications.Tests.csproj | 4 ++-- .../Ombi.Schedule.Tests.csproj | 6 ++--- src/Ombi.Schedule/Ombi.Schedule.csproj | 6 ++--- src/Ombi.Settings/Ombi.Settings.csproj | 4 ++-- src/Ombi.Store/Ombi.Store.csproj | 10 ++++----- src/Ombi.Tests/Ombi.Tests.csproj | 6 ++--- src/Ombi.Updater/Ombi.Updater.csproj | 22 +++++++++---------- src/Ombi/Ombi.csproj | 20 ++++++++--------- 18 files changed, 64 insertions(+), 81 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 448e1b9c8..2715e44d7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,22 +27,22 @@ test: off after_build: - cmd: >- - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\windows.zip" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\windows.zip" - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\osx.tar.gz" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\osx.tar.gz" - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\linux.tar.gz" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux.tar.gz" - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\linux-arm.tar.gz" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.\linux-arm.tar.gz" - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.1\windows-32bit.zip" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\windows-32bit.zip" -# appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.0\linux-arm64.tar.gz" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux-arm64.tar.gz" diff --git a/build.cake b/build.cake index d706e7b6b..8333bd3a1 100644 --- a/build.cake +++ b/build.cake @@ -26,7 +26,7 @@ var csProj = "./src/Ombi/Ombi.csproj"; // Path to the project.csproj var solutionFile = "Ombi.sln"; // Solution file if needed GitVersion versionInfo = null; -var frameworkVer = "netcoreapp2.1"; +var frameworkVer = "netcoreapp2.2"; var buildSettings = new DotNetCoreBuildSettings { @@ -47,7 +47,6 @@ var windowsArtifactsFolder = artifactsFolder + "win10-x64/published"; var windows32BitArtifactsFolder = artifactsFolder + "win10-x86/published"; var osxArtifactsFolder = artifactsFolder + "osx-x64/published"; var linuxArtifactsFolder = artifactsFolder + "linux-x64/published"; -var linuxArmArtifactsFolder = artifactsFolder + "linux-arm/published"; var linuxArm64BitArtifactsFolder = artifactsFolder + "linux-arm64/published"; @@ -150,8 +149,7 @@ Task("Package") Zip(windows32BitArtifactsFolder +"/",artifactsFolder + "windows-32bit.zip"); GZipCompress(osxArtifactsFolder, artifactsFolder + "osx.tar.gz"); GZipCompress(linuxArtifactsFolder, artifactsFolder + "linux.tar.gz"); - GZipCompress(linuxArmArtifactsFolder, artifactsFolder + "linux-arm.tar.gz"); - //GZipCompress(linuxArm64BitArtifactsFolder, artifactsFolder + "linux-arm64.tar.gz"); + GZipCompress(linuxArm64BitArtifactsFolder, artifactsFolder + "linux-arm64.tar.gz"); }); Task("Publish") @@ -160,7 +158,6 @@ Task("Publish") .IsDependentOn("Publish-Windows-32bit") .IsDependentOn("Publish-OSX") .IsDependentOn("Publish-Linux") - .IsDependentOn("Publish-Linux-ARM") .IsDependentOn("Publish-Linux-ARM-64Bit") .IsDependentOn("Package"); @@ -217,20 +214,6 @@ Task("Publish-Linux") DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings); }); -Task("Publish-Linux-ARM") - .Does(() => -{ - publishSettings.Runtime = "linux-arm"; - publishSettings.OutputDirectory = Directory(buildDir) + Directory(frameworkVer+"/linux-arm/published"); - - DotNetCorePublish("./src/Ombi/Ombi.csproj", publishSettings); - CopyFile( - buildDir + "/"+frameworkVer+"/linux-arm/Swagger.xml", - buildDir + "/"+frameworkVer+"/linux-arm/published/Swagger.xml"); - - publishSettings.OutputDirectory = Directory(buildDir) + Directory(frameworkVer +"/linux-arm/published/updater"); - DotNetCorePublish("./src/Ombi.Updater/Ombi.Updater.csproj", publishSettings); -}); Task("Publish-Linux-ARM-64Bit") .Does(() => diff --git a/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj b/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj index 83318be7b..98292f463 100644 --- a/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj +++ b/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj index 0c615f301..9f25a7946 100644 --- a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj +++ b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Ombi.Api.Service/Ombi.Api.Service.csproj b/src/Ombi.Api.Service/Ombi.Api.Service.csproj index 8cbddd874..bd53c9808 100644 --- a/src/Ombi.Api.Service/Ombi.Api.Service.csproj +++ b/src/Ombi.Api.Service/Ombi.Api.Service.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Ombi.Api/Ombi.Api.csproj b/src/Ombi.Api/Ombi.Api.csproj index a37c128fb..e20dd6ccd 100644 --- a/src/Ombi.Api/Ombi.Api.csproj +++ b/src/Ombi.Api/Ombi.Api.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj index d20176ec4..23fc6db78 100644 --- a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj +++ b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp2.2 @@ -10,7 +10,7 @@ - + diff --git a/src/Ombi.Core/Ombi.Core.csproj b/src/Ombi.Core/Ombi.Core.csproj index 10e07822a..1748fcc2c 100644 --- a/src/Ombi.Core/Ombi.Core.csproj +++ b/src/Ombi.Core/Ombi.Core.csproj @@ -11,11 +11,11 @@ - - - + + + - + diff --git a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj index 028c37b43..ec905e718 100644 --- a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj +++ b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/src/Ombi.Helpers/Ombi.Helpers.csproj b/src/Ombi.Helpers/Ombi.Helpers.csproj index 2aaaa076f..5dedaff61 100644 --- a/src/Ombi.Helpers/Ombi.Helpers.csproj +++ b/src/Ombi.Helpers/Ombi.Helpers.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj b/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj index 5d5d3b9d0..5436dff22 100644 --- a/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj +++ b/src/Ombi.Notifications.Tests/Ombi.Notifications.Tests.csproj @@ -1,14 +1,14 @@  - netcoreapp2.1 + netcoreapp2.2 - + diff --git a/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj b/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj index ca07f635f..0c83dd755 100644 --- a/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj +++ b/src/Ombi.Schedule.Tests/Ombi.Schedule.Tests.csproj @@ -1,16 +1,16 @@ - netcoreapp2.1 + netcoreapp2.2 - + - + diff --git a/src/Ombi.Schedule/Ombi.Schedule.csproj b/src/Ombi.Schedule/Ombi.Schedule.csproj index 06cc2bb49..b262b79d2 100644 --- a/src/Ombi.Schedule/Ombi.Schedule.csproj +++ b/src/Ombi.Schedule/Ombi.Schedule.csproj @@ -10,13 +10,13 @@ - - + + - + diff --git a/src/Ombi.Settings/Ombi.Settings.csproj b/src/Ombi.Settings/Ombi.Settings.csproj index 19a415a47..6db0768aa 100644 --- a/src/Ombi.Settings/Ombi.Settings.csproj +++ b/src/Ombi.Settings/Ombi.Settings.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/Ombi.Store/Ombi.Store.csproj b/src/Ombi.Store/Ombi.Store.csproj index cdbd3fe84..f68d1d752 100644 --- a/src/Ombi.Store/Ombi.Store.csproj +++ b/src/Ombi.Store/Ombi.Store.csproj @@ -10,11 +10,11 @@ - - - - - + + + + + diff --git a/src/Ombi.Tests/Ombi.Tests.csproj b/src/Ombi.Tests/Ombi.Tests.csproj index 55c66b80c..fdfec1cb2 100644 --- a/src/Ombi.Tests/Ombi.Tests.csproj +++ b/src/Ombi.Tests/Ombi.Tests.csproj @@ -1,18 +1,18 @@ - netcoreapp2.1 + netcoreapp2.2 false - + - + diff --git a/src/Ombi.Updater/Ombi.Updater.csproj b/src/Ombi.Updater/Ombi.Updater.csproj index 07fb92d81..6220a100b 100644 --- a/src/Ombi.Updater/Ombi.Updater.csproj +++ b/src/Ombi.Updater/Ombi.Updater.csproj @@ -3,7 +3,7 @@ Exe win10-x64;win10-x86;osx-x64;ubuntu-x64;debian.8-x64;centos.7-x64;linux-x64;linux-arm;linux-arm64; - netcoreapp2.1 + netcoreapp2.2 3.0.0.0 3.0.0.0 @@ -12,17 +12,17 @@ - - - - - - - - - + + + + + + + + + - + \ No newline at end of file diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index 7489ad77f..cf3bff48f 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 - win10-x64;win10-x86;osx-x64;ubuntu-x64;debian.8-x64;centos.7-x64;linux-x64;linux-arm;linux-arm64; + netcoreapp2.2 + win10-x64;win10-x86;osx-x64;linux-x64;linux-arm64; false Latest $(SemVer) @@ -65,23 +65,23 @@ - + - - - - + + + + - + - + - + From 222871c22836c8ba06045c4e7b2e431782b65627 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 10:18:06 +0000 Subject: [PATCH 23/80] Fixed build --- appveyor.yml | 2 +- .../music-placeholder.psd | Bin package-lock.json | 291 ------------------ src/Ombi/Program.cs | 7 +- 4 files changed, 4 insertions(+), 296 deletions(-) rename music-placeholder.psd => assets/music-placeholder.psd (100%) delete mode 100644 package-lock.json diff --git a/appveyor.yml b/appveyor.yml index 2715e44d7..53d1263c6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,7 +42,7 @@ after_build: appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\windows-32bit.zip" - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux-arm64.tar.gz" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux-arm64.tar.gz" diff --git a/music-placeholder.psd b/assets/music-placeholder.psd similarity index 100% rename from music-placeholder.psd rename to assets/music-placeholder.psd diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 10c7546e4..000000000 --- a/package-lock.json +++ /dev/null @@ -1,291 +0,0 @@ -{ - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "1.0.3" - } - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - } - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "1.9.1" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "requires": { - "ansi-regex": "2.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" - }, - "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", - "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "1.1.11" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" - }, - "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", - "requires": { - "path-parse": "1.0.5" - } - }, - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "2.1.1" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - }, - "tslib": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.2.tgz", - "integrity": "sha512-AVP5Xol3WivEr7hnssHDsaM+lVrVXWUvd1cfXTRkTj80b//6g2wIFEH6hZG0muGZRnHGrfttpdzRk3YlBkWjKw==" - }, - "tslint": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", - "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", - "requires": { - "babel-code-frame": "6.26.0", - "builtin-modules": "1.1.1", - "chalk": "2.4.1", - "commander": "2.15.1", - "diff": "3.5.0", - "glob": "7.1.2", - "js-yaml": "3.12.0", - "minimatch": "3.0.4", - "resolve": "1.7.1", - "semver": "5.5.0", - "tslib": "1.9.2", - "tsutils": "2.27.1" - } - }, - "tsutils": { - "version": "2.27.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.1.tgz", - "integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==", - "requires": { - "tslib": "1.9.2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/src/Ombi/Program.cs b/src/Ombi/Program.cs index 3a11093d2..d9631410e 100644 --- a/src/Ombi/Program.cs +++ b/src/Ombi/Program.cs @@ -95,7 +95,7 @@ namespace Ombi Console.WriteLine($"We are running on {urlValue}"); - BuildWebHost(args).Run(); + CreateWebHostBuilder(args).Build().Run(); } /// @@ -245,12 +245,11 @@ namespace Ombi } } - public static IWebHost BuildWebHost(string[] args) => + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() .UseUrls(UrlArgs) - .PreferHostingUrls(true) - .Build(); + .PreferHostingUrls(true); private static string HelpOutput(ParserResult args) { From da841d173ad9f362ca4d5777af7c2529e5d518cc Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 10:46:37 +0000 Subject: [PATCH 24/80] fixed appveyor !wip --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 53d1263c6..2dfb5b17c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,7 +36,7 @@ after_build: appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux.tar.gz" - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.\linux-arm.tar.gz" + appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux-arm.tar.gz" appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\windows-32bit.zip" From f7d1ca66739b9b61c89da6776dd220909c178e12 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 12:06:06 +0000 Subject: [PATCH 25/80] Really did fix it this time !wip --- appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2dfb5b17c..edd53f512 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,9 +36,6 @@ after_build: appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux.tar.gz" - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\linux-arm.tar.gz" - - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp2.2\windows-32bit.zip" From 3c1f23ea92e6a30b148ebfebebbe72f14027fdb7 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:21:24 +0000 Subject: [PATCH 26/80] Fixed a bug with us thinking future dated emby episodes are not available, Consoldated the emby and plex search rules (since they have the same logic) --- .../Rule/Rules/Search/AvailabilityRuleBase.cs | 97 +++++++++++++++++++ .../Rule/Rules/Search/EmbyAvailabilityRule.cs | 45 ++++----- .../Rule/Rules/Search/PlexAvailabilityRule.cs | 50 ++-------- 3 files changed, 126 insertions(+), 66 deletions(-) create mode 100644 src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleBase.cs diff --git a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleBase.cs b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleBase.cs new file mode 100644 index 000000000..25cf30492 --- /dev/null +++ b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleBase.cs @@ -0,0 +1,97 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Query; +using Ombi.Core.Models.Search; +using Ombi.Store.Entities; +using Ombi.Store.Repository.Requests; + +namespace Ombi.Core.Rule.Rules.Search +{ + public abstract class AvailabilityRuleBase : BaseSearchRule + { + public void CheckForUnairedEpisodes(SearchTvShowViewModel search) + { + if (search.SeasonRequests.All(x => x.Episodes.All(e => e.Available))) + { + search.FullyAvailable = true; + } + else + { + var airedButNotAvailable = search.SeasonRequests.Any(x => + x.Episodes.Any(c => !c.Available && c.AirDate <= DateTime.Now.Date && c.AirDate != DateTime.MinValue)); + if (!airedButNotAvailable) + { + var unairedEpisodes = search.SeasonRequests.Any(x => + x.Episodes.Any(c => !c.Available && c.AirDate > DateTime.Now.Date)); + if (unairedEpisodes) + { + search.FullyAvailable = true; + } + } + } + } + + public async Task SingleEpisodeCheck(bool useImdb, IQueryable allEpisodes, EpisodeRequests episode, + SeasonRequests season, PlexServerContent item, bool useTheMovieDb, bool useTvDb) + { + PlexEpisode epExists = null; + if (useImdb) + { + epExists = await allEpisodes.FirstOrDefaultAsync(x => + x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && + x.Series.ImdbId == item.ImdbId.ToString()); + } + + if (useTheMovieDb) + { + epExists = await allEpisodes.FirstOrDefaultAsync(x => + x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && + x.Series.TheMovieDbId == item.TheMovieDbId.ToString()); + } + + if (useTvDb) + { + epExists = await allEpisodes.FirstOrDefaultAsync(x => + x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && + x.Series.TvDbId == item.TvDbId.ToString()); + } + + if (epExists != null) + { + episode.Available = true; + } + } + public async Task SingleEpisodeCheck(bool useImdb, IQueryable allEpisodes, EpisodeRequests episode, + SeasonRequests season, EmbyContent item, bool useTheMovieDb, bool useTvDb) + { + EmbyEpisode epExists = null; + if (useImdb) + { + epExists = await allEpisodes.FirstOrDefaultAsync(x => + x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && + x.Series.ImdbId == item.ImdbId.ToString()); + } + + if (useTheMovieDb) + { + epExists = await allEpisodes.FirstOrDefaultAsync(x => + x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && + x.Series.TheMovieDbId == item.TheMovieDbId.ToString()); + } + + if (useTvDb) + { + epExists = await allEpisodes.FirstOrDefaultAsync(x => + x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && + x.Series.TvDbId == item.TvDbId.ToString()); + } + + if (epExists != null) + { + episode.Available = true; + } + } + } +} \ No newline at end of file diff --git a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs index 486de9ea8..0d7c56372 100644 --- a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs @@ -3,15 +3,17 @@ using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Query; using Ombi.Core.Models.Search; using Ombi.Core.Rule.Interfaces; using Ombi.Helpers; using Ombi.Store.Entities; using Ombi.Store.Repository; +using Ombi.Store.Repository.Requests; namespace Ombi.Core.Rule.Rules.Search { - public class EmbyAvailabilityRule : BaseSearchRule, IRules + public class EmbyAvailabilityRule : AvailabilityRuleBase, IRules { public EmbyAvailabilityRule(IEmbyContentRepository repo) { @@ -23,15 +25,27 @@ namespace Ombi.Core.Rule.Rules.Search public async Task Execute(SearchViewModel obj) { EmbyContent item = null; + var useImdb = false; + var useTheMovieDb = false; + var useTvDb = false; + if (obj.ImdbId.HasValue()) { item = await EmbyContentRepository.GetByImdbId(obj.ImdbId); + if (item != null) + { + useImdb = true; + } } if (item == null) { if (obj.TheMovieDbId.HasValue()) { item = await EmbyContentRepository.GetByTheMovieDbId(obj.TheMovieDbId); + if (item != null) + { + useTheMovieDb = true; + } } if (item == null) @@ -39,10 +53,14 @@ namespace Ombi.Core.Rule.Rules.Search if (obj.TheTvDbId.HasValue()) { item = await EmbyContentRepository.GetByTvDbId(obj.TheTvDbId); + if (item != null) + { + useTvDb = true; + } } } } - + if (item != null) { obj.Available = true; @@ -59,29 +77,12 @@ namespace Ombi.Core.Rule.Rules.Search { foreach (var episode in season.Episodes) { - EmbyEpisode epExists = null; - - if (item.HasImdb) - { - epExists = await allEpisodes.FirstOrDefaultAsync(e => e.EpisodeNumber == episode.EpisodeNumber && e.SeasonNumber == season.SeasonNumber - && e.ImdbId == item.ImdbId); - } if (item.HasTvDb && epExists == null) - { - epExists = await allEpisodes.FirstOrDefaultAsync(e => e.EpisodeNumber == episode.EpisodeNumber && e.SeasonNumber == season.SeasonNumber - && e.Series.TvDbId == item.TvDbId); - } if (item.HasTheMovieDb && epExists == null) - { - epExists = await allEpisodes.FirstOrDefaultAsync(e => e.EpisodeNumber == episode.EpisodeNumber && e.SeasonNumber == season.SeasonNumber - && e.TheMovieDbId == item.TheMovieDbId); - } - - if (epExists != null) - { - episode.Available = true; - } + await SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb); } } } + + CheckForUnairedEpisodes(search); } } return Success(); diff --git a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs index e1ddcecd0..575d49d62 100644 --- a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs @@ -7,10 +7,11 @@ using Ombi.Core.Rule.Interfaces; using Ombi.Helpers; using Ombi.Store.Entities; using Ombi.Store.Repository; +using Ombi.Store.Repository.Requests; namespace Ombi.Core.Rule.Rules.Search { - public class PlexAvailabilityRule : BaseSearchRule, IRules + public class PlexAvailabilityRule : AvailabilityRuleBase, IRules { public PlexAvailabilityRule(IPlexContentRepository repo) { @@ -74,56 +75,17 @@ namespace Ombi.Core.Rule.Rules.Search { foreach (var episode in season.Episodes) { - PlexEpisode epExists = null; - if (useImdb) - { - epExists = await allEpisodes.FirstOrDefaultAsync(x => - x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && - x.Series.ImdbId == item.ImdbId.ToString()); - } - if (useTheMovieDb) - { - epExists = await allEpisodes.FirstOrDefaultAsync(x => - x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && - x.Series.TheMovieDbId == item.TheMovieDbId.ToString()); - } - if (useTvDb) - { - epExists = await allEpisodes.FirstOrDefaultAsync(x => - x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && - x.Series.TvDbId == item.TvDbId.ToString()); - } - - if (epExists != null) - { - episode.Available = true; - } + await SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb); } } - if (search.SeasonRequests.All(x => x.Episodes.All(e => e.Available))) - { - search.FullyAvailable = true; - } - else - { - var airedButNotAvailable = search.SeasonRequests.Any(x => - x.Episodes.Any(c => !c.Available && c.AirDate <= DateTime.Now.Date)); - if (!airedButNotAvailable) - { - var unairedEpisodes = search.SeasonRequests.Any(x => - x.Episodes.Any(c => !c.Available && c.AirDate > DateTime.Now.Date)); - if (unairedEpisodes) - { - search.FullyAvailable = true; - } - } - - } + CheckForUnairedEpisodes(search); } } } return Success(); } + + } } \ No newline at end of file From 0cc57c3c1fd5b003b3ef051c683f948935c3459e Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:31:04 +0000 Subject: [PATCH 27/80] !wip improved the API's documentation started on the deny reason --- src/Ombi.Core/Engine/IMusicRequestEngine.cs | 2 +- .../Engine/Interfaces/IMovieRequestEngine.cs | 2 +- .../Engine/Interfaces/ITvRequestEngine.cs | 2 +- src/Ombi.Core/Engine/MovieRequestEngine.cs | 3 +- src/Ombi.Core/Engine/MusicRequestEngine.cs | 3 +- src/Ombi.Core/Engine/TvRequestEngine.cs | 3 +- .../Rule/Rules/Search/EmbyAvailabilityRule.cs | 6 +--- .../Rule/Rules/Search/PlexAvailabilityRule.cs | 5 +-- .../Controllers/External/PlexController.cs | 1 - src/Ombi/Controllers/IdentityController.cs | 6 ++-- src/Ombi/Controllers/ImagesController.cs | 3 +- src/Ombi/Controllers/IssuesController.cs | 3 +- src/Ombi/Controllers/JobController.cs | 3 +- src/Ombi/Controllers/LandingPageController.cs | 3 +- src/Ombi/Controllers/LoggingController.cs | 3 +- src/Ombi/Controllers/MobileController.cs | 5 ++- .../Controllers/MusicRequestController.cs | 7 ++-- .../Controllers/NotificationsController.cs | 3 +- src/Ombi/Controllers/PlexOAuthController.cs | 1 + .../Controllers/RecentlyAddedController.cs | 3 +- src/Ombi/Controllers/RequestController.cs | 14 ++++---- .../Controllers/RequestRetryController.cs | 1 + src/Ombi/Controllers/SearchController.cs | 3 +- src/Ombi/Controllers/SettingsController.cs | 3 +- src/Ombi/Controllers/StatsController.cs | 3 +- src/Ombi/Controllers/StatusController.cs | 3 +- src/Ombi/Controllers/TokenController.cs | 8 ++++- src/Ombi/Controllers/UpdateController.cs | 3 +- src/Ombi/Controllers/VoteController.cs | 3 +- src/Ombi/Models/DenyAlbumMOdel.cs | 33 +++++++++++++++++++ src/Ombi/Models/DenyMovieModel.cs | 33 +++++++++++++++++++ src/Ombi/Models/DenyTvModel.cs | 33 +++++++++++++++++++ src/Ombi/Ombi.csproj | 2 ++ src/Ombi/Startup.cs | 3 ++ 34 files changed, 168 insertions(+), 44 deletions(-) create mode 100644 src/Ombi/Models/DenyAlbumMOdel.cs create mode 100644 src/Ombi/Models/DenyMovieModel.cs create mode 100644 src/Ombi/Models/DenyTvModel.cs diff --git a/src/Ombi.Core/Engine/IMusicRequestEngine.cs b/src/Ombi.Core/Engine/IMusicRequestEngine.cs index 5caba8a34..02a051343 100644 --- a/src/Ombi.Core/Engine/IMusicRequestEngine.cs +++ b/src/Ombi.Core/Engine/IMusicRequestEngine.cs @@ -12,7 +12,7 @@ namespace Ombi.Core.Engine { TaskApproveAlbum(AlbumRequest request); Task ApproveAlbumById(int requestId); - Task DenyAlbumById(int modelId); + Task DenyAlbumById(int modelId, string reason); Task> GetRequests(); Task> GetRequests(int count, int position, OrderFilterModel orderFilter); Task GetTotal(); diff --git a/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs b/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs index bb8b9e64d..d741dc8bc 100644 --- a/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs @@ -17,6 +17,6 @@ namespace Ombi.Core.Engine.Interfaces Task UpdateMovieRequest(MovieRequests request); Task ApproveMovie(MovieRequests request); Task ApproveMovieById(int requestId); - Task DenyMovieById(int modelId); + Task DenyMovieById(int modelId, string denyReason); } } \ No newline at end of file diff --git a/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs b/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs index 36ae7da61..63de72bd1 100644 --- a/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs +++ b/src/Ombi.Core/Engine/Interfaces/ITvRequestEngine.cs @@ -12,7 +12,7 @@ namespace Ombi.Core.Engine.Interfaces Task RemoveTvRequest(int requestId); Task GetTvRequest(int requestId); Task RequestTvShow(TvRequestViewModel tv); - Task DenyChildRequest(int requestId); + Task DenyChildRequest(int requestId, string reason); Task> GetRequestsLite(int count, int position, OrderFilterModel type); Task> SearchTvRequest(string search); Task UpdateTvRequest(TvRequests request); diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index 16fd7667b..fcbb0ac3b 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -305,7 +305,7 @@ namespace Ombi.Core.Engine return await ApproveMovie(request); } - public async Task DenyMovieById(int modelId) + public async Task DenyMovieById(int modelId, string denyReason) { var request = await MovieRepository.Find(modelId); if (request == null) @@ -317,6 +317,7 @@ namespace Ombi.Core.Engine } request.Denied = true; + request.DeniedReason = denyReason; // We are denying a request NotificationHelper.Notify(request, NotificationType.RequestDeclined); await MovieRepository.Update(request); diff --git a/src/Ombi.Core/Engine/MusicRequestEngine.cs b/src/Ombi.Core/Engine/MusicRequestEngine.cs index 185f86c37..66be18cf6 100644 --- a/src/Ombi.Core/Engine/MusicRequestEngine.cs +++ b/src/Ombi.Core/Engine/MusicRequestEngine.cs @@ -299,7 +299,7 @@ namespace Ombi.Core.Engine return await ApproveAlbum(request); } - public async Task DenyAlbumById(int modelId) + public async Task DenyAlbumById(int modelId, string reason) { var request = await MusicRepository.Find(modelId); if (request == null) @@ -311,6 +311,7 @@ namespace Ombi.Core.Engine } request.Denied = true; + request.DeniedReason = reason; // We are denying a request NotificationHelper.Notify(request, NotificationType.RequestDeclined); await MusicRepository.Update(request); diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index 290bedd6b..ddcc22d7b 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -403,7 +403,7 @@ namespace Ombi.Core.Engine }; } - public async Task DenyChildRequest(int requestId) + public async Task DenyChildRequest(int requestId, string reason) { var request = await TvRepository.GetChild().FirstOrDefaultAsync(x => x.Id == requestId); if (request == null) @@ -414,6 +414,7 @@ namespace Ombi.Core.Engine }; } request.Denied = true; + request.DeniedReason = reason; await TvRepository.UpdateChild(request); NotificationHelper.Notify(request, NotificationType.RequestDeclined); return new RequestEngineResult diff --git a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs index 0d7c56372..e125d9f59 100644 --- a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs @@ -1,15 +1,11 @@ -using System; -using System.Linq; -using System.Linq.Expressions; +using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Query; using Ombi.Core.Models.Search; using Ombi.Core.Rule.Interfaces; using Ombi.Helpers; using Ombi.Store.Entities; using Ombi.Store.Repository; -using Ombi.Store.Repository.Requests; namespace Ombi.Core.Rule.Rules.Search { diff --git a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs index 575d49d62..a9458fb23 100644 --- a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs @@ -1,13 +1,10 @@ -using System; -using System.Linq; +using System.Linq; using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; using Ombi.Core.Models.Search; using Ombi.Core.Rule.Interfaces; using Ombi.Helpers; using Ombi.Store.Entities; using Ombi.Store.Repository; -using Ombi.Store.Repository.Requests; namespace Ombi.Core.Rule.Rules.Search { diff --git a/src/Ombi/Controllers/External/PlexController.cs b/src/Ombi/Controllers/External/PlexController.cs index f0492b580..9f7df05ad 100644 --- a/src/Ombi/Controllers/External/PlexController.cs +++ b/src/Ombi/Controllers/External/PlexController.cs @@ -185,7 +185,6 @@ namespace Ombi.Controllers.External /// /// Gets the plex servers. /// - /// The u. /// [HttpGet("servers")] [PowerUser] diff --git a/src/Ombi/Controllers/IdentityController.cs b/src/Ombi/Controllers/IdentityController.cs index f963db0b8..ec884ace6 100644 --- a/src/Ombi/Controllers/IdentityController.cs +++ b/src/Ombi/Controllers/IdentityController.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; -using System.Web; using AutoMapper; using Hangfire; using Microsoft.AspNetCore.Authorization; @@ -11,10 +10,8 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using Ombi.Api.Plex; using Ombi.Attributes; -using Ombi.Config; using Ombi.Core.Authentication; using Ombi.Core.Engine; using Ombi.Core.Engine.Interfaces; @@ -45,6 +42,7 @@ namespace Ombi.Controllers /// [ApiV1] [Produces("application/json")] + [ApiController] public class IdentityController : Controller { public IdentityController(OmbiUserManager user, IMapper mapper, RoleManager rm, IEmailProvider prov, @@ -935,6 +933,8 @@ namespace Ombi.Controllers } [HttpPost("NotificationPreferences")] + [ProducesResponseType(404)] + [ProducesResponseType(401)] public async Task AddUserNotificationPreference([FromBody] List preferences) { foreach (var pref in preferences) diff --git a/src/Ombi/Controllers/ImagesController.cs b/src/Ombi/Controllers/ImagesController.cs index acbdfb9bc..39de92c71 100644 --- a/src/Ombi/Controllers/ImagesController.cs +++ b/src/Ombi/Controllers/ImagesController.cs @@ -16,7 +16,8 @@ namespace Ombi.Controllers { [ApiV1] [Produces("application/json")] - public class ImagesController : Controller + [ApiController] + public class ImagesController : ControllerBase { public ImagesController(IFanartTvApi fanartTvApi, IApplicationConfigRepository config, IOptions options, ICacheService c) diff --git a/src/Ombi/Controllers/IssuesController.cs b/src/Ombi/Controllers/IssuesController.cs index a228a63ef..1a5af5446 100644 --- a/src/Ombi/Controllers/IssuesController.cs +++ b/src/Ombi/Controllers/IssuesController.cs @@ -23,7 +23,8 @@ namespace Ombi.Controllers [ApiV1] [Authorize] [Produces("application/json")] - public class IssuesController : Controller + [ApiController] + public class IssuesController : ControllerBase { public IssuesController(IRepository categories, IRepository issues, IRepository comments, UserManager userManager, INotificationService notify) diff --git a/src/Ombi/Controllers/JobController.cs b/src/Ombi/Controllers/JobController.cs index a89346250..cec8d2c45 100644 --- a/src/Ombi/Controllers/JobController.cs +++ b/src/Ombi/Controllers/JobController.cs @@ -16,7 +16,8 @@ namespace Ombi.Controllers [ApiV1] [Admin] [Produces("application/json")] - public class JobController : Controller + [ApiController] + public class JobController : ControllerBase { public JobController(IOmbiAutomaticUpdater updater, IPlexUserImporter userImporter, ICacheService mem, IEmbyUserImporter embyImporter, IPlexContentSync plexContentSync, diff --git a/src/Ombi/Controllers/LandingPageController.cs b/src/Ombi/Controllers/LandingPageController.cs index e495f2cf3..6b1c27656 100644 --- a/src/Ombi/Controllers/LandingPageController.cs +++ b/src/Ombi/Controllers/LandingPageController.cs @@ -14,7 +14,8 @@ namespace Ombi.Controllers [ApiV1] [AllowAnonymous] [Produces("application/json")] - public class LandingPageController + [ApiController] + public class LandingPageController : ControllerBase { public LandingPageController(ISettingsService plex, ISettingsService emby, IPlexApi plexApi, IEmbyApi embyApi) diff --git a/src/Ombi/Controllers/LoggingController.cs b/src/Ombi/Controllers/LoggingController.cs index c6879da39..c944825af 100644 --- a/src/Ombi/Controllers/LoggingController.cs +++ b/src/Ombi/Controllers/LoggingController.cs @@ -9,7 +9,8 @@ namespace Ombi.Controllers [Authorize] [ApiV1] [Produces("application/json")] - public class LoggingController : Controller + [ApiController] + public class LoggingController : ControllerBase { public LoggingController(ILogger logger) { diff --git a/src/Ombi/Controllers/MobileController.cs b/src/Ombi/Controllers/MobileController.cs index 70a6f1053..c3b15a910 100644 --- a/src/Ombi/Controllers/MobileController.cs +++ b/src/Ombi/Controllers/MobileController.cs @@ -17,7 +17,8 @@ namespace Ombi.Controllers [ApiV1] [Authorize] [Produces("application/json")] - public class MobileController : Controller + [ApiController] + public class MobileController : ControllerBase { public MobileController(IRepository notification, OmbiUserManager user) { @@ -30,6 +31,8 @@ namespace Ombi.Controllers [HttpPost("Notification")] [ApiExplorerSettings(IgnoreApi = true)] + [ProducesResponseType(400)] + [ProducesResponseType(200)] public async Task AddNotitficationId([FromBody] NotificationIdBody body) { if (body?.PlayerId.HasValue() ?? false) diff --git a/src/Ombi/Controllers/MusicRequestController.cs b/src/Ombi/Controllers/MusicRequestController.cs index fee0cc39d..ea3f615f0 100644 --- a/src/Ombi/Controllers/MusicRequestController.cs +++ b/src/Ombi/Controllers/MusicRequestController.cs @@ -17,7 +17,8 @@ namespace Ombi.Controllers [Authorize] [Route("api/v1/request/music")] [Produces("application/json")] - public class MusicRequestController : Controller + [ApiController] + public class MusicRequestController : ControllerBase { public MusicRequestController(IMusicRequestEngine engine, IVoteEngine voteEngine, ILogger log) { @@ -154,9 +155,9 @@ namespace Ombi.Controllers /// [HttpPut("deny")] [PowerUser] - public async Task Deny([FromBody] AlbumUpdateModel model) + public async Task Deny([FromBody] DenyAlbumModel model) { - return await _engine.DenyAlbumById(model.Id); + return await _engine.DenyAlbumById(model.Id, model.Reason); } /// diff --git a/src/Ombi/Controllers/NotificationsController.cs b/src/Ombi/Controllers/NotificationsController.cs index a881a89d3..8fe453d3d 100644 --- a/src/Ombi/Controllers/NotificationsController.cs +++ b/src/Ombi/Controllers/NotificationsController.cs @@ -36,7 +36,8 @@ namespace Ombi.Controllers [Admin] [ApiV1] [Produces("application/json")] - public class NotificationsController : Controller + [ApiController] + public class NotificationsController : ControllerBase { public NotificationsController(IMassEmailSender sender) { diff --git a/src/Ombi/Controllers/PlexOAuthController.cs b/src/Ombi/Controllers/PlexOAuthController.cs index 2aad2a2a9..fe78435c9 100644 --- a/src/Ombi/Controllers/PlexOAuthController.cs +++ b/src/Ombi/Controllers/PlexOAuthController.cs @@ -20,6 +20,7 @@ namespace Ombi.Controllers [ApiExplorerSettings(IgnoreApi = true)] [ApiV1] [AllowAnonymous] + [ApiController] public class PlexOAuthController : Controller { public PlexOAuthController(IPlexOAuthManager manager, IPlexApi plexApi, ISettingsService plexSettings, diff --git a/src/Ombi/Controllers/RecentlyAddedController.cs b/src/Ombi/Controllers/RecentlyAddedController.cs index fb4446efd..a56750449 100644 --- a/src/Ombi/Controllers/RecentlyAddedController.cs +++ b/src/Ombi/Controllers/RecentlyAddedController.cs @@ -12,7 +12,8 @@ namespace Ombi.Controllers [ApiV1] [Produces("application/json")] [Authorize] - public class RecentlyAddedController : Controller + [ApiController] + public class RecentlyAddedController : ControllerBase { public RecentlyAddedController(IRecentlyAddedEngine engine) { diff --git a/src/Ombi/Controllers/RequestController.cs b/src/Ombi/Controllers/RequestController.cs index 9e13e1c90..b3cccf9d1 100644 --- a/src/Ombi/Controllers/RequestController.cs +++ b/src/Ombi/Controllers/RequestController.cs @@ -20,7 +20,8 @@ namespace Ombi.Controllers [Authorize] [ApiV1] [Produces("application/json")] - public class RequestController : Controller + [ApiController] + public class RequestController : ControllerBase { public RequestController(IMovieRequestEngine engine, ITvRequestEngine tvRequestEngine, IVoteEngine vote, ILogger log) @@ -118,9 +119,8 @@ namespace Ombi.Controllers } /// - /// Deletes the specified movie request. + /// Deletes the all movie request. /// - /// The request identifier. /// [HttpDelete("movie/all")] [PowerUser] @@ -184,9 +184,9 @@ namespace Ombi.Controllers /// [HttpPut("movie/deny")] [PowerUser] - public async Task DenyMovie([FromBody] MovieUpdateModel model) + public async Task DenyMovie([FromBody] DenyMovieModel model) { - return await MovieRequestEngine.DenyMovieById(model.Id); + return await MovieRequestEngine.DenyMovieById(model.Id, model.Reason); } /// @@ -372,9 +372,9 @@ namespace Ombi.Controllers /// [HttpPut("tv/deny")] [PowerUser] - public async Task DenyChild([FromBody] TvUpdateModel model) + public async Task DenyChild([FromBody] DenyTvModel model) { - return await TvRequestEngine.DenyChildRequest(model.Id); + return await TvRequestEngine.DenyChildRequest(model.Id, model.Reason); } /// diff --git a/src/Ombi/Controllers/RequestRetryController.cs b/src/Ombi/Controllers/RequestRetryController.cs index b8ad2759e..12208978a 100644 --- a/src/Ombi/Controllers/RequestRetryController.cs +++ b/src/Ombi/Controllers/RequestRetryController.cs @@ -16,6 +16,7 @@ namespace Ombi.Controllers [ApiV1] [Admin] [Produces("application/json")] + [ApiController] public class RequestRetryController : Controller { public RequestRetryController(IRepository requestQueue, IMovieRequestRepository movieRepo, diff --git a/src/Ombi/Controllers/SearchController.cs b/src/Ombi/Controllers/SearchController.cs index 2a7327481..0a0d08ea1 100644 --- a/src/Ombi/Controllers/SearchController.cs +++ b/src/Ombi/Controllers/SearchController.cs @@ -17,7 +17,8 @@ namespace Ombi.Controllers [Authorize] [ApiV1] [Produces("application/json")] - public class SearchController : Controller + [ApiController] + public class SearchController : ControllerBase { public SearchController(IMovieEngine movie, ITvSearchEngine tvEngine, ILogger logger, IMusicSearchEngine music) { diff --git a/src/Ombi/Controllers/SettingsController.cs b/src/Ombi/Controllers/SettingsController.cs index 6b9476ce6..a02e966c1 100644 --- a/src/Ombi/Controllers/SettingsController.cs +++ b/src/Ombi/Controllers/SettingsController.cs @@ -37,7 +37,8 @@ namespace Ombi.Controllers [Admin] [ApiV1] [Produces("application/json")] - public class SettingsController : Controller + [ApiController] + public class SettingsController : ControllerBase { public SettingsController(ISettingsResolver resolver, IMapper mapper, diff --git a/src/Ombi/Controllers/StatsController.cs b/src/Ombi/Controllers/StatsController.cs index 0d871d80f..08d98b2c3 100644 --- a/src/Ombi/Controllers/StatsController.cs +++ b/src/Ombi/Controllers/StatsController.cs @@ -10,7 +10,8 @@ namespace Ombi.Controllers [Admin] [Authorize] [Produces("application/json")] - public class StatsController : Controller + [ApiController] + public class StatsController : ControllerBase { public StatsController(IUserStatsEngine eng) { diff --git a/src/Ombi/Controllers/StatusController.cs b/src/Ombi/Controllers/StatusController.cs index bc0fd3908..a3e36fb43 100644 --- a/src/Ombi/Controllers/StatusController.cs +++ b/src/Ombi/Controllers/StatusController.cs @@ -37,7 +37,8 @@ namespace Ombi.Controllers { [ApiV1] [Produces("application/json")] - public class StatusController : Controller + [ApiController] + public class StatusController : ControllerBase { public StatusController(ISettingsService ombi) { diff --git a/src/Ombi/Controllers/TokenController.cs b/src/Ombi/Controllers/TokenController.cs index 75e40639f..be7ea56c6 100644 --- a/src/Ombi/Controllers/TokenController.cs +++ b/src/Ombi/Controllers/TokenController.cs @@ -22,7 +22,8 @@ namespace Ombi.Controllers { [ApiV1] [Produces("application/json")] - public class TokenController : Controller + [ApiController] + public class TokenController : ControllerBase { public TokenController(OmbiUserManager um, IOptions ta, IAuditRepository audit, ITokenRepository token, IPlexOAuthManager oAuthManager) @@ -46,6 +47,7 @@ namespace Ombi.Controllers /// The model. /// [HttpPost] + [ProducesResponseType(401)] public async Task GetToken([FromBody] UserAuthModel model) { if (!model.UsePlexOAuth) @@ -100,6 +102,8 @@ namespace Ombi.Controllers /// Returns the Token for the Ombi User if we can match the Plex user with a valid Ombi User /// [HttpPost("plextoken")] + [ProducesResponseType(401)] + [ProducesResponseType(400)] public async Task GetTokenWithPlexToken([FromBody] PlexTokenAuthentication model) { if (!model.PlexToken.HasValue()) @@ -161,6 +165,7 @@ namespace Ombi.Controllers } [HttpGet("{pinId:int}")] + [ProducesResponseType(401)] public async Task OAuth(int pinId) { var accessToken = await _plexOAuthManager.GetAccessTokenFromPin(pinId); @@ -201,6 +206,7 @@ namespace Ombi.Controllers /// /// [HttpPost("refresh")] + [ProducesResponseType(401)] public IActionResult RefreshToken([FromBody] TokenRefresh token) { diff --git a/src/Ombi/Controllers/UpdateController.cs b/src/Ombi/Controllers/UpdateController.cs index 0a6c3b80c..3fb1c7382 100644 --- a/src/Ombi/Controllers/UpdateController.cs +++ b/src/Ombi/Controllers/UpdateController.cs @@ -11,7 +11,8 @@ namespace Ombi.Controllers [ApiV1] [Produces("application/json")] [AllowAnonymous] - public class UpdateController : Controller + [ApiController] + public class UpdateController : ControllerBase { public UpdateController(ICacheService cache, IChangeLogProcessor processor) { diff --git a/src/Ombi/Controllers/VoteController.cs b/src/Ombi/Controllers/VoteController.cs index 70ea0ec8c..8c7c88396 100644 --- a/src/Ombi/Controllers/VoteController.cs +++ b/src/Ombi/Controllers/VoteController.cs @@ -13,7 +13,8 @@ namespace Ombi.Controllers [ApiV1] [Authorize] [Produces("application/json")] - public class VoteController : Controller + [ApiController] + public class VoteController : ControllerBase { public VoteController(IVoteEngine engine) { diff --git a/src/Ombi/Models/DenyAlbumMOdel.cs b/src/Ombi/Models/DenyAlbumMOdel.cs new file mode 100644 index 000000000..0b9346ead --- /dev/null +++ b/src/Ombi/Models/DenyAlbumMOdel.cs @@ -0,0 +1,33 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2017 Jamie Rees +// File: MovieUpdateModel.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +namespace Ombi.Core.Models.Requests +{ + public class DenyAlbumModel: AlbumUpdateModel + { + public string Reason { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/Models/DenyMovieModel.cs b/src/Ombi/Models/DenyMovieModel.cs new file mode 100644 index 000000000..88ae5c5db --- /dev/null +++ b/src/Ombi/Models/DenyMovieModel.cs @@ -0,0 +1,33 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2017 Jamie Rees +// File: MovieUpdateModel.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +namespace Ombi.Core.Models.Requests +{ + public class DenyMovieModel : MovieUpdateModel + { + public string Reason { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/Models/DenyTvModel.cs b/src/Ombi/Models/DenyTvModel.cs new file mode 100644 index 000000000..5bc57be0b --- /dev/null +++ b/src/Ombi/Models/DenyTvModel.cs @@ -0,0 +1,33 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2017 Jamie Rees +// File: TvUpdateModel.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +namespace Ombi.Models +{ + public class DenyTvModel: TvUpdateModel + { + public string Reason { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index cf3bff48f..679d8dc7e 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -72,6 +72,8 @@ + + diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index 7e3f48c8f..b08f93045 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -96,6 +96,8 @@ namespace Ombi options.User.AllowedUserNameCharacters = string.Empty; }); + + services.AddHealthChecks(); services.AddMemoryCache(); services.AddJwtAuthentication(Configuration); @@ -150,6 +152,7 @@ namespace Ombi var ctx = serviceProvider.GetService(); loggerFactory.AddSerilog(); + app.UseHealthChecks("/health"); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); From 2fdfa3be97b4891e2cdde4450bf990c20aa0fe19 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:37:48 +0000 Subject: [PATCH 28/80] Fixed the NRO error !wip --- .../{AvailabilityRuleBase.cs => AvailabilityRuleHelper.cs} | 6 +++--- src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs | 6 +++--- src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/Ombi.Core/Rule/Rules/Search/{AvailabilityRuleBase.cs => AvailabilityRuleHelper.cs} (93%) diff --git a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleBase.cs b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs similarity index 93% rename from src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleBase.cs rename to src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs index 25cf30492..528e8cfa3 100644 --- a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleBase.cs +++ b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs @@ -9,9 +9,9 @@ using Ombi.Store.Repository.Requests; namespace Ombi.Core.Rule.Rules.Search { - public abstract class AvailabilityRuleBase : BaseSearchRule + public static class AvailabilityRuleHelper { - public void CheckForUnairedEpisodes(SearchTvShowViewModel search) + public static void CheckForUnairedEpisodes(SearchTvShowViewModel search) { if (search.SeasonRequests.All(x => x.Episodes.All(e => e.Available))) { @@ -33,7 +33,7 @@ namespace Ombi.Core.Rule.Rules.Search } } - public async Task SingleEpisodeCheck(bool useImdb, IQueryable allEpisodes, EpisodeRequests episode, + public static async Task SingleEpisodeCheck(bool useImdb, IQueryable allEpisodes, EpisodeRequests episode, SeasonRequests season, PlexServerContent item, bool useTheMovieDb, bool useTvDb) { PlexEpisode epExists = null; diff --git a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs index e125d9f59..3171c6ada 100644 --- a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs @@ -9,7 +9,7 @@ using Ombi.Store.Repository; namespace Ombi.Core.Rule.Rules.Search { - public class EmbyAvailabilityRule : AvailabilityRuleBase, IRules + public class EmbyAvailabilityRule : BaseSearchRule, IRules { public EmbyAvailabilityRule(IEmbyContentRepository repo) { @@ -73,12 +73,12 @@ namespace Ombi.Core.Rule.Rules.Search { foreach (var episode in season.Episodes) { - await SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb); + await AvailabilityRuleHelper.SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb); } } } - CheckForUnairedEpisodes(search); + AvailabilityRuleHelper.CheckForUnairedEpisodes(search); } } return Success(); diff --git a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs index a9458fb23..7f79e4165 100644 --- a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs @@ -8,7 +8,7 @@ using Ombi.Store.Repository; namespace Ombi.Core.Rule.Rules.Search { - public class PlexAvailabilityRule : AvailabilityRuleBase, IRules + public class PlexAvailabilityRule : BaseSearchRule, IRules { public PlexAvailabilityRule(IPlexContentRepository repo) { @@ -72,11 +72,11 @@ namespace Ombi.Core.Rule.Rules.Search { foreach (var episode in season.Episodes) { - await SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb); + await AvailabilityRuleHelper.SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb); } } - CheckForUnairedEpisodes(search); + AvailabilityRuleHelper.CheckForUnairedEpisodes(search); } } } From 18d2488abd440f570dbcc7a50e36b783d75a2c90 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:38:58 +0000 Subject: [PATCH 29/80] removed unused reference !wip --- src/Ombi/ClientApp/app/requests/movierequests.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index 19fc989f2..e002b087e 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -4,6 +4,7 @@ import { DomSanitizer } from "@angular/platform-browser"; import { Subject } from "rxjs"; import { debounceTime, distinctUntilChanged } from "rxjs/operators"; +import { ConfirmationService } from "primeng/primeng"; import { AuthService } from "../auth/auth.service"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces"; import { NotificationService, RadarrService, RequestService } from "../services"; From 870eec17c5b3b4a143f662a358838f2718a4fb66 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:41:58 +0000 Subject: [PATCH 30/80] Another unused reference !wip --- .../ClientApp/app/requests/movierequests.component.html | 7 +++++++ src/Ombi/ClientApp/app/requests/movierequests.component.ts | 1 - src/Ombi/ClientApp/app/requests/requests.module.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index a1dd5cadc..bbe3e9d2f 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -215,6 +215,13 @@ + + + + + + + diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index e002b087e..19fc989f2 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -4,7 +4,6 @@ import { DomSanitizer } from "@angular/platform-browser"; import { Subject } from "rxjs"; import { debounceTime, distinctUntilChanged } from "rxjs/operators"; -import { ConfirmationService } from "primeng/primeng"; import { AuthService } from "../auth/auth.service"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces"; import { NotificationService, RadarrService, RequestService } from "../services"; diff --git a/src/Ombi/ClientApp/app/requests/requests.module.ts b/src/Ombi/ClientApp/app/requests/requests.module.ts index 63d7117f5..ca77c8f8c 100644 --- a/src/Ombi/ClientApp/app/requests/requests.module.ts +++ b/src/Ombi/ClientApp/app/requests/requests.module.ts @@ -6,7 +6,7 @@ import { OrderModule } from "ngx-order-pipe"; import { InfiniteScrollModule } from "ngx-infinite-scroll"; -import { ButtonModule, DialogModule, PaginatorModule } from "primeng/primeng"; +import { ButtonModule, ConfirmDialogModule, DialogModule, PaginatorModule } from "primeng/primeng"; import { MovieRequestsComponent } from "./movierequests.component"; import { MusicRequestsComponent } from "./music/musicrequests.component"; // Request @@ -38,6 +38,7 @@ const routes: Routes = [ OrderModule, PaginatorModule, TooltipModule, + ConfirmDialogModule, ], declarations: [ RequestComponent, From 72e0ebc8876d9119ee90aba68ed50fb2adab657e Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:49:06 +0000 Subject: [PATCH 31/80] !wip fixed builds --- .../Rules/Search/AvailabilityRuleHelper.cs | 2 +- .../app/requests/movierequests.component.ts | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs index 528e8cfa3..428de9ce5 100644 --- a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs +++ b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs @@ -63,7 +63,7 @@ namespace Ombi.Core.Rule.Rules.Search episode.Available = true; } } - public async Task SingleEpisodeCheck(bool useImdb, IQueryable allEpisodes, EpisodeRequests episode, + public static async Task SingleEpisodeCheck(bool useImdb, IQueryable allEpisodes, EpisodeRequests episode, SeasonRequests season, EmbyContent item, bool useTheMovieDb, bool useTvDb) { EmbyEpisode epExists = null; diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index 19fc989f2..c0c51d30a 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -1,9 +1,10 @@ import { PlatformLocation } from "@angular/common"; -import { Component, Input, OnInit } from "@angular/core"; +import { Component, Input, OnInit, ViewChild } from "@angular/core"; import { DomSanitizer } from "@angular/platform-browser"; import { Subject } from "rxjs"; import { debounceTime, distinctUntilChanged } from "rxjs/operators"; +import { ConfirmationService, ConfirmDialog } from "primeng/primeng"; import { AuthService } from "../auth/auth.service"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces"; import { NotificationService, RadarrService, RequestService } from "../services"; @@ -37,9 +38,10 @@ export class MovieRequestsComponent implements OnInit { public orderType: OrderType = OrderType.RequestedDateDesc; public OrderType = OrderType; + @ViewChild("") public confirmDialogComponent: ConfirmDialog; public totalMovies: number = 100; - private currentlyLoaded: number; + public currentlyLoaded: number; private amountToLoad: number; constructor( @@ -48,7 +50,8 @@ export class MovieRequestsComponent implements OnInit { private notificationService: NotificationService, private radarrService: RadarrService, private sanitizer: DomSanitizer, - private readonly platformLocation: PlatformLocation) { + private readonly platformLocation: PlatformLocation, + private confirmationService: ConfirmationService) { this.searchChanged.pipe( debounceTime(600), // Wait Xms after the last event before emitting last event distinctUntilChanged(), // only emit if value is different from previous value @@ -130,9 +133,15 @@ export class MovieRequestsComponent implements OnInit { } public deny(request: IMovieRequests) { - request.denied = true; - this.denyRequest(request); - } + + this.confirmationService.confirm({ + message: "Are you sure", + accept: () => { + request.denied = true; + this.denyRequest(request); + }, + }); + } public selectRootFolder(searchResult: IMovieRequests, rootFolderSelected: IRadarrRootFolder, event: any) { event.preventDefault(); From ffc1641d7740cb8d71f10ed43ef1c986e939e6ab Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:49:58 +0000 Subject: [PATCH 32/80] !wip fixed ui error --- .../ClientApp/app/requests/movierequests.component.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index bbe3e9d2f..af9f3a22e 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -216,7 +216,11 @@ - + +
    +
  • test
  • +
+
From 3377eb98389a9b0b2d42306f15f8a274e509ae67 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 13:52:52 +0000 Subject: [PATCH 33/80] Set the landing and login pages background refresh to 15 seconds rather than 10 and 7 --- src/Ombi/ClientApp/app/landingpage/landingpage.component.ts | 2 +- src/Ombi/ClientApp/app/login/login.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts b/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts index 514b1754e..dc329baf3 100644 --- a/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts +++ b/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts @@ -37,7 +37,7 @@ export class LandingPageComponent implements OnDestroy, OnInit { }); this.timer = setInterval(() => { this.cycleBackground(); - }, 10000); + }, 15000); const base = this.location.getBaseHrefFromDOM(); if (base.length > 1) { diff --git a/src/Ombi/ClientApp/app/login/login.component.ts b/src/Ombi/ClientApp/app/login/login.component.ts index 0c04edbad..4a9ad4aaf 100644 --- a/src/Ombi/ClientApp/app/login/login.component.ts +++ b/src/Ombi/ClientApp/app/login/login.component.ts @@ -87,7 +87,7 @@ export class LoginComponent implements OnDestroy, OnInit { }); this.timer = setInterval(() => { this.cycleBackground(); - }, 7000); + }, 15000); const base = this.location.getBaseHrefFromDOM(); if (base.length > 1) { From bd3a243af96dfa9b1e7dd4d0f404d349cdcde52e Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 14:47:35 +0000 Subject: [PATCH 34/80] Deny reason for movie requests --- .../ClientApp/app/interfaces/IRequestModel.ts | 4 ++ .../app/requests/movierequests.component.html | 17 +++---- .../app/requests/movierequests.component.ts | 49 +++++++++---------- .../ClientApp/app/requests/requests.module.ts | 3 +- .../ClientApp/app/services/request.service.ts | 6 +-- .../usermanagement-user.component.ts | 10 ++++ src/Ombi/ClientApp/styles/base.scss | 11 ++++- 7 files changed, 57 insertions(+), 43 deletions(-) diff --git a/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts b/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts index b083ca088..16a1511e9 100644 --- a/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts +++ b/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts @@ -47,6 +47,10 @@ export interface IMovieUpdateModel { id: number; } +export interface IDenyMovieModel extends IMovieUpdateModel { + reason: string; +} + export interface IAlbumUpdateModel { id: number; } diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index af9f3a22e..f8ea31950 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -88,7 +88,7 @@
{{ 'Requests.Denied' | translate }} - +
@@ -215,17 +215,14 @@ - - -
    -
  • test
  • -
-
+ +Please enter a rejection reason, the user will be notified of this: + - - + + -
+ diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.ts b/src/Ombi/ClientApp/app/requests/movierequests.component.ts index c0c51d30a..3c7a4f993 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.ts @@ -1,10 +1,9 @@ import { PlatformLocation } from "@angular/common"; -import { Component, Input, OnInit, ViewChild } from "@angular/core"; +import { Component, Input, OnInit } from "@angular/core"; import { DomSanitizer } from "@angular/platform-browser"; import { Subject } from "rxjs"; import { debounceTime, distinctUntilChanged } from "rxjs/operators"; -import { ConfirmationService, ConfirmDialog } from "primeng/primeng"; import { AuthService } from "../auth/auth.service"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces"; import { NotificationService, RadarrService, RequestService } from "../services"; @@ -38,7 +37,9 @@ export class MovieRequestsComponent implements OnInit { public orderType: OrderType = OrderType.RequestedDateDesc; public OrderType = OrderType; - @ViewChild("") public confirmDialogComponent: ConfirmDialog; + public denyDisplay: boolean; + public requestToDeny: IMovieRequests; + public rejectionReason: string; public totalMovies: number = 100; public currentlyLoaded: number; @@ -50,8 +51,7 @@ export class MovieRequestsComponent implements OnInit { private notificationService: NotificationService, private radarrService: RadarrService, private sanitizer: DomSanitizer, - private readonly platformLocation: PlatformLocation, - private confirmationService: ConfirmationService) { + private readonly platformLocation: PlatformLocation) { this.searchChanged.pipe( debounceTime(600), // Wait Xms after the last event before emitting last event distinctUntilChanged(), // only emit if value is different from previous value @@ -133,15 +133,23 @@ export class MovieRequestsComponent implements OnInit { } public deny(request: IMovieRequests) { - - this.confirmationService.confirm({ - message: "Are you sure", - accept: () => { - request.denied = true; - this.denyRequest(request); - }, - }); - } + this.requestToDeny = request; + this.denyDisplay = true; + } + + public denyRequest() { + this.requestService.denyMovie({ id: this.requestToDeny.id, reason: this.rejectionReason }) + .subscribe(x => { + this.denyDisplay = false; + if (x.result) { + this.notificationService.success( + `Request for ${this.requestToDeny.title} has been denied successfully`); + } else { + this.notificationService.warning("Request Denied", x.message ? x.message : x.errorMessage); + this.requestToDeny.denied = false; + } + }); + } public selectRootFolder(searchResult: IMovieRequests, rootFolderSelected: IRadarrRootFolder, event: any) { event.preventDefault(); @@ -287,19 +295,6 @@ export class MovieRequestsComponent implements OnInit { }); } - private denyRequest(request: IMovieRequests) { - this.requestService.denyMovie({ id: request.id }) - .subscribe(x => { - if (x.result) { - this.notificationService.success( - `Request for ${request.title} has been denied successfully`); - } else { - this.notificationService.warning("Request Denied", x.message ? x.message : x.errorMessage); - request.denied = false; - } - }); - } - private loadInit() { this.requestService.getMovieRequests(this.amountToLoad, 0, this.orderType, this.filter) .subscribe(x => { diff --git a/src/Ombi/ClientApp/app/requests/requests.module.ts b/src/Ombi/ClientApp/app/requests/requests.module.ts index ca77c8f8c..63d7117f5 100644 --- a/src/Ombi/ClientApp/app/requests/requests.module.ts +++ b/src/Ombi/ClientApp/app/requests/requests.module.ts @@ -6,7 +6,7 @@ import { OrderModule } from "ngx-order-pipe"; import { InfiniteScrollModule } from "ngx-infinite-scroll"; -import { ButtonModule, ConfirmDialogModule, DialogModule, PaginatorModule } from "primeng/primeng"; +import { ButtonModule, DialogModule, PaginatorModule } from "primeng/primeng"; import { MovieRequestsComponent } from "./movierequests.component"; import { MusicRequestsComponent } from "./music/musicrequests.component"; // Request @@ -38,7 +38,6 @@ const routes: Routes = [ OrderModule, PaginatorModule, TooltipModule, - ConfirmDialogModule, ], declarations: [ RequestComponent, diff --git a/src/Ombi/ClientApp/app/services/request.service.ts b/src/Ombi/ClientApp/app/services/request.service.ts index 0021dc208..c157cb72f 100644 --- a/src/Ombi/ClientApp/app/services/request.service.ts +++ b/src/Ombi/ClientApp/app/services/request.service.ts @@ -5,8 +5,8 @@ import { HttpClient } from "@angular/common/http"; import { Observable } from "rxjs"; import { TreeNode } from "primeng/primeng"; -import { FilterType, IAlbumRequest, IAlbumRequestModel, IAlbumUpdateModel, IChildRequests, IFilter, IMovieRequestModel, IMovieRequests, - IMovieUpdateModel, IRequestEngineResult, IRequestsViewModel, ITvRequests, ITvUpdateModel, OrderType } from "../interfaces"; +import { FilterType, IAlbumRequest, IAlbumRequestModel, IAlbumUpdateModel, IChildRequests, IDenyMovieModel, IFilter, IMovieRequestModel, + IMovieRequests, IMovieUpdateModel, IRequestEngineResult, IRequestsViewModel, ITvRequests, ITvUpdateModel, OrderType } from "../interfaces"; import { ITvRequestViewModel } from "../interfaces"; import { ServiceHelpers } from "./service.helpers"; @@ -50,7 +50,7 @@ export class RequestService extends ServiceHelpers { return this.http.post(`${this.url}Movie/Approve`, JSON.stringify(movie), {headers: this.headers}); } - public denyMovie(movie: IMovieUpdateModel): Observable { + public denyMovie(movie: IDenyMovieModel): Observable { return this.http.put(`${this.url}Movie/Deny`, JSON.stringify(movie), {headers: this.headers}); } diff --git a/src/Ombi/ClientApp/app/usermanagement/usermanagement-user.component.ts b/src/Ombi/ClientApp/app/usermanagement/usermanagement-user.component.ts index 5be0a4509..59f3ea5d8 100644 --- a/src/Ombi/ClientApp/app/usermanagement/usermanagement-user.component.ts +++ b/src/Ombi/ClientApp/app/usermanagement/usermanagement-user.component.ts @@ -8,6 +8,16 @@ import { ConfirmationService } from "primeng/primeng"; @Component({ templateUrl: "./usermanagement-user.component.html", + styles: [` + + ::ng-deep ngb-accordion > div.card > div.card-header { + padding:0px; + } + ::ng-deep ngb-accordion > div.card { + color:white; + padding-top: 0px; + } + `], }) export class UserManagementUserComponent implements OnInit { diff --git a/src/Ombi/ClientApp/styles/base.scss b/src/Ombi/ClientApp/styles/base.scss index 1245f63ab..9c7756d8f 100644 --- a/src/Ombi/ClientApp/styles/base.scss +++ b/src/Ombi/ClientApp/styles/base.scss @@ -1008,4 +1008,13 @@ a > h4:hover { .album-cover { width:300px; -} \ No newline at end of file +} + + +::ng-deep ngb-accordion > div.card > div.card-header { + padding:0px; +} +::ng-deep ngb-accordion > div.card { + color:white; + padding-top: 0px; +} From e6d48e5364e7125f68f13ea71182aaa31e67bd3e Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 17 Dec 2018 15:56:24 +0000 Subject: [PATCH 35/80] Added the ability to deny a request with a reason --- .../NotificationMessageCurlys.cs | 7 ++- .../ClientApp/app/interfaces/IRequestModel.ts | 8 ++++ .../music/musicrequests.component.html | 15 ++++++- .../requests/music/musicrequests.component.ts | 45 +++++++------------ .../tvrequest-children.component.html | 16 ++++++- .../requests/tvrequest-children.component.ts | 14 +++++- .../ClientApp/app/services/request.service.ts | 8 ++-- 7 files changed, 73 insertions(+), 40 deletions(-) diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index b178f0545..1e1224342 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -49,7 +49,7 @@ namespace Ombi.Notifications } Overview = req?.Overview; Year = req?.ReleaseDate.Year.ToString(); - + DenyReason = req?.DeniedReason; if (req?.RequestType == RequestType.Movie) { PosterImage = string.Format((req?.PosterPath ?? string.Empty).StartsWith("/", StringComparison.InvariantCultureIgnoreCase) @@ -88,6 +88,7 @@ namespace Ombi.Notifications UserName = req?.RequestedUser?.UserName; } + DenyReason = req?.DeniedReason; Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; Title = title; RequestedDate = req?.RequestedDate.ToString("D"); @@ -126,6 +127,7 @@ namespace Ombi.Notifications { title = req?.ParentRequest.Title; } + DenyReason = req?.DeniedReason; ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty; ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName; RequestedUser = req?.RequestedUser?.UserName; @@ -217,7 +219,6 @@ namespace Ombi.Notifications public string UserName { get; set; } public string IssueUser => UserName; public string Alias { get; set; } - public string Title { get; set; } public string RequestedDate { get; set; } public string Type { get; set; } @@ -235,6 +236,7 @@ namespace Ombi.Notifications public string IssueSubject { get; set; } public string NewIssueComment { get; set; } public string UserPreference { get; set; } + public string DenyReason { get; set; } // System Defined private string LongDate => DateTime.Now.ToString("D"); @@ -269,6 +271,7 @@ namespace Ombi.Notifications {nameof(UserName),UserName}, {nameof(Alias),Alias}, {nameof(UserPreference),UserPreference}, + {nameof(DenyReason),DenyReason}, }; } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts b/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts index 16a1511e9..4bb43f3fe 100644 --- a/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts +++ b/src/Ombi/ClientApp/app/interfaces/IRequestModel.ts @@ -55,6 +55,10 @@ export interface IAlbumUpdateModel { id: number; } +export interface IDenyAlbumModel extends IAlbumUpdateModel { + reason: string; +} + export interface IFullBaseRequest extends IBaseRequest { imdbId: string; overview: string; @@ -117,6 +121,10 @@ export interface ITvUpdateModel { id: number; } +export interface ITvDenyModel extends ITvUpdateModel { + reason: string; +} + export enum OrderType { RequestedDateAsc = 1, RequestedDateDesc = 2, diff --git a/src/Ombi/ClientApp/app/requests/music/musicrequests.component.html b/src/Ombi/ClientApp/app/requests/music/musicrequests.component.html index c4c903da2..5b274589b 100644 --- a/src/Ombi/ClientApp/app/requests/music/musicrequests.component.html +++ b/src/Ombi/ClientApp/app/requests/music/musicrequests.component.html @@ -92,7 +92,7 @@
{{ 'Requests.Denied' | translate }} - +
@@ -265,4 +265,15 @@ - \ No newline at end of file + + + + + + Please enter a rejection reason, the user will be notified of this: + + + + + + \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts b/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts index e70d44a38..7cda9ab29 100644 --- a/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts +++ b/src/Ombi/ClientApp/app/requests/music/musicrequests.component.ts @@ -34,6 +34,9 @@ export class MusicRequestsComponent implements OnInit { public orderType: OrderType = OrderType.RequestedDateDesc; public OrderType = OrderType; + public denyDisplay: boolean; + public requestToDeny: IAlbumRequest; + public rejectionReason: string; public totalAlbums: number = 100; private currentlyLoaded: number; @@ -126,23 +129,22 @@ export class MusicRequestsComponent implements OnInit { } public deny(request: IAlbumRequest) { - request.denied = true; - this.denyRequest(request); + this.requestToDeny = request; + this.denyDisplay = true; } - // public selectRootFolder(searchResult: IAlbumRequest, rootFolderSelected: IRadarrRootFolder, event: any) { - // event.preventDefault(); - // // searchResult.rootPathOverride = rootFolderSelected.id; - // this.setOverride(searchResult); - // this.updateRequest(searchResult); - // } - - // public selectQualityProfile(searchResult: IMovieRequests, profileSelected: IRadarrProfile, event: any) { - // event.preventDefault(); - // searchResult.qualityOverride = profileSelected.id; - // this.setOverride(searchResult); - // this.updateRequest(searchResult); - // } + public denyRequest() { + this.requestService.denyAlbum({ id: this.requestToDeny.id, reason: this.rejectionReason }) + .subscribe(x => { + if (x.result) { + this.notificationService.success( + `Request for ${this.requestToDeny.title} has been denied successfully`); + } else { + this.notificationService.warning("Request Denied", x.message ? x.message : x.errorMessage); + this.requestToDeny.denied = false; + } + }); + } public reportIssue(catId: IIssueCategory, req: IAlbumRequest) { this.issueRequest = req; @@ -266,19 +268,6 @@ export class MusicRequestsComponent implements OnInit { }); } - private denyRequest(request: IAlbumRequest) { - this.requestService.denyAlbum({ id: request.id }) - .subscribe(x => { - if (x.result) { - this.notificationService.success( - `Request for ${request.title} has been denied successfully`); - } else { - this.notificationService.warning("Request Denied", x.message ? x.message : x.errorMessage); - request.denied = false; - } - }); - } - private loadInit() { this.requestService.getAlbumRequests(this.amountToLoad, 0, this.orderType, this.filter) .subscribe(x => { diff --git a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html index 1492a00f9..003ceea6a 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html +++ b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html @@ -21,7 +21,8 @@ - +
@@ -76,7 +77,9 @@ {{ep.airDate | amLocal | amDateFormat: 'L' }}
"); @@ -392,7 +397,7 @@ namespace Ombi.Schedule.Jobs.Ombi return sb.ToString(); } - private async Task ProcessPlexMovies(IQueryable plexContentToSend, StringBuilder sb) + private async Task ProcessPlexMovies(IQueryable plexContentToSend, StringBuilder sb, string defaultLanguageCode) { int count = 0; var ordered = plexContentToSend.OrderByDescending(x => x.AddedAt); @@ -403,7 +408,7 @@ namespace Ombi.Schedule.Jobs.Ombi { continue; } - var info = await _movieApi.GetMovieInformationWithExtraInfo(movieDbId); + var info = await _movieApi.GetMovieInformationWithExtraInfo(movieDbId, defaultLanguageCode); var mediaurl = content.Url; if (info == null) { @@ -466,7 +471,7 @@ namespace Ombi.Schedule.Jobs.Ombi } } - private async Task ProcessEmbyMovies(IQueryable embyContent, StringBuilder sb) + private async Task ProcessEmbyMovies(IQueryable embyContent, StringBuilder sb, string defaultLangaugeCode) { int count = 0; var ordered = embyContent.OrderByDescending(x => x.AddedAt); @@ -487,7 +492,7 @@ namespace Ombi.Schedule.Jobs.Ombi } var mediaurl = content.Url; - var info = await _movieApi.GetMovieInformationWithExtraInfo(StringHelper.IntParseLinq(theMovieDbId)); + var info = await _movieApi.GetMovieInformationWithExtraInfo(StringHelper.IntParseLinq(theMovieDbId), defaultLangaugeCode); if (info == null) { continue; From cdab76da40b1f1f0c34849cd34081b6397923e7e Mon Sep 17 00:00:00 2001 From: TidusJar Date: Mon, 7 Jan 2019 14:46:40 +0000 Subject: [PATCH 73/80] !wip changelog --- CHANGELOG.md | 138 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 133 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7da4cd6d8..52e9d19c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,144 @@ # Changelog -## v3.0.3988 (2018-11-23) - - +## (unreleased) ### **New Features** +- Added a global language flag that now applies to the search by default. [tidusjar] + +- Updated the frontend packages (Using Angular 7 now) [TidusJar] + +- Added capture of anonymous analytical data. [tidusjar] + +- Added {AvailableDate} as a Notification Variable, this is the date the request was marked as available. See here: https://github.com/tidusjar/Ombi/wiki/Notification-Template-Variables. [tidusjar] + +- Added the ability to search movies via the movie db with a different language! [tidusjar] + +- Added the ability to specify a year when searching for movies. [tidusjar] + +- Update NewsletterTemplate.html. [d1slact0r] + +- Update NewsletterTemplate.html. [d1slact0r] + +- Update NewsletterTemplate.html. [d1slact0r] + +- Update HtmlTemplateGenerator.cs. [d1slact0r] + +- Update NewsletterTemplate.html. [d1slact0r] + +- Update HtmlTemplateGenerator.cs. [d1slact0r] + +- Update NewsletterTemplate.html. [d1slact0r] + +- Update NewsletterTemplate.html. [d1slact0r] + +- Update NewsletterTemplate.html. [d1slact0r] + +- Update HtmlTemplateGenerator.cs. [d1slact0r] + +- Updated boostrap #2694. [Jamie] + +- Added the ability to deny a request with a reason. [TidusJar] + +- Update EmbyEpisodeSync.cs. [Jamie] + +- Updated to .net core 2.2 and included a linux-arm64 build. [TidusJar] + +### **Fixes** + +- Made the newsletter use the default lanuage code set in the Ombi settings for movie information. [TidusJar] + +- Save the language code against the request so we can use it later e.g. Sending to the DVR apps. [tidusjar] + +- Fixed #2716. [tidusjar] + +- Make the newsletter BCC the users rather than creating a million newsletters (Hopefully will stop SMTP providers from marking as spam). This does mean that the custom user customization in the newsletter will no longer work. [TidusJar] + +- If we don't know the Plex agent, then see if it's a ImdbId, if it's not check the string for any episode and season hints #2695. [tidusjar] + +- New translations en.json (Swedish) [Jamie] + +- New translations en.json (Spanish) [Jamie] + +- New translations en.json (Portuguese, Brazilian) [Jamie] + +- New translations en.json (Polish) [Jamie] + +- New translations en.json (Norwegian) [Jamie] + +- New translations en.json (Italian) [Jamie] + +- New translations en.json (German) [Jamie] + +- New translations en.json (French) [Jamie] + +- New translations en.json (Dutch) [Jamie] + +- New translations en.json (Danish) [Jamie] + +- New translations en.json (Dutch) [Jamie] + +- New translations en.json (Dutch) [Jamie] + +- New translations en.json (Dutch) [Jamie] + +- Made the search results the language specified in the search refinement. [tidusjar] + +- Fixed #2704. [tidusjar] + +- Now it is fixed :) [d1slact0r] + +- Android please be nice now. [d1slact0r] + +- Fixed title bit better. [d1slact0r] + +- Fixed titles. [d1slact0r] + +- This should fix the build for sure (stupid quotes) [d1slact0r] + +- Fixes build. [d1slact0r] + +- Rewritten the whole newsletter template. [d1slact0r] + +- Fixed #2697. [tidusjar] + +- Add linux-arm runtime identifier. [aptalca] + +- Add back arm packages. [aptalca] + +- Add arm32 package. [aptalca] + +- Fixed #2691. [tidusjar] + +- Fixed linting. [TidusJar] + +- Fixed the Plex OAuth when going through the wizard. [TidusJar] + +- Fixed #2678. [TidusJar] + +- Deny reason for movie requests. [TidusJar] + +- Set the landing and login pages background refresh to 15 seconds rather than 10 and 7. [TidusJar] + +- Fixed a bug with us thinking future dated emby episodes are not available, Consoldated the emby and plex search rules (since they have the same logic) [TidusJar] + +- Fixed build. [TidusJar] + + +## v3.0.4036 (2018-12-11) + +### **New Features** + +- Changelog. [Jamie] + - Added Sonarr v3 #2359. [TidusJar] ### **Fixes** +- !changelog. [Jamie] + +- Fixed a missing translation. [Jamie] + - Fixed a potential security vulnerability. [Jamie] - Sorted out some of the settings pages, trying to make it consistent. [Jamie] @@ -37,8 +166,7 @@ ### **Fixes** - -- Fixed #2601 [TidusJar] +- !changelog. [Jamie] - Made the subscribe/unsubscribe button more obvious on the UI #2309. [Jamie] From b30541335175f36c4892ebe6938b26d20b9c0d50 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Tue, 8 Jan 2019 12:56:32 +0000 Subject: [PATCH 74/80] Fixed #2725 and #2721 --- src/Ombi.Notifications/NotificationMessageCurlys.cs | 6 +++--- src/Ombi/Controllers/IdentityController.cs | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index 407490240..cedda3735 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -39,7 +39,7 @@ namespace Ombi.Notifications Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; if (pref != null) { - UserPreference = pref.Enabled ? pref.Value : Alias; + UserPreference = pref.Value.HasValue() ? pref.Value : Alias; } Title = title; RequestedDate = req?.RequestedDate.ToString("D"); @@ -91,7 +91,7 @@ namespace Ombi.Notifications Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; if (pref != null) { - UserPreference = pref.Enabled ? pref.Value : Alias; + UserPreference = pref.Value.HasValue() ? pref.Value : Alias; } Title = title; RequestedDate = req?.RequestedDate.ToString("D"); @@ -136,7 +136,7 @@ namespace Ombi.Notifications Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; if (pref != null) { - UserPreference = pref.Enabled ? pref.Value : Alias; + UserPreference = pref.Value.HasValue() ? pref.Value : Alias; } Title = title; RequestedDate = req?.RequestedDate.ToString("D"); diff --git a/src/Ombi/Controllers/IdentityController.cs b/src/Ombi/Controllers/IdentityController.cs index ec884ace6..2976069ed 100644 --- a/src/Ombi/Controllers/IdentityController.cs +++ b/src/Ombi/Controllers/IdentityController.cs @@ -965,7 +965,6 @@ namespace Ombi.Controllers { // Update it existingPreference.Value = pref.Value; - existingPreference.Enabled = pref.Enabled; await _userNotificationPreferences.SaveChangesAsync(); } else @@ -973,7 +972,6 @@ namespace Ombi.Controllers await _userNotificationPreferences.Add(new UserNotificationPreferences { Agent = pref.Agent, - Enabled = pref.Enabled, UserId = pref.UserId, Value = pref.Value }); From edf87bf296171ce0b3244b451dc20a9e0f6a743b Mon Sep 17 00:00:00 2001 From: TidusJar Date: Tue, 8 Jan 2019 15:04:08 +0000 Subject: [PATCH 75/80] !wip on the new custom page --- .../Settings/Models/CustomPageSettings.cs | 9 ++++ src/Ombi/ClientApp/app/app.module.ts | 8 +++- .../app/custompage/custompage.component.html | 7 +++ .../app/custompage/custompage.component.scss | 44 +++++++++++++++++++ .../app/custompage/custompage.component.ts | 19 ++++++++ src/Ombi/Controllers/SettingsController.cs | 21 +++++++++ src/Ombi/package.json | 16 ++++--- src/Ombi/webpack.config.vendor.ts | 2 + src/Ombi/yarn.lock | 10 +++++ 9 files changed, 128 insertions(+), 8 deletions(-) create mode 100644 src/Ombi.Settings/Settings/Models/CustomPageSettings.cs create mode 100644 src/Ombi/ClientApp/app/custompage/custompage.component.html create mode 100644 src/Ombi/ClientApp/app/custompage/custompage.component.scss create mode 100644 src/Ombi/ClientApp/app/custompage/custompage.component.ts diff --git a/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs b/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs new file mode 100644 index 000000000..9a33b799c --- /dev/null +++ b/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs @@ -0,0 +1,9 @@ +namespace Ombi.Settings.Settings.Models +{ + public class CustomPageSettings : Settings + { + public bool Enabled { get; set; } + public string Title { get; set; } + public string Html { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/app.module.ts b/src/Ombi/ClientApp/app/app.module.ts index 0f268e4d2..6917cc85b 100644 --- a/src/Ombi/ClientApp/app/app.module.ts +++ b/src/Ombi/ClientApp/app/app.module.ts @@ -14,13 +14,16 @@ import { NgbModule } from "@ng-bootstrap/ng-bootstrap"; import { TranslateLoader, TranslateModule } from "@ngx-translate/core"; import { TranslateHttpLoader } from "@ngx-translate/http-loader"; import { CookieService } from "ng2-cookies"; +import { NgxEditorModule } from "ngx-editor"; import { GrowlModule } from "primeng/components/growl/growl"; -import { ButtonModule, CaptchaModule, ConfirmationService, ConfirmDialogModule, DataTableModule, DialogModule, OverlayPanelModule, SharedModule, SidebarModule, TooltipModule } from "primeng/primeng"; +import { ButtonModule, CaptchaModule, ConfirmationService, ConfirmDialogModule, DataTableModule, DialogModule, OverlayPanelModule, SharedModule, SidebarModule, + TooltipModule } from "primeng/primeng"; // Components import { AppComponent } from "./app.component"; import { CookieComponent } from "./auth/cookie.component"; +import { CustomPageComponent } from "./custompage/custompage.component"; import { PageNotFoundComponent } from "./errors/not-found.component"; import { LandingPageComponent } from "./landingpage/landingpage.component"; import { LoginComponent } from "./login/login.component"; @@ -43,6 +46,7 @@ const routes: Routes = [ { path: "", redirectTo: "/search", pathMatch: "full" }, { path: "login", component: LoginComponent }, { path: "Login/OAuth/:pin", component: LoginOAuthComponent }, + { path: "Custom", component: CustomPageComponent }, { path: "login/:landing", component: LoginComponent }, { path: "reset", component: ResetPasswordComponent }, { path: "token", component: TokenResetPasswordComponent }, @@ -88,6 +92,7 @@ export function JwtTokenGetter() { FormsModule, DataTableModule, SharedModule, + NgxEditorModule, DialogModule, MatButtonModule, NgbModule.forRoot(), @@ -121,6 +126,7 @@ export function JwtTokenGetter() { LandingPageComponent, ResetPasswordComponent, TokenResetPasswordComponent, + CustomPageComponent, CookieComponent, LoginOAuthComponent, ], diff --git a/src/Ombi/ClientApp/app/custompage/custompage.component.html b/src/Ombi/ClientApp/app/custompage/custompage.component.html new file mode 100644 index 000000000..545f56cb5 --- /dev/null +++ b/src/Ombi/ClientApp/app/custompage/custompage.component.html @@ -0,0 +1,7 @@ + +
+ + +
+
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/app/custompage/custompage.component.scss b/src/Ombi/ClientApp/app/custompage/custompage.component.scss new file mode 100644 index 000000000..127ee8b74 --- /dev/null +++ b/src/Ombi/ClientApp/app/custompage/custompage.component.scss @@ -0,0 +1,44 @@ +$primary-colour: #df691a; +$primary-colour-outline: #ff761b; +$bg-colour: #333333; +$bg-colour-disabled: #252424; + +:host app-ngx-editor /deep/ .ngx-toolbar { + background-color: $bg-colour; + border: 1px solid $primary-colour-outline; +} + +:host app-ngx-editor /deep/ .ngx-toolbar-set { + background-color: transparent !important; + border: 1px solid $primary-colour-outline !important; +} + +:host app-ngx-editor /deep/ .ngx-editor-button { + -o-transition: all 0.218s; + -moz-transition: all 0.218s; + -webkit-transition: all 0.218s; + transition: all 0.218s; + color: $primary-colour-outline; + background-color: transparent; + background-image: none; + border-color: $primary-colour-outline !important; +} + +:host app-ngx-editor /deep/ .ngx-editor-button:hover { + color: black; + background-color: $primary-colour !important; + border-color: $primary-colour-outline !important; +} + +:host app-ngx-editor /deep/ .ngx-editor-grippie { + background-color: $bg-colour; + border: 1px solid $primary-colour-outline; +} + +:host app-ngx-editor /deep/ .ngx-editor-textarea { + border: 1px solid $primary-colour-outline !important; +} + +:host app-ngx-editor /deep/ .ngx-editor-message { + display:none !important; +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/custompage/custompage.component.ts b/src/Ombi/ClientApp/app/custompage/custompage.component.ts new file mode 100644 index 000000000..dd9259dae --- /dev/null +++ b/src/Ombi/ClientApp/app/custompage/custompage.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit } from "@angular/core"; + +@Component({ + templateUrl: "./custompage.component.html", + styleUrls: ["./custompage.component.scss"], +}) +export class CustomPageComponent implements OnInit { + + public html: string; + public isEditing: boolean; + + constructor() { +// + } + + public ngOnInit() { + // + } +} diff --git a/src/Ombi/Controllers/SettingsController.cs b/src/Ombi/Controllers/SettingsController.cs index 45efc8067..770745786 100644 --- a/src/Ombi/Controllers/SettingsController.cs +++ b/src/Ombi/Controllers/SettingsController.cs @@ -706,6 +706,27 @@ namespace Ombi.Controllers return emailSettings.Enabled; } + /// + /// Gets the Custom Page Settings. + /// + /// + [HttpGet("CustomPage")] + [AllowAnonymous] + public async Task CustomPageSettings() + { + return await Get(); + } + + /// + /// Saves the Custom Page Settings. + /// + /// + [HttpGet("CustomPage")] + public async Task CustomPageSettings([FromBody] CustomPageSettings page) + { + return await Save(page); + } + /// /// Saves the discord notification settings. /// diff --git a/src/Ombi/package.json b/src/Ombi/package.json index 0d4c31f21..5713b1061 100644 --- a/src/Ombi/package.json +++ b/src/Ombi/package.json @@ -15,20 +15,20 @@ "@angular/animations": "^7.1.4", "@angular/cdk": "^7.2.0", "@angular/common": "^7.1.4", - "@angular/compiler":"^7.1.4", + "@angular/compiler": "^7.1.4", "@angular/compiler-cli": "^7.1.4", "@angular/core": "^7.1.4", - "@angular/forms":"^7.1.4", + "@angular/forms": "^7.1.4", "@angular/http": "^7.1.4", - "@angular/material":"^7.2.0", + "@angular/material": "^7.2.0", "@angular/platform-browser": "^7.1.4", "@angular/platform-browser-dynamic": "^7.1.4", - "@angular/platform-server":"^7.1.4", - "@angular/router":"^7.1.4", + "@angular/platform-server": "^7.1.4", + "@angular/router": "^7.1.4", "@auth0/angular-jwt": "^2.0.0", "@ng-bootstrap/ng-bootstrap": "^3.3.1", - "@ngtools/webpack":"^7.1.4", - "@ngu/carousel": "^1.4.9-beta-2", + "@ngtools/webpack": "^7.1.4", + "@ngu/carousel": "^1.4.9-beta-2", "@ngx-translate/core": "^11.0.1", "@ngx-translate/http-loader": "^4.0.0", "@types/core-js": "^2.5.0", @@ -62,7 +62,9 @@ "moment": "^2.22.2", "natives": "1.1.6", "ng2-cookies": "^1.0.12", + "ngx-bootstrap": "^3.1.4", "ngx-clipboard": "^11.1.1", + "ngx-editor": "^4.1.0", "ngx-infinite-scroll": "^6.0.1", "ngx-moment": "^3.0.1", "ngx-order-pipe": "^2.0.1", diff --git a/src/Ombi/webpack.config.vendor.ts b/src/Ombi/webpack.config.vendor.ts index dc7c282bd..3f360af10 100644 --- a/src/Ombi/webpack.config.vendor.ts +++ b/src/Ombi/webpack.config.vendor.ts @@ -53,6 +53,8 @@ module.exports = (env: any) => { "@ngx-translate/http-loader", "ngx-order-pipe", "@yellowspot/ng-truncate", + "ngx-editor", + "ngx-bootstrap", ]), }, plugins: prod ? [] : [ diff --git a/src/Ombi/yarn.lock b/src/Ombi/yarn.lock index ae028221a..95d3e136b 100644 --- a/src/Ombi/yarn.lock +++ b/src/Ombi/yarn.lock @@ -4182,6 +4182,10 @@ ng2-cookies@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/ng2-cookies/-/ng2-cookies-1.0.12.tgz#3f3e613e0137b0649b705c678074b4bd08149ccc" +ngx-bootstrap@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/ngx-bootstrap/-/ngx-bootstrap-3.1.4.tgz#5105c0227da3b51a1972d04efa1504a79474fd57" + ngx-clipboard@^11.1.1: version "11.1.9" resolved "https://registry.yarnpkg.com/ngx-clipboard/-/ngx-clipboard-11.1.9.tgz#a391853dc49e436de407260863a2c814d73a9332" @@ -4189,6 +4193,12 @@ ngx-clipboard@^11.1.1: ngx-window-token "^1.0.2" tslib "^1.9.0" +ngx-editor@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ngx-editor/-/ngx-editor-4.1.0.tgz#3ec5820627f25a2239094747cccf88a7ca02f79f" + dependencies: + tslib "^1.9.0" + ngx-infinite-scroll@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/ngx-infinite-scroll/-/ngx-infinite-scroll-6.0.1.tgz#571e54860ce32839451569bcf6e7a63cfae327bd" From 656f8511b4a128861d1705c84dd69606302cf4d7 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Tue, 8 Jan 2019 20:06:45 +0000 Subject: [PATCH 76/80] !wip added the custom page into the settings --- .../Settings/Models/CustomPageSettings.cs | 1 - .../Settings/Models/CustomizationSettings.cs | 1 + .../Entities/Requests/MovieRequests.cs | 2 ++ .../app/custompage/custompage.component.html | 29 ++++++++++++---- .../app/custompage/custompage.component.ts | 34 ++++++++++++++++--- .../ClientApp/app/interfaces/ISettings.ts | 7 ++++ .../app/services/settings.service.ts | 9 +++++ .../customization.component.html | 7 ++++ src/Ombi/Controllers/SettingsController.cs | 2 +- 9 files changed, 79 insertions(+), 13 deletions(-) diff --git a/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs b/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs index 9a33b799c..0087bbe02 100644 --- a/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs +++ b/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs @@ -2,7 +2,6 @@ { public class CustomPageSettings : Settings { - public bool Enabled { get; set; } public string Title { get; set; } public string Html { get; set; } } diff --git a/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs b/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs index 6c18c712f..5f0287fc4 100644 --- a/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs +++ b/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs @@ -10,6 +10,7 @@ public string CustomDonationMessage { get; set; } public string Logo { get; set; } public bool RecentlyAddedPage { get; set; } + public bool UseCustomPage { get; set; } public void AddToUrl(string part) { diff --git a/src/Ombi.Store/Entities/Requests/MovieRequests.cs b/src/Ombi.Store/Entities/Requests/MovieRequests.cs index e5957ca63..677a4292c 100644 --- a/src/Ombi.Store/Entities/Requests/MovieRequests.cs +++ b/src/Ombi.Store/Entities/Requests/MovieRequests.cs @@ -1,6 +1,7 @@ using Ombi.Helpers; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; namespace Ombi.Store.Entities.Requests { @@ -26,6 +27,7 @@ namespace Ombi.Store.Entities.Requests public string LangCode { get; set; } [NotMapped] + [JsonIgnore] public string LanguageCode => LangCode.IsNullOrEmpty() ? "en" : LangCode; } } diff --git a/src/Ombi/ClientApp/app/custompage/custompage.component.html b/src/Ombi/ClientApp/app/custompage/custompage.component.html index 545f56cb5..3188f5d4e 100644 --- a/src/Ombi/ClientApp/app/custompage/custompage.component.html +++ b/src/Ombi/ClientApp/app/custompage/custompage.component.html @@ -1,7 +1,22 @@ - -
- - -
-
-
\ No newline at end of file +
+
+ +
+
+ + + +
+ + + +
+
+ + + +
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/app/custompage/custompage.component.ts b/src/Ombi/ClientApp/app/custompage/custompage.component.ts index dd9259dae..e5968cc6e 100644 --- a/src/Ombi/ClientApp/app/custompage/custompage.component.ts +++ b/src/Ombi/ClientApp/app/custompage/custompage.component.ts @@ -1,4 +1,7 @@ import { Component, OnInit } from "@angular/core"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { AuthService } from "../auth/auth.service"; +import { NotificationService, SettingsService } from "../services"; @Component({ templateUrl: "./custompage.component.html", @@ -6,14 +9,37 @@ }) export class CustomPageComponent implements OnInit { - public html: string; + public form: FormGroup; public isEditing: boolean; + public isAdmin: boolean; - constructor() { -// + constructor(private auth: AuthService, private settings: SettingsService, private fb: FormBuilder, + private notificationService: NotificationService) { } public ngOnInit() { - // + this.settings.getCustomPage().subscribe(x => { + + this.form = this.fb.group({ + enabled: [x.enabled], + title: [x.title, [Validators.required]], + html: [x.html, [Validators.required]], + }); + }); + this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser"); + } + + public onSubmit() { + if (this.form.invalid) { + this.notificationService.error("Please check your entered values"); + return; + } + this.settings.saveCustomPage(this.form.value).subscribe(x => { + if (x) { + this.notificationService.success("Successfully saved Custom Page settings"); + } else { + this.notificationService.success("There was an error when saving the Custom Page settings"); + } + }); } } diff --git a/src/Ombi/ClientApp/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/app/interfaces/ISettings.ts index f2453c273..18a509bb2 100644 --- a/src/Ombi/ClientApp/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/app/interfaces/ISettings.ts @@ -120,6 +120,7 @@ export interface ICustomizationSettings extends ISettings { customDonationUrl: string; customDonationMessage: string; recentlyAddedPage: boolean; + useCustomPage: boolean; } export interface IJobSettings { @@ -158,6 +159,12 @@ export interface IAuthenticationSettings extends ISettings { enableOAuth: boolean; } +export interface ICustomPage extends ISettings { + enabled: boolean; + title: string; + html: string; +} + export interface IUserManagementSettings extends ISettings { importPlexUsers: boolean; importPlexAdmin: boolean; diff --git a/src/Ombi/ClientApp/app/services/settings.service.ts b/src/Ombi/ClientApp/app/services/settings.service.ts index 64a6edd14..4e68d28df 100644 --- a/src/Ombi/ClientApp/app/services/settings.service.ts +++ b/src/Ombi/ClientApp/app/services/settings.service.ts @@ -10,6 +10,7 @@ import { ICronTestModel, ICronViewModelBody, ICustomizationSettings, + ICustomPage, IDiscordNotifcationSettings, IDogNzbSettings, IEmailNotificationSettings, @@ -112,6 +113,14 @@ export class SettingsService extends ServiceHelpers { return this.http.get(`${this.url}/Authentication`, {headers: this.headers}); } + public getCustomPage(): Observable { + return this.http.get(`${this.url}/CustomPage`, {headers: this.headers}); + } + + public saveCustomPage(model: ICustomPage): Observable { + return this.http.post(`${this.url}/CustomPage`, model, {headers: this.headers}); + } + public getClientId(): Observable { return this.http.get(`${this.url}/clientid`, {headers: this.headers}); } diff --git a/src/Ombi/ClientApp/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/app/settings/customization/customization.component.html index 32d91aed9..90c6fb5bc 100644 --- a/src/Ombi/ClientApp/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/app/settings/customization/customization.component.html @@ -69,6 +69,13 @@ tooltipPosition="top" pTooltip="Set a custom message to be displayed in the navigation bar."> +
+ +
+ +
+
diff --git a/src/Ombi/Controllers/SettingsController.cs b/src/Ombi/Controllers/SettingsController.cs index 770745786..892471d94 100644 --- a/src/Ombi/Controllers/SettingsController.cs +++ b/src/Ombi/Controllers/SettingsController.cs @@ -721,7 +721,7 @@ namespace Ombi.Controllers /// Saves the Custom Page Settings. /// /// - [HttpGet("CustomPage")] + [HttpPost("CustomPage")] public async Task CustomPageSettings([FromBody] CustomPageSettings page) { return await Save(page); From 7c97b104d23b2c8b66a9dfeebe92ed92cc9640fd Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 9 Jan 2019 08:04:59 +0000 Subject: [PATCH 77/80] Updated the AspnetCore.App package to remove the CVE-2019-0564 vulnerability --- src/Ombi.Core/Ombi.Core.csproj | 2 +- src/Ombi.Store/Ombi.Store.csproj | 4 ++-- src/Ombi/Ombi.csproj | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ombi.Core/Ombi.Core.csproj b/src/Ombi.Core/Ombi.Core.csproj index 3dad3eb5f..35688a6fe 100644 --- a/src/Ombi.Core/Ombi.Core.csproj +++ b/src/Ombi.Core/Ombi.Core.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Ombi.Store/Ombi.Store.csproj b/src/Ombi.Store/Ombi.Store.csproj index f68d1d752..f905c9ffe 100644 --- a/src/Ombi.Store/Ombi.Store.csproj +++ b/src/Ombi.Store/Ombi.Store.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index 9da5a860f..881a6cc54 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -71,7 +71,7 @@ - + From 145166064a4dfca65de437b2fa1540e737e678ac Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 9 Jan 2019 08:44:35 +0000 Subject: [PATCH 78/80] Added a page where the admin can write/style/basically do whatever they want with e.g. FAQ for the users #2715 This needs to be enabled in the Customization Settings and then it's all configured on the page. --- .../Settings/Models/CustomPageSettings.cs | 1 + src/Ombi/ClientApp/app/app.component.html | 8 +++++ src/Ombi/ClientApp/app/app.component.ts | 16 +++++++-- .../app/custompage/custompage.component.html | 9 +++++ .../app/custompage/custompage.component.scss | 2 +- .../app/custompage/custompage.component.ts | 9 +++-- .../ClientApp/app/interfaces/ISettings.ts | 3 +- .../customization.component.html | 35 ++++++++++--------- src/Ombi/Ombi.csproj | 6 ++-- 9 files changed, 63 insertions(+), 26 deletions(-) diff --git a/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs b/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs index 0087bbe02..18c0125cb 100644 --- a/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs +++ b/src/Ombi.Settings/Settings/Models/CustomPageSettings.cs @@ -4,5 +4,6 @@ { public string Title { get; set; } public string Html { get; set; } + public string FontAwesomeIcon { get; set; } } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/app.component.html b/src/Ombi/ClientApp/app/app.component.html index 9f6d00a7e..08c153f31 100644 --- a/src/Ombi/ClientApp/app/app.component.html +++ b/src/Ombi/ClientApp/app/app.component.html @@ -34,6 +34,14 @@ {{ 'NavigationBar.Requests' | translate }} +
+
+ + + +
+
diff --git a/src/Ombi/ClientApp/app/custompage/custompage.component.scss b/src/Ombi/ClientApp/app/custompage/custompage.component.scss index 127ee8b74..702973737 100644 --- a/src/Ombi/ClientApp/app/custompage/custompage.component.scss +++ b/src/Ombi/ClientApp/app/custompage/custompage.component.scss @@ -41,4 +41,4 @@ $bg-colour-disabled: #252424; :host app-ngx-editor /deep/ .ngx-editor-message { display:none !important; -} \ No newline at end of file +} diff --git a/src/Ombi/ClientApp/app/custompage/custompage.component.ts b/src/Ombi/ClientApp/app/custompage/custompage.component.ts index e5968cc6e..f346bef2b 100644 --- a/src/Ombi/ClientApp/app/custompage/custompage.component.ts +++ b/src/Ombi/ClientApp/app/custompage/custompage.component.ts @@ -1,5 +1,6 @@ -import { Component, OnInit } from "@angular/core"; +import { Component, OnInit, SecurityContext } from "@angular/core"; import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { DomSanitizer } from "@angular/platform-browser"; import { AuthService } from "../auth/auth.service"; import { NotificationService, SettingsService } from "../services"; @@ -14,16 +15,18 @@ export class CustomPageComponent implements OnInit { public isAdmin: boolean; constructor(private auth: AuthService, private settings: SettingsService, private fb: FormBuilder, - private notificationService: NotificationService) { + private notificationService: NotificationService, + private sanitizer: DomSanitizer) { } public ngOnInit() { this.settings.getCustomPage().subscribe(x => { - + x.html = this.sanitizer.sanitize(SecurityContext.HTML, this.sanitizer.bypassSecurityTrustHtml(x.html)); this.form = this.fb.group({ enabled: [x.enabled], title: [x.title, [Validators.required]], html: [x.html, [Validators.required]], + fontAwesomeIcon: [x.fontAwesomeIcon, [Validators.required]], }); }); this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser"); diff --git a/src/Ombi/ClientApp/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/app/interfaces/ISettings.ts index 18a509bb2..2f8a4e80b 100644 --- a/src/Ombi/ClientApp/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/app/interfaces/ISettings.ts @@ -161,8 +161,9 @@ export interface IAuthenticationSettings extends ISettings { export interface ICustomPage extends ISettings { enabled: boolean; + fontAwesomeIcon: string; title: string; - html: string; + html: any; } export interface IUserManagementSettings extends ISettings { diff --git a/src/Ombi/ClientApp/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/app/settings/customization/customization.component.html index 90c6fb5bc..21a992c32 100644 --- a/src/Ombi/ClientApp/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/app/settings/customization/customization.component.html @@ -21,8 +21,8 @@
- +
@@ -36,8 +36,8 @@
- +
@@ -50,14 +50,16 @@
- +
-
@@ -65,17 +67,19 @@
-
-
- -
- -
+
+
+ + +
+
@@ -92,9 +96,8 @@
- +
diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index 881a6cc54..dc447dd20 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -14,12 +14,12 @@ false - bin\Debug\netcoreapp2.0\Swagger.xml + bin\Debug\netcoreapp2.2\Swagger.xml 1701;1702;1705;1591; - bin\Release\netcoreapp2.0\Swagger.xml + bin\Release\netcoreapp2.2\Swagger.xml 1701;1702;1705;1591; TRACE;RELEASE;NETCOREAPP2_0 @@ -71,7 +71,7 @@ - + From dcc28ff26ee2ccbcd07df8b33212ebccfa9c4056 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 9 Jan 2019 12:24:47 +0000 Subject: [PATCH 79/80] Potentially fix #2726 --- src/Ombi.Core/Engine/MovieSearchEngine.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ombi.Core/Engine/MovieSearchEngine.cs b/src/Ombi.Core/Engine/MovieSearchEngine.cs index 51e189db9..5e56e8abd 100644 --- a/src/Ombi.Core/Engine/MovieSearchEngine.cs +++ b/src/Ombi.Core/Engine/MovieSearchEngine.cs @@ -195,6 +195,10 @@ namespace Ombi.Core.Engine { // Check if this user requested it var user = await GetUser(); + if (user == null) + { + return; + } var request = await RequestService.MovieRequestService.GetAll() .AnyAsync(x => x.RequestedUserId.Equals(user.Id) && x.TheMovieDbId == viewModel.Id); if (request) From b375dd888b9b7798cbb4188a7b71a85cc9ef91c4 Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 9 Jan 2019 13:10:38 +0000 Subject: [PATCH 80/80] There is now a new Job in ombi that will clear out the Plex/Emby data and recache. This will prevent the issues going forward that we have when Ombi and the Media server fall out of sync with deletions/updates #2641 #2362 #1566 --- src/Ombi.DependencyInjection/IocExtensions.cs | 1 + src/Ombi.Helpers/LoggingEvents.cs | 1 + src/Ombi.Schedule/JobSetup.cs | 7 +- .../Ombi/{ => Interfaces}/IIssuesPurge.cs | 0 .../Ombi/Interfaces/IMediaDatabaseRefresh.cs | 9 ++ .../Ombi/{ => Interfaces}/INewsletterJob.cs | 0 .../{ => Interfaces}/IOmbiAutomaticUpdater.cs | 0 .../Ombi/{ => Interfaces}/IRefreshMetadata.cs | 0 .../{ => Interfaces}/IResendFailedRequests.cs | 0 .../Ombi/{ => Interfaces}/IWelcomeEmail.cs | 0 .../Jobs/Ombi/{ => Interfaces}/IssuesPurge.cs | 0 .../Jobs/Ombi/MediaDatabaseRefresh.cs | 120 ++++++++++++++++++ .../Settings/Models/JobSettings.cs | 1 + .../Settings/Models/JobSettingsHelper.cs | 5 +- .../ClientApp/app/interfaces/ISettings.ts | 1 + .../app/settings/jobs/jobs.component.html | 7 + .../app/settings/jobs/jobs.component.ts | 1 + src/Ombi/Controllers/SettingsController.cs | 1 + 18 files changed, 151 insertions(+), 3 deletions(-) rename src/Ombi.Schedule/Jobs/Ombi/{ => Interfaces}/IIssuesPurge.cs (100%) create mode 100644 src/Ombi.Schedule/Jobs/Ombi/Interfaces/IMediaDatabaseRefresh.cs rename src/Ombi.Schedule/Jobs/Ombi/{ => Interfaces}/INewsletterJob.cs (100%) rename src/Ombi.Schedule/Jobs/Ombi/{ => Interfaces}/IOmbiAutomaticUpdater.cs (100%) rename src/Ombi.Schedule/Jobs/Ombi/{ => Interfaces}/IRefreshMetadata.cs (100%) rename src/Ombi.Schedule/Jobs/Ombi/{ => Interfaces}/IResendFailedRequests.cs (100%) rename src/Ombi.Schedule/Jobs/Ombi/{ => Interfaces}/IWelcomeEmail.cs (100%) rename src/Ombi.Schedule/Jobs/Ombi/{ => Interfaces}/IssuesPurge.cs (100%) create mode 100644 src/Ombi.Schedule/Jobs/Ombi/MediaDatabaseRefresh.cs diff --git a/src/Ombi.DependencyInjection/IocExtensions.cs b/src/Ombi.DependencyInjection/IocExtensions.cs index 190e79203..09dbf4e79 100644 --- a/src/Ombi.DependencyInjection/IocExtensions.cs +++ b/src/Ombi.DependencyInjection/IocExtensions.cs @@ -200,6 +200,7 @@ namespace Ombi.DependencyInjection services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } } } diff --git a/src/Ombi.Helpers/LoggingEvents.cs b/src/Ombi.Helpers/LoggingEvents.cs index 40ec3fd2b..3893dc879 100644 --- a/src/Ombi.Helpers/LoggingEvents.cs +++ b/src/Ombi.Helpers/LoggingEvents.cs @@ -21,6 +21,7 @@ namespace Ombi.Helpers public static EventId PlexContentCacher => new EventId(2008); public static EventId SickRageCacher => new EventId(2009); public static EventId LidarrArtistCache => new EventId(2010); + public static EventId MediaReferesh => new EventId(2011); public static EventId MovieSender => new EventId(3000); diff --git a/src/Ombi.Schedule/JobSetup.cs b/src/Ombi.Schedule/JobSetup.cs index fa111d5f4..5cc818441 100644 --- a/src/Ombi.Schedule/JobSetup.cs +++ b/src/Ombi.Schedule/JobSetup.cs @@ -7,6 +7,7 @@ using Ombi.Schedule.Jobs.Emby; using Ombi.Schedule.Jobs.Lidarr; using Ombi.Schedule.Jobs.Ombi; using Ombi.Schedule.Jobs.Plex; +using Ombi.Schedule.Jobs.Plex.Interfaces; using Ombi.Schedule.Jobs.Radarr; using Ombi.Schedule.Jobs.SickRage; using Ombi.Schedule.Jobs.Sonarr; @@ -21,7 +22,7 @@ namespace Ombi.Schedule IEmbyUserImporter embyUserImporter, ISonarrSync cache, ICouchPotatoSync cpCache, ISettingsService jobsettings, ISickRageSync srSync, IRefreshMetadata refresh, INewsletterJob newsletter, IPlexRecentlyAddedSync recentlyAddedPlex, ILidarrArtistSync artist, - IIssuesPurge purge, IResendFailedRequests resender) + IIssuesPurge purge, IResendFailedRequests resender, IMediaDatabaseRefresh dbRefresh) { _plexContentSync = plexContentSync; _radarrSync = radarrSync; @@ -39,6 +40,7 @@ namespace Ombi.Schedule _lidarrArtistSync = artist; _issuesPurge = purge; _resender = resender; + _mediaDatabaseRefresh = dbRefresh; } private readonly IPlexContentSync _plexContentSync; @@ -57,6 +59,7 @@ namespace Ombi.Schedule private readonly ILidarrArtistSync _lidarrArtistSync; private readonly IIssuesPurge _issuesPurge; private readonly IResendFailedRequests _resender; + private readonly IMediaDatabaseRefresh _mediaDatabaseRefresh; public void Setup() { @@ -80,9 +83,9 @@ namespace Ombi.Schedule RecurringJob.AddOrUpdate(() => _newsletter.Start(), JobSettingsHelper.Newsletter(s)); RecurringJob.AddOrUpdate(() => _newsletter.Start(), JobSettingsHelper.Newsletter(s)); RecurringJob.AddOrUpdate(() => _resender.Start(), JobSettingsHelper.ResendFailedRequests(s)); + RecurringJob.AddOrUpdate(() => _mediaDatabaseRefresh.Start(), JobSettingsHelper.MediaDatabaseRefresh(s)); } - private bool _disposed; protected virtual void Dispose(bool disposing) { diff --git a/src/Ombi.Schedule/Jobs/Ombi/IIssuesPurge.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IIssuesPurge.cs similarity index 100% rename from src/Ombi.Schedule/Jobs/Ombi/IIssuesPurge.cs rename to src/Ombi.Schedule/Jobs/Ombi/Interfaces/IIssuesPurge.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IMediaDatabaseRefresh.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IMediaDatabaseRefresh.cs new file mode 100644 index 000000000..11fe7c51a --- /dev/null +++ b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IMediaDatabaseRefresh.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace Ombi.Schedule.Jobs.Plex.Interfaces +{ + public interface IMediaDatabaseRefresh : IBaseJob + { + Task Start(); + } +} \ No newline at end of file diff --git a/src/Ombi.Schedule/Jobs/Ombi/INewsletterJob.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/INewsletterJob.cs similarity index 100% rename from src/Ombi.Schedule/Jobs/Ombi/INewsletterJob.cs rename to src/Ombi.Schedule/Jobs/Ombi/Interfaces/INewsletterJob.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/IOmbiAutomaticUpdater.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IOmbiAutomaticUpdater.cs similarity index 100% rename from src/Ombi.Schedule/Jobs/Ombi/IOmbiAutomaticUpdater.cs rename to src/Ombi.Schedule/Jobs/Ombi/Interfaces/IOmbiAutomaticUpdater.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/IRefreshMetadata.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IRefreshMetadata.cs similarity index 100% rename from src/Ombi.Schedule/Jobs/Ombi/IRefreshMetadata.cs rename to src/Ombi.Schedule/Jobs/Ombi/Interfaces/IRefreshMetadata.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/IResendFailedRequests.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IResendFailedRequests.cs similarity index 100% rename from src/Ombi.Schedule/Jobs/Ombi/IResendFailedRequests.cs rename to src/Ombi.Schedule/Jobs/Ombi/Interfaces/IResendFailedRequests.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/IWelcomeEmail.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IWelcomeEmail.cs similarity index 100% rename from src/Ombi.Schedule/Jobs/Ombi/IWelcomeEmail.cs rename to src/Ombi.Schedule/Jobs/Ombi/Interfaces/IWelcomeEmail.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/IssuesPurge.cs b/src/Ombi.Schedule/Jobs/Ombi/Interfaces/IssuesPurge.cs similarity index 100% rename from src/Ombi.Schedule/Jobs/Ombi/IssuesPurge.cs rename to src/Ombi.Schedule/Jobs/Ombi/Interfaces/IssuesPurge.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/MediaDatabaseRefresh.cs b/src/Ombi.Schedule/Jobs/Ombi/MediaDatabaseRefresh.cs new file mode 100644 index 000000000..baa7fdcae --- /dev/null +++ b/src/Ombi.Schedule/Jobs/Ombi/MediaDatabaseRefresh.cs @@ -0,0 +1,120 @@ +using System; +using System.Threading.Tasks; +using Hangfire; +using Microsoft.Extensions.Logging; +using Ombi.Api.Plex; +using Ombi.Core.Settings; +using Ombi.Core.Settings.Models.External; +using Ombi.Helpers; +using Ombi.Schedule.Jobs.Emby; +using Ombi.Schedule.Jobs.Plex.Interfaces; +using Ombi.Store.Repository; + +namespace Ombi.Schedule.Jobs.Plex +{ + public class MediaDatabaseRefresh : IMediaDatabaseRefresh + { + public MediaDatabaseRefresh(ISettingsService s, ILogger log, IPlexApi plexApi, + IPlexContentRepository plexRepo, IPlexContentSync c, IEmbyContentRepository embyRepo, IEmbyContentSync embySync) + { + _settings = s; + _log = log; + _api = plexApi; + _plexRepo = plexRepo; + _plexContentSync = c; + _embyRepo = embyRepo; + _embyContentSync = embySync; + _settings.ClearCache(); + } + + private readonly ISettingsService _settings; + private readonly ILogger _log; + private readonly IPlexApi _api; + private readonly IPlexContentRepository _plexRepo; + private readonly IPlexContentSync _plexContentSync; + private readonly IEmbyContentRepository _embyRepo; + private readonly IEmbyContentSync _embyContentSync; + + public async Task Start() + { + try + { + await RemovePlexData(); + await RemoveEmbyData(); + } + catch (Exception e) + { + _log.LogError(LoggingEvents.MediaReferesh, e, "Refreshing Media Data Failed"); + } + + } + + private async Task RemoveEmbyData() + { + try + { + var s = await _settings.GetSettingsAsync(); + if (!s.Enable) + { + return; + } + + const string episodeSQL = "DELETE FROM EmbyEpisode"; + const string mainSql = "DELETE FROM EmbyContent"; + await _embyRepo.ExecuteSql(episodeSQL); + await _embyRepo.ExecuteSql(mainSql); + + BackgroundJob.Enqueue(() => _embyContentSync.Start()); + } + catch (Exception e) + { + _log.LogError(LoggingEvents.MediaReferesh, e, "Refreshing Emby Data Failed"); + } + } + + private async Task RemovePlexData() + { + try + { + var s = await _settings.GetSettingsAsync(); + if (!s.Enable) + { + return; + } + + const string episodeSQL = "DELETE FROM PlexEpisode"; + const string seasonsSql = "DELETE FROM PlexSeasonsContent"; + const string mainSql = "DELETE FROM PlexServerContent"; + await _plexRepo.ExecuteSql(episodeSQL); + await _plexRepo.ExecuteSql(seasonsSql); + await _plexRepo.ExecuteSql(mainSql); + } + catch (Exception e) + { + _log.LogError(LoggingEvents.MediaReferesh, e, "Refreshing Plex Data Failed"); + } + } + + + + private bool _disposed; + protected virtual void Dispose(bool disposing) + { + if (_disposed) + return; + + if (disposing) + { + _plexRepo?.Dispose(); + _settings?.Dispose(); + } + _disposed = true; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/src/Ombi.Settings/Settings/Models/JobSettings.cs b/src/Ombi.Settings/Settings/Models/JobSettings.cs index 46a950185..4376088a3 100644 --- a/src/Ombi.Settings/Settings/Models/JobSettings.cs +++ b/src/Ombi.Settings/Settings/Models/JobSettings.cs @@ -16,5 +16,6 @@ public string LidarrArtistSync { get; set; } public string IssuesPurge { get; set; } public string RetryRequests { get; set; } + public string MediaDatabaseRefresh { get; set; } } } \ No newline at end of file diff --git a/src/Ombi.Settings/Settings/Models/JobSettingsHelper.cs b/src/Ombi.Settings/Settings/Models/JobSettingsHelper.cs index 1aca72344..e2080e3cb 100644 --- a/src/Ombi.Settings/Settings/Models/JobSettingsHelper.cs +++ b/src/Ombi.Settings/Settings/Models/JobSettingsHelper.cs @@ -65,7 +65,10 @@ namespace Ombi.Settings.Settings.Models { return Get(s.RetryRequests, Cron.Daily(6)); } - + public static string MediaDatabaseRefresh(JobSettings s) + { + return Get(s.MediaDatabaseRefresh, Cron.DayInterval(5)); + } private static string Get(string settings, string defaultCron) { return settings.HasValue() ? settings : defaultCron; diff --git a/src/Ombi/ClientApp/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/app/interfaces/ISettings.ts index 2f8a4e80b..1f62a2c8d 100644 --- a/src/Ombi/ClientApp/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/app/interfaces/ISettings.ts @@ -138,6 +138,7 @@ export interface IJobSettings { lidarrArtistSync: string; issuesPurge: string; retryRequests: string; + mediaDatabaseRefresh: string; } export interface IIssueSettings extends ISettings { diff --git a/src/Ombi/ClientApp/app/settings/jobs/jobs.component.html b/src/Ombi/ClientApp/app/settings/jobs/jobs.component.html index e889c0fca..4532af9b3 100644 --- a/src/Ombi/ClientApp/app/settings/jobs/jobs.component.html +++ b/src/Ombi/ClientApp/app/settings/jobs/jobs.component.html @@ -105,6 +105,13 @@ The Issues Purge is required + +
+ + + The Media Database Refresh is required + +
diff --git a/src/Ombi/ClientApp/app/settings/jobs/jobs.component.ts b/src/Ombi/ClientApp/app/settings/jobs/jobs.component.ts index 853005185..747a4bfde 100644 --- a/src/Ombi/ClientApp/app/settings/jobs/jobs.component.ts +++ b/src/Ombi/ClientApp/app/settings/jobs/jobs.component.ts @@ -37,6 +37,7 @@ export class JobsComponent implements OnInit { lidarrArtistSync: [x.lidarrArtistSync, Validators.required], issuesPurge: [x.issuesPurge, Validators.required], retryRequests: [x.retryRequests, Validators.required], + mediaDatabaseRefresh: [x.mediaDatabaseRefresh, Validators.required], }); }); } diff --git a/src/Ombi/Controllers/SettingsController.cs b/src/Ombi/Controllers/SettingsController.cs index 892471d94..0fe67edfd 100644 --- a/src/Ombi/Controllers/SettingsController.cs +++ b/src/Ombi/Controllers/SettingsController.cs @@ -522,6 +522,7 @@ namespace Ombi.Controllers j.LidarrArtistSync = j.LidarrArtistSync.HasValue() ? j.LidarrArtistSync : JobSettingsHelper.LidarrArtistSync(j); j.IssuesPurge = j.IssuesPurge.HasValue() ? j.IssuesPurge : JobSettingsHelper.IssuePurge(j); j.RetryRequests = j.RetryRequests.HasValue() ? j.RetryRequests : JobSettingsHelper.ResendFailedRequests(j); + j.MediaDatabaseRefresh = j.MediaDatabaseRefresh.HasValue() ? j.MediaDatabaseRefresh : JobSettingsHelper.MediaDatabaseRefresh(j); return j; }