mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Merge branch 'develop' into radarr4k
This commit is contained in:
commit
0c65f1f320
8 changed files with 75 additions and 44 deletions
3
.github/workflows/issue-check.yml
vendored
3
.github/workflows/issue-check.yml
vendored
|
@ -8,9 +8,6 @@ jobs:
|
||||||
issueCheck:
|
issueCheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Output version
|
|
||||||
run: |
|
|
||||||
echo "log: ${{ github.event.issue.body }}"
|
|
||||||
|
|
||||||
- if: startsWith(github.event.issue.body , '**Describe the bug**') == false
|
- if: startsWith(github.event.issue.body , '**Describe the bug**') == false
|
||||||
name: Close Issue
|
name: Close Issue
|
||||||
|
|
38
CHANGELOG.md
38
CHANGELOG.md
|
@ -1,3 +1,21 @@
|
||||||
|
## [4.11.7](https://github.com/Ombi-app/Ombi/compare/v4.11.6...v4.11.7) (2022-02-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **notifications:** :bug: This is a fix for some of the duplicate notification issues [#3825](https://github.com/Ombi-app/Ombi/issues/3825) ([22bb422](https://github.com/Ombi-app/Ombi/commit/22bb4226ead2d62e8c2c2c05be47d7da621402e2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [4.11.6](https://github.com/Ombi-app/Ombi/compare/v4.11.5...v4.11.6) (2022-02-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **plex:** Fixed an issue where in a rare case we couldn't sync the data [#4502](https://github.com/Ombi-app/Ombi/issues/4502) ([191318d](https://github.com/Ombi-app/Ombi/commit/191318ddad5a8148422955bf928f1c49b890e3eb))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [4.11.5](https://github.com/Ombi-app/Ombi/compare/v4.11.4...v4.11.5) (2022-02-05)
|
## [4.11.5](https://github.com/Ombi-app/Ombi/compare/v4.11.4...v4.11.5) (2022-02-05)
|
||||||
|
|
||||||
|
|
||||||
|
@ -360,23 +378,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [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))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,22 +12,15 @@ namespace Ombi.Api.Plex.Models
|
||||||
public string contentRating { get; set; }
|
public string contentRating { get; set; }
|
||||||
public string summary { get; set; }
|
public string summary { get; set; }
|
||||||
public int index { get; set; }
|
public int index { get; set; }
|
||||||
//public int viewCount { get; set; }
|
|
||||||
//public int lastViewedAt { get; set; }
|
|
||||||
public int year { get; set; }
|
public int year { get; set; }
|
||||||
public string thumb { get; set; }
|
public string thumb { get; set; }
|
||||||
public string art { get; set; }
|
public string art { get; set; }
|
||||||
public string banner { get; set; }
|
public string banner { get; set; }
|
||||||
public string theme { get; set; }
|
public string theme { get; set; }
|
||||||
//public string duration { get; set; }
|
|
||||||
//public string originallyAvailableAt { get; set; }
|
|
||||||
public int leafCount { get; set; }
|
public int leafCount { get; set; }
|
||||||
public int viewedLeafCount { get; set; }
|
public int viewedLeafCount { get; set; }
|
||||||
public int childCount { get; set; }
|
public int childCount { get; set; }
|
||||||
//public long addedAt { get; set; }
|
|
||||||
//public int updatedAt { get; set; }
|
|
||||||
public Genre[] Genre { get; set; }
|
public Genre[] Genre { get; set; }
|
||||||
//public Role[] Role { get; set; }
|
|
||||||
public string primaryExtraKey { get; set; }
|
public string primaryExtraKey { get; set; }
|
||||||
public int parentRatingKey { get; set; }
|
public int parentRatingKey { get; set; }
|
||||||
public int grandparentRatingKey { get; set; }
|
public int grandparentRatingKey { get; set; }
|
||||||
|
@ -46,8 +39,6 @@ namespace Ombi.Api.Plex.Models
|
||||||
public string chapterSource { get; set; }
|
public string chapterSource { get; set; }
|
||||||
public Medium[] Media { get; set; }
|
public Medium[] Media { get; set; }
|
||||||
public List<PlexGuids> Guid { get; set; } = new List<PlexGuids>();
|
public List<PlexGuids> Guid { get; set; } = new List<PlexGuids>();
|
||||||
// public Director[] Director { get; set; }
|
|
||||||
// public Writer[] Writer { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PlexGuids
|
public class PlexGuids
|
||||||
|
|
42
src/Ombi.Notifications.Tests/NotificationServiceTests.cs
Normal file
42
src/Ombi.Notifications.Tests/NotificationServiceTests.cs
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.Extensions.Logging.Abstractions;
|
||||||
|
using Moq.AutoMock;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Ombi.Notifications.Tests
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class NotificationServiceTests
|
||||||
|
{
|
||||||
|
|
||||||
|
private NotitficationServiceTestFacade _subject;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
var mocker = new AutoMocker();
|
||||||
|
mocker.Use(NullLogger.Instance);
|
||||||
|
_subject = mocker.CreateInstance<NotitficationServiceTestFacade>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void PopulateAgentsTests()
|
||||||
|
{
|
||||||
|
Assert.That(_subject.Agents, Has.Count.EqualTo(12));
|
||||||
|
Assert.That(_subject.Agents.DistinctBy(x => x.NotificationName).ToList(), Has.Count.EqualTo(12));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class NotitficationServiceTestFacade : NotificationService
|
||||||
|
{
|
||||||
|
public NotitficationServiceTestFacade(IServiceProvider provider, ILogger<NotificationService> log) : base(provider, log)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<INotification> Agents => base.NotificationAgents;
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,6 +13,7 @@
|
||||||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
|
||||||
<packagereference Include="Microsoft.NET.Test.Sdk" Version="16.8.0"></packagereference>
|
<packagereference Include="Microsoft.NET.Test.Sdk" Version="16.8.0"></packagereference>
|
||||||
<PackageReference Include="Moq" Version="4.10.0" />
|
<PackageReference Include="Moq" Version="4.10.0" />
|
||||||
|
<PackageReference Include="Moq.AutoMock" Version="0.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace Ombi.Notifications
|
||||||
AlbumRepository = album;
|
AlbumRepository = album;
|
||||||
UserNotificationPreferences = notificationUserPreferences;
|
UserNotificationPreferences = notificationUserPreferences;
|
||||||
_userManager = um;
|
_userManager = um;
|
||||||
Settings.ClearCache();
|
Settings?.ClearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ISettingsService<T> Settings { get; }
|
protected ISettingsService<T> Settings { get; }
|
||||||
|
@ -64,7 +64,11 @@ namespace Ombi.Notifications
|
||||||
|
|
||||||
public async Task NotifyAsync(NotificationOptions model, Settings.Settings.Models.Settings settings)
|
public async Task NotifyAsync(NotificationOptions model, Settings.Settings.Models.Settings settings)
|
||||||
{
|
{
|
||||||
if (settings == null) await NotifyAsync(model);
|
if (settings == null)
|
||||||
|
{
|
||||||
|
await NotifyAsync(model);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var notificationSettings = (T)settings;
|
var notificationSettings = (T)settings;
|
||||||
|
|
||||||
|
@ -114,15 +118,13 @@ namespace Ombi.Notifications
|
||||||
case NotificationType.IssueComment:
|
case NotificationType.IssueComment:
|
||||||
await IssueComment(model, notificationSettings);
|
await IssueComment(model, notificationSettings);
|
||||||
break;
|
break;
|
||||||
case NotificationType.AdminNote:
|
|
||||||
break;
|
|
||||||
case NotificationType.WelcomeEmail:
|
|
||||||
break;
|
|
||||||
case NotificationType.Newsletter:
|
|
||||||
break;
|
|
||||||
case NotificationType.PartiallyAvailable:
|
case NotificationType.PartiallyAvailable:
|
||||||
await PartiallyAvailable(model, notificationSettings);
|
await PartiallyAvailable(model, notificationSettings);
|
||||||
break;
|
break;
|
||||||
|
case NotificationType.AdminNote:
|
||||||
|
case NotificationType.WelcomeEmail:
|
||||||
|
case NotificationType.Newsletter:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Ombi.Notifications
|
||||||
PopulateAgents();
|
PopulateAgents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<INotification> NotificationAgents { get; }
|
protected List<INotification> NotificationAgents { get; }
|
||||||
private ILogger<NotificationService> Log { get; }
|
private ILogger<NotificationService> Log { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -55,7 +55,7 @@ namespace Ombi.Notifications
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PopulateAgents()
|
protected void PopulateAgents()
|
||||||
{
|
{
|
||||||
var baseSearchType = typeof(BaseNotification<>).Name;
|
var baseSearchType = typeof(BaseNotification<>).Name;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"version": "4.11.5"
|
"version": "4.11.7"
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue