better audio file check

pull/4219/head
Gary Wilber 4 years ago
parent 75041e7f39
commit 3cfbe6e340

@ -117,10 +117,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
ILibraryManager libraryManager) ILibraryManager libraryManager)
{ {
// check for audio files before digging down into directories // check for audio files before digging down into directories
var firstAudioFile = list var foundAudioFile = list.Any(fileSystemInfo => !fileSystemInfo.IsDirectory && libraryManager.IsAudioFile(fileSystemInfo.FullName));
.Where(fileSystemInfo => !fileSystemInfo.IsDirectory) if (foundAudioFile)
.FirstOrDefault(fileSystemInfo => libraryManager.IsAudioFile(fileSystemInfo.FullName));
if (firstAudioFile != null)
{ {
// at least one audio file exists // at least one audio file exists
return true; return true;

Loading…
Cancel
Save