mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-25 15:22:42 +00:00
Fixed: Cleanup of unused tags for Import lists
Co-Authored-By: Taloth <Taloth@users.noreply.github.com>
This commit is contained in:
parent
b8c84c8550
commit
d70a9195ea
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ public void Clean()
|
||||||
{
|
{
|
||||||
using (var mapper = _database.OpenConnection())
|
using (var mapper = _database.OpenConnection())
|
||||||
{
|
{
|
||||||
var usedTags = new[] { "Artists", "Notifications", "DelayProfiles", "ReleaseProfiles" }
|
var usedTags = new[] { "Artists", "Notifications", "DelayProfiles", "ReleaseProfiles", "ImportLists", "Indexers" }
|
||||||
.SelectMany(v => GetUsedTags(v, mapper))
|
.SelectMany(v => GetUsedTags(v, mapper))
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
@ -32,7 +32,7 @@ public void Clean()
|
||||||
|
|
||||||
private int[] GetUsedTags(string table, IDbConnection mapper)
|
private int[] GetUsedTags(string table, IDbConnection mapper)
|
||||||
{
|
{
|
||||||
return mapper.Query<List<int>>($"SELECT DISTINCT Tags FROM {table} WHERE NOT Tags = '[]'")
|
return mapper.Query<List<int>>($"SELECT DISTINCT Tags FROM {table} WHERE NOT Tags = '[]' AND NOT Tags IS NULL")
|
||||||
.SelectMany(x => x)
|
.SelectMany(x => x)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
Loading…
Reference in a new issue