From c818db32954438a789dbb385be11f2e2fb768a98 Mon Sep 17 00:00:00 2001 From: Luke Hagar Date: Thu, 4 Aug 2022 14:55:55 -0500 Subject: [PATCH] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f865f1..5fdf469 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Examples Assume React Syntax The LoadPlexSession Function returns an object that contains the plexClientInformation and plexTVAuthToken keys/values according to how they were created ``` JavaScript - const loadedSession = LoadPlexSession(); +const loadedSession = LoadPlexSession(); if (loadedSession.plexClientInformation == null){ loadedSession.plexClientInformation = CreatePlexClientInformation(); } @@ -48,3 +48,17 @@ const [plexTVAuthToken, setPlexTVAuthToken] = useState( SavePlexSession(plexClientInformation, tempPlexTVAuthToken); } ``` + +### Get Plex Music Hub data +``` JavaScript + async function UpdateHubs(plexClientInformation, plexServers, plexLibraries) { + const tempMusicHubs = await GetMusicHub( + plexClientInformation, + plexServers, // No Auth Token is needed since the server entries have their own access tokens + plexLibraries + ); + setMusicHubs(tempMusicHubs); + } +``` + +