Skip to content

Commit

Permalink
Add random UUID to bypass cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nylonee committed Oct 16, 2024
1 parent cbe01de commit 781acad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/scala/plex/PlexUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import io.circe.generic.extras.auto._
import io.circe.syntax.EncoderOps
import org.http4s.client.UnexpectedStatus

import java.util.UUID

trait PlexUtils {

private val logger = LoggerFactory.getLogger(getClass)
Expand All @@ -21,7 +23,10 @@ trait PlexUtils {
extras.Configuration.default.withDefaults

protected def fetchWatchlistFromRss(client: HttpClient)(url: Uri): IO[Set[Item]] = {
val jsonFormatUrl = url.withQueryParam("format", "json")
val randomUUID = UUID.randomUUID().toString.take(5)
val jsonFormatUrl = url
.withQueryParam("format", "json")
.withQueryParam(randomUUID, randomUUID)

client.httpRequest(Method.GET, jsonFormatUrl).map {
case Left(UnexpectedStatus(s, _, _)) if s.code == 500 =>
Expand Down

0 comments on commit 781acad

Please sign in to comment.