mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-23 14:30:49 +00:00
Fixed: Speed up CleanupOrphanedTrackFiles housekeeper
Tracks table is massive, so lets avoid re-writing 0s to items that are already 0
This commit is contained in:
parent
3c9a0ebbf1
commit
2fe653fd1e
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ private void CleanupOrphanedByAlbum()
|
|||
// Unlink where track no longer exists
|
||||
mapper.Execute(@"UPDATE ""TrackFiles""
|
||||
SET ""AlbumId"" = 0
|
||||
WHERE ""Id"" IN (
|
||||
WHERE ""AlbumId"" <> 0 AND ""Id"" IN (
|
||||
SELECT ""TrackFiles"".""Id"" FROM ""TrackFiles""
|
||||
LEFT OUTER JOIN ""Tracks""
|
||||
ON ""TrackFiles"".""Id"" = ""Tracks"".""TrackFileId""
|
||||
|
@ -40,7 +40,7 @@ private void CleanupOrphanedByTracks()
|
|||
// Unlink Tracks where the Trackfiles entry no longer exists
|
||||
mapper.Execute(@"UPDATE ""Tracks""
|
||||
SET ""TrackFileId"" = 0
|
||||
WHERE ""Id"" IN (
|
||||
WHERE ""TrackFileId"" <> 0 AND ""Id"" IN (
|
||||
SELECT ""Tracks"".""Id"" FROM ""Tracks""
|
||||
LEFT OUTER JOIN ""TrackFiles""
|
||||
ON ""Tracks"".""TrackFileId"" = ""TrackFiles"".""Id""
|
||||
|
|
Loading…
Reference in a new issue