Skip to content

Commit

Permalink
Try this fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nylonee committed Dec 15, 2023
1 parent 92767e3 commit c20dfe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/plex/PlexUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ trait PlexUtils {
for {
responseJson <- EitherT(client.httpRequest(Method.POST, url, Some(token), Some(query.asJson)))
watchlist <- EitherT.fromEither[IO](responseJson.as[TokenWatchlistFriend]).leftMap(new Throwable(_))
extraContent <- if (watchlist.data.user.watchlist.pageInfo.hasNextPage)
getWatchlistIdsForUser(config, client)(user, Some(watchlist.data.user.watchlist.pageInfo.endCursor))
extraContent <- if (watchlist.data.user.watchlist.pageInfo.hasNextPage && watchlist.data.user.watchlist.pageInfo.endCursor.nonEmpty)
getWatchlistIdsForUser(config, client)(user, watchlist.data.user.watchlist.pageInfo.endCursor)
else
EitherT.pure[IO, Throwable](Set.empty[TokenWatchlistItem])
} yield watchlist.data.user.watchlist.nodes.map(_.toTokenWatchlistItem).toSet ++ extraContent
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/plex/TokenWatchlistFriend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ private[plex] case class WatchlistUserData(watchlist: WatchlistNodes)

private[plex] case class WatchlistNodes(nodes: List[WatchlistNode], pageInfo: PageInfo)

private[plex] case class PageInfo(hasNextPage: Boolean, endCursor: String)
private[plex] case class PageInfo(hasNextPage: Boolean, endCursor: Option[String])

private[plex] case class WatchlistNode(id: String, title: String, `type`: String) {
def toTokenWatchlistItem: TokenWatchlistItem =
Expand Down

0 comments on commit c20dfe4

Please sign in to comment.