Procházet zdrojové kódy

Remove /Images/Remote API endpoint

Joshua M. Boniface před 4 roky
rodič
revize
dc81d576ab
1 změnil soubory, kde provedl 0 přidání a 52 odebrání
  1. 0 52
      Jellyfin.Api/Controllers/RemoteImageController.cs

+ 0 - 52
Jellyfin.Api/Controllers/RemoteImageController.cs

@@ -145,58 +145,6 @@ namespace Jellyfin.Api.Controllers
             return 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>