Skip to content

Commit

Permalink
revert some cache checks
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Aug 4, 2023
1 parent 086fee8 commit 5fa6946
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions Utilities.Rest/Packages/com.utilities.rest/Runtime/Rest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,18 @@ public static async Task<Texture2D> 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)
{
Expand Down Expand Up @@ -505,7 +516,18 @@ public static async Task<AudioClip> 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)
{
Expand Down

0 comments on commit 5fa6946

Please sign in to comment.