From e04c28fe2d46a9616712bd3f8c7035002896e249 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 27 Oct 2024 16:48:53 -0700 Subject: [PATCH] Use current time for cache break in development (cherry picked from commit 020ed32fcfab1c6fbe57af5ea650300272c93fd7) --- src/Lidarr.Http/Frontend/Mappers/CacheBreakerProvider.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Lidarr.Http/Frontend/Mappers/CacheBreakerProvider.cs b/src/Lidarr.Http/Frontend/Mappers/CacheBreakerProvider.cs index bb925b77e7..20f5e37ad5 100644 --- a/src/Lidarr.Http/Frontend/Mappers/CacheBreakerProvider.cs +++ b/src/Lidarr.Http/Frontend/Mappers/CacheBreakerProvider.cs @@ -1,6 +1,8 @@ +using System; using System.Collections.Generic; using System.Linq; using NzbDrone.Common.Crypto; +using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Extensions; namespace Lidarr.Http.Frontend.Mappers @@ -28,6 +30,11 @@ public string AddCacheBreakerToPath(string resourceUrl) return resourceUrl; } + if (!RuntimeInfo.IsProduction) + { + return resourceUrl + "?t=" + DateTime.UtcNow.Ticks; + } + var mapper = _diskMappers.Single(m => m.CanHandle(resourceUrl)); var pathToFile = mapper.Map(resourceUrl); var hash = _hashProvider.ComputeMd5(pathToFile).ToBase64();