From 5fa6946b9ee66ae285a4ebf24fc1980867dd93a4 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Fri, 4 Aug 2023 19:46:11 -0400 Subject: [PATCH] revert some cache checks --- .../com.utilities.rest/Runtime/Rest.cs | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Utilities.Rest/Packages/com.utilities.rest/Runtime/Rest.cs b/Utilities.Rest/Packages/com.utilities.rest/Runtime/Rest.cs index a44b858..b188989 100644 --- a/Utilities.Rest/Packages/com.utilities.rest/Runtime/Rest.cs +++ b/Utilities.Rest/Packages/com.utilities.rest/Runtime/Rest.cs @@ -450,7 +450,18 @@ public static async Task DownloadTextureAsync( TryGetFileNameFromUrl(url, out fileName); } - var isCached = TryGetDownloadCacheItem(fileName, out var cachePath); + bool isCached; + string cachePath; + + if (url.Contains(FileUriPrefix)) + { + isCached = true; + cachePath = url; + } + else + { + isCached = TryGetDownloadCacheItem(fileName, out cachePath); + } if (isCached) { @@ -505,7 +516,18 @@ public static async Task DownloadAudioClipAsync( TryGetFileNameFromUrl(url, out fileName); } - var isCached = TryGetDownloadCacheItem(fileName, out var cachePath); + bool isCached; + string cachePath; + + if (url.Contains(FileUriPrefix)) + { + isCached = true; + cachePath = url; + } + else + { + isCached = TryGetDownloadCacheItem(fileName, out cachePath); + } if (isCached) {