Access last element by index where possible

This commit is contained in:
Bond_009
2020-11-14 15:54:50 +01:00
parent 9041389f65
commit c4bb32f259
6 changed files with 8 additions and 8 deletions

View File

@@ -249,7 +249,7 @@ namespace Jellyfin.Api.Controllers
{
var httpClient = _httpClientFactory.CreateClient(NamedClient.Default);
using var response = await httpClient.GetAsync(url).ConfigureAwait(false);
var ext = response.Content.Headers.ContentType.MediaType.Split('/').Last();
var ext = response.Content.Headers.ContentType.MediaType.Split('/')[^1];
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));