Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add random UUID to bypass cache #190

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading