소스 검색

Update AudioFileProber.cs

Cody Robibero 1 년 전
부모
커밋
5a652360c3
1개의 변경된 파일20개의 추가작업 그리고 2개의 파일을 삭제
  1. 20 2
      MediaBrowser.Providers/MediaInfo/AudioFileProber.cs

+ 20 - 2
MediaBrowser.Providers/MediaInfo/AudioFileProber.cs

@@ -320,8 +320,26 @@ namespace MediaBrowser.Providers.MediaInfo
                     }
 
                     _libraryManager.UpdatePeople(audio, people);
-                    audio.Artists ??= performers;
-                    audio.AlbumArtists ??= albumArtists;
+                    
+                    if (options.ReplaceAllMetadata && performers.Length != 0)
+                    {
+                        audio.Artists = performers;
+                    }
+                    else if (!options.ReplaceAllMetadata
+                             && (audio.Artists is null || audio.Artists.Count == 0))
+                    {
+                        audio.Artists = performers;
+                    }
+
+                    if (options.ReplaceAllMetadata && albumArtists.Length != 0)
+                    {
+                        audio.AlbumArtists = albumArtists;
+                    }
+                    else if (!options.ReplaceAllMetadata
+                             && (audio.AlbumArtists is null || audio.AlbumArtists.Count == 0))
+                    {
+                        audio.AlbumArtists = albumArtists;
+                    }
                 }
 
                 if (!audio.LockedFields.Contains(MetadataField.Name))