mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Only scan files that are new or updated (#760)
* New: Only scan files that are new or updated Pass through filter correctly Add more tests Add tests for migration 30 * Fix windows disk provider * Don't publish deleted event for unmapped file * Fix test on windows
This commit is contained in:
parent
8fe8aec97c
commit
166fc90454
95 changed files with 1590 additions and 723 deletions
|
@ -39,7 +39,7 @@ namespace NzbDrone.Core.MediaFiles
|
|||
foreach (var artistFile in artistFiles)
|
||||
{
|
||||
var trackFile = artistFile;
|
||||
var trackFilePath = Path.Combine(artist.Path, trackFile.RelativePath);
|
||||
var trackFilePath = trackFile.Path;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -49,15 +49,7 @@ namespace NzbDrone.Core.MediaFiles
|
|||
_mediaFileService.Delete(artistFile, DeleteMediaFileReason.MissingFromDisk);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tracks.None(e => e.TrackFileId == trackFile.Id))
|
||||
{
|
||||
_logger.Debug("File [{0}] is not assigned to any artist, removing from db", trackFilePath);
|
||||
_mediaFileService.Delete(trackFile, DeleteMediaFileReason.NoLinkedEpisodes);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Unable to cleanup TrackFile in DB: {0}", trackFile.Id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue