diff --git a/CHANGELOG.md b/CHANGELOG.md index 547a2a896..d74042ee1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,58 @@ +# [4.3.0](https://github.com/Ombi-app/Ombi/compare/v4.2.13...v4.3.0) (2021-10-20) + + +### Bug Fixes + +* **translations:** 🌐 New translations from Crowdin [skip ci] ([b0f3abb](https://github.com/Ombi-app/Ombi/commit/b0f3abb9ceebdbe5d6c20af98b7355df2999eb58)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([77d017b](https://github.com/Ombi-app/Ombi/commit/77d017b3d8ffd1714a2f6efecc8c900d56d062e4)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([f6e9784](https://github.com/Ombi-app/Ombi/commit/f6e9784367d3678d899ed79bef6caa52005b6661)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([601a877](https://github.com/Ombi-app/Ombi/commit/601a87762a2ad393ee5fa2fe52052ceeeefb1bef)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([a4a80ba](https://github.com/Ombi-app/Ombi/commit/a4a80ba4da49733a65e691003646c0f349bd4c5f)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([2961319](https://github.com/Ombi-app/Ombi/commit/2961319f61e95b2871480152b86ddca3375576a1)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([fc8d108](https://github.com/Ombi-app/Ombi/commit/fc8d108b660d53f499538328bfc271b05ac47d2b)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([1e03651](https://github.com/Ombi-app/Ombi/commit/1e03651c3b0eb77e45f9f6c55d31ee672eacd51e)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([c0dd327](https://github.com/Ombi-app/Ombi/commit/c0dd327426514e305a88750d7c3deb21c194108f)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([2156129](https://github.com/Ombi-app/Ombi/commit/2156129f175335746f204bb123035c070f518e96)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([aef0368](https://github.com/Ombi-app/Ombi/commit/aef0368de3aec306245bd1b16bc0de596a20d451)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([a38090b](https://github.com/Ombi-app/Ombi/commit/a38090b8dde17d1d150af0bca2830ea45d013a0e)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([c5f1d33](https://github.com/Ombi-app/Ombi/commit/c5f1d3355758a5c3648479d44e50397c7f6c1a9d)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([3846d56](https://github.com/Ombi-app/Ombi/commit/3846d56a6e561a1b1dc65c385151d90fdd6217ee)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([dafe9c1](https://github.com/Ombi-app/Ombi/commit/dafe9c1a19d84f00c13f0a51ba90927c24282926)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([edb418a](https://github.com/Ombi-app/Ombi/commit/edb418a6f05887c68a0c24c48decc691996f97e4)) +* **translations:** 🌐 New translations from Crowdin [skip ci] ([dadabf9](https://github.com/Ombi-app/Ombi/commit/dadabf93e1582a0c39321fd9bf3de3fb11e3f406)) + + +### Features + +* **request-limits:** :sparkles: Added the new request limit options into the user importer ([01d4f4d](https://github.com/Ombi-app/Ombi/commit/01d4f4d718fe85ac181dae52565fb1b427965b4f)) +* **request-limits:** :sparkles: Added the new request limit options to the bulk edit ([03bc23a](https://github.com/Ombi-app/Ombi/commit/03bc23a74e4308aa6b4c6b25636edcdeb65c1f0e)) + + + +## [4.2.13](https://github.com/Ombi-app/Ombi/compare/v4.2.12...v4.2.13) (2021-10-20) + + +### Bug Fixes + +* **translations:** 🌐 New translations %two_letters_code% from Crowdin [skip ci] ([8fbd267](https://github.com/Ombi-app/Ombi/commit/8fbd267b516ddaa80fd16c091bae532b860fbf45)) + + + +## [4.2.12](https://github.com/Ombi-app/Ombi/compare/v4.2.11...v4.2.12) (2021-10-20) + + +### Bug Fixes + +* **newsletter:** :bug: Fixed a few small bugs in the newsletter ([21dba4c](https://github.com/Ombi-app/Ombi/commit/21dba4c524b98b9f2b883d97e7e13329425a8762)) +* **translations:** 🌐 New translations en.json from Crowdin [skip ci] ([52eda6a](https://github.com/Ombi-app/Ombi/commit/52eda6ab917a73842bc02b0d8e0c442e564ca8f0)) +* **translations:** 🌐 New translations en.json from Crowdin [skip ci] ([1095d52](https://github.com/Ombi-app/Ombi/commit/1095d524962648a1e427f0bcd8105fa734dd5b60)) + + + +## [4.2.11](https://github.com/Ombi-app/Ombi/compare/v4.2.10...v4.2.11) (2021-10-18) + + + ## [4.2.10](https://github.com/Ombi-app/Ombi/compare/v4.2.9...v4.2.10) (2021-10-15) @@ -7,40 +62,3 @@ -## [4.2.9](https://github.com/Ombi-app/Ombi/compare/v4.2.8...v4.2.9) (2021-10-15) - - -### Bug Fixes - -* :fire: Really fix the base url issue this time ([9f36923](https://github.com/Ombi-app/Ombi/commit/9f36923c51bfabf9cb026f2da14f9947050af0d9)) - - - -## [4.2.8](https://github.com/Ombi-app/Ombi/compare/v4.2.7...v4.2.8) (2021-10-15) - - -### Bug Fixes - -* :adhesive_bandage: See if this fixes the proxy issue ([74d1aca](https://github.com/Ombi-app/Ombi/commit/74d1acae499707a7e21401f53eb2bb90c5bb9cfa)) -* :bug: Fixed Ombi not writing the baseUrl correctly ([e9cc8b6](https://github.com/Ombi-app/Ombi/commit/e9cc8b6fe71d3e10c1a901e70227989b3362afe3)) - - - -## [4.2.7](https://github.com/Ombi-app/Ombi/compare/v4.2.6...v4.2.7) (2021-10-14) - - -### Bug Fixes - -* :bug: Fixed the issue parsing TheMovieDB dates. They have broken something... ([6e397e0](https://github.com/Ombi-app/Ombi/commit/6e397e02e95f894a92e8bf02428efdcac1275b31)) - - - -## [4.2.6](https://github.com/Ombi-app/Ombi/compare/v4.2.5...v4.2.6) (2021-10-14) - - -### Performance Improvements - -* :zap: Use ngxs store for the whole customization section of the app ([97b493d](https://github.com/Ombi-app/Ombi/commit/97b493d869feee59d360b484a6c59388a2aead1f)) - - - diff --git a/README.md b/README.md index b93a05995..5a395355c 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,13 @@ Here are some of the features Ombi has: Dyson Parkes + + + sephrat +
+ Sephrat +
+ goldenpipes @@ -191,15 +198,15 @@ Here are some of the features Ombi has:
Julien Loir
- + + ProtoJazz
Jim MacKenize
- - + Unimatrix0 @@ -234,15 +241,15 @@ Here are some of the features Ombi has:
Taylor Buchanan
- + + Patricol
Patrick Collins
- - + chriscpritchard @@ -277,15 +284,15 @@ Here are some of the features Ombi has:
Mhann
- + + ombi-bot
Ombi-bot
- - + snyk-bot @@ -320,15 +327,15 @@ Here are some of the features Ombi has:
David Pooley
- + + Fredrik81
Fredrik81
- - + Aerion @@ -363,15 +370,15 @@ Here are some of the features Ombi has:
Qstick
- + + Vbgf
Vbgf
- - + sorano @@ -406,15 +413,15 @@ Here are some of the features Ombi has:
Aljosa Asanovic
- + + Ashyni
Ashyni
- - + Majawat @@ -449,15 +456,15 @@ Here are some of the features Ombi has:
Codehhh
- + + danopia
Daniel Lamando
- - + hmnd @@ -492,15 +499,15 @@ Here are some of the features Ombi has:
Fish2
- + + hariesramdhani
Haries Ramdhani
- - + ImgBotApp @@ -535,15 +542,15 @@ Here are some of the features Ombi has:
Joe Harvey
- + + jonbloom
Jon Bloom
- - + jonocairns @@ -578,15 +585,15 @@ Here are some of the features Ombi has:
Madeleine Schönemann
- + + mattmattmatt
Matt
- - + AliMickey @@ -621,15 +628,15 @@ Here are some of the features Ombi has:
Samuel Bartík
- + + seancallinan
Sean Callinan
- - + shoghicp @@ -664,15 +671,15 @@ Here are some of the features Ombi has:
Torkil
- + + bybeet
Travis Bybee
- - + Xirg @@ -707,15 +714,15 @@ Here are some of the features Ombi has:
Michael DiStaula
- + + baikunz
Dorian ALKOUM
- - + m4tta @@ -750,7 +757,8 @@ Here are some of the features Ombi has:
Mike
- + + zobe123 diff --git a/crowdin.yml b/crowdin.yml index 5155c348c..b7f48ef88 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,10 @@ + +commit_message: "fix(translations): 🌐 New translations from Crowdin [skip ci]" +append_commit_message: false +pull_request_title: "🌐 Translations Update" +pull_request_labels: + - translations + files: - source: /src/Ombi/wwwroot/translations/en.json translation: /src/Ombi/wwwroot/translations/%two_letters_code%.json diff --git a/src/Ombi.Schedule.Tests/NewsletterUnsubscribeTests.cs b/src/Ombi.Schedule.Tests/NewsletterUnsubscribeTests.cs index 0fc961058..0ed9cf163 100644 --- a/src/Ombi.Schedule.Tests/NewsletterUnsubscribeTests.cs +++ b/src/Ombi.Schedule.Tests/NewsletterUnsubscribeTests.cs @@ -29,6 +29,8 @@ namespace Ombi.Schedule.Tests yield return new TestCaseData("https://google.com:3577/", "1").Returns("https://google.com:3577/unsubscribe/1").SetName("Port With Slash"); yield return new TestCaseData("", "1").Returns(string.Empty).SetName("Missing App URL empty"); yield return new TestCaseData(null, "1").Returns(string.Empty).SetName("Missing App URL null"); + yield return new TestCaseData("hty", string.Empty).Returns(string.Empty).SetName("Missing ID empty"); + yield return new TestCaseData("hty", null).Returns(string.Empty).SetName("Missing ID null"); } } } diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs index 4b684b8ab..e85cdb9c4 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs @@ -117,7 +117,11 @@ namespace Ombi.Schedule.Jobs.Emby ProviderUserId = embyUser.Id, Alias = isConnectUser ? embyUser.Name : string.Empty, MovieRequestLimit = userManagementSettings.MovieRequestLimit, + MovieRequestLimitType = userManagementSettings.MovieRequestLimitType, EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit, + EpisodeRequestLimitType = userManagementSettings.EpisodeRequestLimitType, + MusicRequestLimit = userManagementSettings.MusicRequestLimit, + MusicRequestLimitType = userManagementSettings.MusicRequestLimitType, StreamingCountry = userManagementSettings.DefaultStreamingCountry }; var result = await _userManager.CreateAsync(newUser); diff --git a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs index 0088e00fd..cd24cda8b 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/NewsletterJob.cs @@ -208,13 +208,7 @@ namespace Ombi.Schedule.Jobs.Ombi if (!test) { - // Get the users to send it to - var users = await _userManager.GetUsersInRoleAsync(OmbiRoles.ReceivesNewsletter); - if (!users.Any()) - { - return; - } - + var users = new List(); foreach (var emails in settings.ExternalEmails) { users.Add(new OmbiUser @@ -224,11 +218,23 @@ namespace Ombi.Schedule.Jobs.Ombi }); } + // Get the users to send it to + users.AddRange(await _userManager.GetUsersInRoleAsync(OmbiRoles.ReceivesNewsletter)); + if (!users.Any()) + { + return; + } + var messageContent = ParseTemplate(template, customization); var email = new NewsletterTemplate(); - foreach (var user in users) - { + foreach (var user in users.DistinctBy(x => x.Email)) + { // Get the users to send it to + if (user.Email.IsNullOrEmpty()) + { + continue; + } + var url = GenerateUnsubscribeLink(customization.ApplicationUrl, user.Id); var html = email.LoadTemplate(messageContent.Subject, messageContent.Message, body, customization.Logo, url); @@ -243,11 +249,6 @@ namespace Ombi.Schedule.Jobs.Ombi Subject = messageContent.Subject }; - // Get the users to send it to - if (user.Email.IsNullOrEmpty()) - { - continue; - } // Send the message to the user message.To.Add(new MailboxAddress(user.Email.Trim(), user.Email.Trim())); @@ -391,7 +392,7 @@ namespace Ombi.Schedule.Jobs.Ombi public static string GenerateUnsubscribeLink(string applicationUrl, string id) { - if (!applicationUrl.HasValue()) + if (!applicationUrl.HasValue() || !id.HasValue()) { return string.Empty; } diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs b/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs index 1e484b237..56872c1a8 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs @@ -104,7 +104,11 @@ namespace Ombi.Schedule.Jobs.Plex Email = plexUser?.Email ?? string.Empty, Alias = string.Empty, MovieRequestLimit = userManagementSettings.MovieRequestLimit, + MovieRequestLimitType = userManagementSettings.MovieRequestLimitType, EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit, + EpisodeRequestLimitType = userManagementSettings.EpisodeRequestLimitType, + MusicRequestLimit = userManagementSettings.MusicRequestLimit, + MusicRequestLimitType = userManagementSettings.MusicRequestLimitType, StreamingCountry = userManagementSettings.DefaultStreamingCountry }; _log.LogInformation("Creating Plex user {0}", newUser.UserName); diff --git a/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs b/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs index ff6cff278..3547812ee 100644 --- a/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs +++ b/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using Ombi.Store.Entities; +using System.Collections.Generic; namespace Ombi.Settings.Settings.Models { @@ -9,7 +10,11 @@ namespace Ombi.Settings.Settings.Models public bool ImportEmbyUsers { get; set; } public bool ImportJellyfinUsers { get; set; } public int MovieRequestLimit { get; set; } + public RequestLimitType MovieRequestLimitType { get; set; } = RequestLimitType.Week; public int EpisodeRequestLimit { get; set; } + public RequestLimitType EpisodeRequestLimitType { get; set; } = RequestLimitType.Week; + public int MusicRequestLimit { get; set; } + public RequestLimitType MusicRequestLimitType { get; set; } = RequestLimitType.Week; public string DefaultStreamingCountry { get; set; } = "US"; public List DefaultRoles { get; set; } = new List(); public List BannedPlexUserIds { get; set; } = new List(); diff --git a/src/Ombi/.vscode/settings.json b/src/Ombi/.vscode/settings.json index f7b75c335..89d2dbd93 100644 --- a/src/Ombi/.vscode/settings.json +++ b/src/Ombi/.vscode/settings.json @@ -16,6 +16,7 @@ "request-limits", "notifications", "settings", - "user-management" + "user-management", + "newsletter" ] } diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts index 56002c9e9..0907404a8 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Input } from "@angular/core"; import { IDiscoverCardResult } from "../../interfaces"; import { RequestType } from "../../../interfaces"; import { MessageService, RequestService, SearchV2Service } from "../../../services"; +import { TranslateService } from "@ngx-translate/core"; import { MatDialog } from "@angular/material/dialog"; import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2"; @@ -30,7 +31,7 @@ export class DiscoverCardComponent implements OnInit { private tvSearchResult: ISearchTvResultV2; constructor(private searchService: SearchV2Service, private dialog: MatDialog, private requestService: RequestService, - public messageService: MessageService) { } + public messageService: MessageService, private translate: TranslateService) { } public ngOnInit() { if (this.result.type == RequestType.tvShow) { @@ -98,13 +99,13 @@ export class DiscoverCardComponent implements OnInit { public getAvailbilityStatus(): string { if (this.result.available) { - return "Available"; + return this.translate.instant("Common.Available"); } if (this.result.approved) { - return "Approved"; + return this.translate.instant("Common.Approved"); } if (this.result.requested) { - return "Pending"; + return this.translate.instant("Common.Pending"); } return ""; } @@ -129,7 +130,7 @@ export class DiscoverCardComponent implements OnInit { rootFolderOverride: result.radarrFolderId, }).subscribe(x => { if (x.result) { this.result.requested = true; - this.messageService.send(x.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok"); } else { this.messageService.send(x.errorMessage, "Ok"); } @@ -140,7 +141,7 @@ export class DiscoverCardComponent implements OnInit { this.requestService.requestMovie({ theMovieDbId: +this.result.id, languageCode: null, requestOnBehalf: null, qualityPathOverride: null, rootFolderOverride: null }).subscribe(x => { if (x.result) { this.result.requested = true; - this.messageService.send(x.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok"); } else { this.messageService.send(x.errorMessage, "Ok"); } diff --git a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html index 6c892fae6..23a7791f0 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html @@ -7,8 +7,7 @@

{{collection.overview}}

- +