mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-06 04:52:21 -07:00
Logging for media import paths
This commit is contained in:
parent
ef2c6366c4
commit
f2821c5ecd
3 changed files with 14 additions and 4 deletions
|
@ -10,6 +10,7 @@ using NzbDrone.Common;
|
|||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Instrumentation.Extensions;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.MediaFiles.Commands;
|
||||
using NzbDrone.Core.MediaFiles.Events;
|
||||
|
@ -242,8 +243,8 @@ namespace NzbDrone.Core.MediaFiles
|
|||
var mediaFileList = filesOnDisk.Where(file => MediaFileExtensions.Extensions.Contains(file.Extension))
|
||||
.ToList();
|
||||
|
||||
_logger.Trace("{0} files were found in {1}", filesOnDisk.Count, path);
|
||||
_logger.Debug("{0} audio files were found in {1}", mediaFileList.Count, path);
|
||||
_logger.Trace("{0} files were found in {1}:\n{2}", filesOnDisk.Count, path, filesOnDisk.Select(f => f.FullName).ToJson());
|
||||
_logger.Debug("{0} audio files were found in {1}:\n{2}", mediaFileList.Count, path, mediaFileList.Select(f => f.FullName).ToJson());
|
||||
|
||||
return mediaFileList.ToArray();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Core.Music;
|
||||
|
@ -23,9 +25,12 @@ namespace NzbDrone.Core.MediaFiles
|
|||
|
||||
public class MediaFileRepository : BasicRepository<TrackFile>, IMediaFileRepository
|
||||
{
|
||||
public MediaFileRepository(IMainDatabase database, IEventAggregator eventAggregator)
|
||||
private readonly Logger _logger;
|
||||
|
||||
public MediaFileRepository(IMainDatabase database, IEventAggregator eventAggregator, Logger logger)
|
||||
: base(database, eventAggregator)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// always join with all the other good stuff
|
||||
|
@ -134,6 +139,9 @@ namespace NzbDrone.Core.MediaFiles
|
|||
_ = _database.QueryJoined<TrackFile, Track>(builder, (file, track) => MapTrack(dict, file, track)).ToList();
|
||||
var all = dict.Values.ToList();
|
||||
|
||||
_logger.Trace("{0}", paths.ToJson());
|
||||
_logger.Trace("{0} tracks were found in db:\n{1}", all.Count, all.Select(f => f.Path).ToJson());
|
||||
|
||||
var joined = all.Join(paths, x => x.Path, x => x, (file, path) => file, PathEqualityComparer.Instance).ToList();
|
||||
return joined;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.IO.Abstractions;
|
|||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Datastore.Events;
|
||||
using NzbDrone.Core.MediaFiles.Events;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
@ -104,7 +105,7 @@ namespace NzbDrone.Core.MediaFiles
|
|||
return files;
|
||||
}
|
||||
|
||||
_logger.Debug($"Filtering {files.Count} files for unchanged files");
|
||||
_logger.Debug($"Filtering {files.Count} files for unchanged files:\n{files.Select(x => x.FullName).ToJson()}");
|
||||
|
||||
var knownFiles = GetFileWithPath(files.Select(x => x.FullName).ToList());
|
||||
_logger.Trace($"Got {knownFiles.Count} existing files");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue