diff --git a/MediaFeeder/MediaFeeder/Providers/Youtube/Utils.cs b/MediaFeeder/MediaFeeder/Providers/Youtube/Utils.cs index 923343c..810b9b0 100644 --- a/MediaFeeder/MediaFeeder/Providers/Youtube/Utils.cs +++ b/MediaFeeder/MediaFeeder/Providers/Youtube/Utils.cs @@ -17,10 +17,10 @@ internal async Task LoadUrlThumbnail(string itemId, string type, string var request = await httpClient.GetAsync(url, cancellationToken); request.EnsureSuccessStatusCode(); - var ext = new FileExtensionContentTypeProvider().Mappings - .SingleOrDefault(g => g.Value == request.Content.Headers.ContentType?.MediaType) - .Key ?? ".png"; - var fileName = $"{itemId}{ext}"; + var ext = new FileExtensionContentTypeProvider().Mappings + .FirstOrDefault(g => g.Value == request.Content.Headers.ContentType?.MediaType) + .Key ?? ".png"; + var fileName = $"{itemId}{ext}"; var path = configuration.GetValue("MediaRoot"); path = Path.Join(path, "thumbnails", type, fileName);