2
0
Эх сурвалжийг харах

Fix ArgumentNullException when downloading season logos (#14141)

theguymadmax 1 долоо хоног өмнө
parent
commit
a6a89f7953

+ 16 - 0
MediaBrowser.Providers/Manager/ImageSaver.cs

@@ -483,6 +483,22 @@ namespace MediaBrowser.Providers.Manager
                 }
                 }
             }
             }
 
 
+            if (type == ImageType.Logo && saveLocally)
+            {
+                if (season is not null && season.IndexNumber.HasValue)
+                {
+                    var seriesFolder = season.SeriesPath;
+
+                    var seasonMarker = season.IndexNumber.Value == 0
+                                        ? "-specials"
+                                        : season.IndexNumber.Value.ToString("00", CultureInfo.InvariantCulture);
+
+                    var imageFilename = "season" + seasonMarker + "-logo" + extension;
+
+                    return Path.Combine(seriesFolder, imageFilename);
+                }
+            }
+
             string filename;
             string filename;
             var folderName = item is MusicAlbum ||
             var folderName = item is MusicAlbum ||
                 item is MusicArtist ||
                 item is MusicArtist ||