The Free Software Media System - Server Backend & API
Remove /Images/Remote API endpoint
Joshua M. Bonifacedc81d576ab78
diff --git a/Jellyfin.Api/Controllers/RemoteImageController.cs b/Jellyfin.Api/Controllers/RemoteImageController.csindex e226adc646..ec836f43e3 100644--- a/Jellyfin.Api/Controllers/RemoteImageController.cs+++ b/Jellyfin.Api/Controllers/RemoteImageController.cs@@ -145,58 +145,6 @@ namespace Jellyfin.Api.Controllersreturn Ok(_providerManager.GetRemoteImageProviderInfo(item));}- /// <summary>- /// Gets a remote image.- /// </summary>- /// <param name="imageUrl">The image url.</param>- /// <response code="200">Remote image returned.</response>- /// <response code="404">Remote image not found.</response>- /// <returns>Image Stream.</returns>- [HttpGet("Images/Remote")]- [Produces(MediaTypeNames.Application.Octet)]- [ProducesResponseType(StatusCodes.Status200OK)]- [ProducesResponseType(StatusCodes.Status404NotFound)]- [ProducesImageFile]- public async Task<ActionResult> GetRemoteImage([FromQuery, Required] Uri imageUrl)- {- var urlHash = imageUrl.ToString().GetMD5();- var pointerCachePath = GetFullCachePath(urlHash.ToString());-- string? contentPath = null;- var hasFile = false;-- try- {- contentPath = await System.IO.File.ReadAllTextAsync(pointerCachePath).ConfigureAwait(false);- if (System.IO.File.Exists(contentPath))- {- hasFile = true;- }- }- catch (FileNotFoundException)- {- // The file isn't cached yet- }- catch (IOException)- {- // The file isn't cached yet- }-- if (!hasFile)- {- await DownloadImage(imageUrl, urlHash, pointerCachePath).ConfigureAwait(false);- contentPath = await System.IO.File.ReadAllTextAsync(pointerCachePath).ConfigureAwait(false);- }-- if (string.IsNullOrEmpty(contentPath))- {- return NotFound();- }-- var contentType = MimeTypes.GetMimeType(contentPath);- return PhysicalFile(contentPath, contentType);- }-/// <summary>/// Downloads a remote image for an item./// </summary>