Example #1
0
  private synchronized void refreshSessions() {
    logger.debug("Refreshing Plex sessions");

    MediaContainer container = getDocument(sessionsUrl, MediaContainer.class);

    if (container != null) {
      Map<String, PlexSession> previousSessions = new HashMap<String, PlexSession>(sessions);
      sessions.clear();

      addSessionFor(container.getVideos());
      addSessionFor(container.getTracks());

      setVolumeFromPreviousSessions(previousSessions);
    }
  }