Compare commits

...

2 Commits

Author SHA1 Message Date
Flaminel
c7d2ec7311 Fix notification provider update (#291) 2025-09-03 23:48:02 +03:00
Flaminel
bb9ac5b67b Fix notifications migration when no event type is enabled (#290) 2025-09-03 21:12:55 +03:00
2 changed files with 9 additions and 5 deletions

View File

@@ -593,7 +593,10 @@ public class ConfigurationController : ControllerBase
return BadRequest("Provider name is required");
}
var duplicateConfig = await _dataContext.NotificationConfigs.CountAsync(x => x.Name == updatedProvider.Name);
var duplicateConfig = await _dataContext.NotificationConfigs
.Where(x => x.Id != id)
.Where(x => x.Name == updatedProvider.Name)
.CountAsync();
if (duplicateConfig > 0)
{
@@ -699,7 +702,10 @@ public class ConfigurationController : ControllerBase
return BadRequest("Provider name is required");
}
var duplicateConfig = await _dataContext.NotificationConfigs.CountAsync(x => x.Name == updatedProvider.Name);
var duplicateConfig = await _dataContext.NotificationConfigs
.Where(x => x.Id != id)
.Where(x => x.Name == updatedProvider.Name)
.CountAsync();
if (duplicateConfig > 0)
{

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
@@ -52,7 +52,6 @@ namespace Cleanuparr.Persistence.Migrations.Data
datetime('now') AS updated_at
FROM notifiarr_configs
WHERE
(on_failed_import_strike = 1 OR on_stalled_strike = 1 OR on_slow_strike = 1 OR on_queue_item_deleted = 1 OR on_download_cleaned = 1 OR on_category_changed = 1) AND
channel_id IS NOT NULL AND channel_id != '' AND api_key IS NOT NULL AND api_key != ''
""");
@@ -75,7 +74,6 @@ namespace Cleanuparr.Persistence.Migrations.Data
datetime('now') AS updated_at
FROM apprise_configs
WHERE
(on_failed_import_strike = 1 OR on_stalled_strike = 1 OR on_slow_strike = 1 OR on_queue_item_deleted = 1 OR on_download_cleaned = 1 OR on_category_changed = 1) AND
key IS NOT NULL AND key != '' AND full_url IS NOT NULL AND full_url != ''
""");