Skip to content

Commit

Permalink
Use current time for cache break in development
Browse files Browse the repository at this point in the history
(cherry picked from commit 020ed32fcfab1c6fbe57af5ea650300272c93fd7)
  • Loading branch information
markus101 authored and mynameisbogdan committed Nov 4, 2024
1 parent 030300c commit e04c28f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Lidarr.Http/Frontend/Mappers/CacheBreakerProvider.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e04c28f

Please sign in to comment.