diff --git a/.vs/WindowsFormsApplication2/v16/.suo b/.vs/WindowsFormsApplication2/v16/.suo index 2f46a62..52164df 100644 Binary files a/.vs/WindowsFormsApplication2/v16/.suo and b/.vs/WindowsFormsApplication2/v16/.suo differ diff --git a/WindowsFormsApplication2/JellyfinAPI.cs b/WindowsFormsApplication2/JellyfinAPI.cs index 3056858..6688e1b 100644 --- a/WindowsFormsApplication2/JellyfinAPI.cs +++ b/WindowsFormsApplication2/JellyfinAPI.cs @@ -254,11 +254,10 @@ namespace JellyfinRPC } } - private static ConfigForm configForm = new ConfigForm(); public static async Task GetTokenFromUsernameAndPassword(string Username, string Password) { using var httpClient = new HttpClient(); - httpClient.DefaultRequestHeaders.Add("Authorization", $"MediaBrowser Client=\"JellyfinRPC {AssemblyVersion},\", Device=\"{System.Net.Dns.GetHostName()}\", DeviceId=\"{ConfigManager.GetEntry("DeviceID")}\", Version=\"running on {Environment.OSVersion}\""); + httpClient.DefaultRequestHeaders.Add("Authorization", $"MediaBrowser Client=\"JellyfinRPC {AssemblyVersion}, \", Device=\"{System.Net.Dns.GetHostName()}\", DeviceId=\"{ConfigManager.GetEntry("DeviceID")}\", Version=\"running on {Environment.OSVersion}\""); if (ConfigManager.GetEntry("ServerURL") != "") { @@ -278,12 +277,14 @@ namespace JellyfinRPC response.EnsureSuccessStatusCode(); var jsonResponse = await response.Content.ReadAsStringAsync(); + + var jsonShit = JObject.Parse(jsonResponse); - var getThatToken = JArray.Parse(jsonResponse); - - foreach (var item in getThatToken) + string thatToken = jsonShit.Value("AccessToken"); + + if (thatToken != null && thatToken != " ") { - ConfigManager.SetEntry("JellyfinToken", item["AccessToken"].ToString()); + ConfigManager.SetEntry("JellyfinToken", thatToken); } } diff --git a/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.exe b/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.exe index d4b53f2..f5a6372 100644 Binary files a/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.exe and b/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.exe differ diff --git a/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.pdb b/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.pdb index 5f605b3..6a5c5fb 100644 Binary files a/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.pdb and b/WindowsFormsApplication2/bin/Debug/Jellyfin Rich Presence.pdb differ diff --git a/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.exe b/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.exe index d4b53f2..f5a6372 100644 Binary files a/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.exe and b/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.exe differ diff --git a/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.pdb b/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.pdb index 5f605b3..6a5c5fb 100644 Binary files a/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.pdb and b/WindowsFormsApplication2/obj/x86/Debug/Jellyfin Rich Presence.pdb differ diff --git a/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.AssemblyReference.cache b/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.AssemblyReference.cache deleted file mode 100644 index f5e894a..0000000 Binary files a/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.AssemblyReference.cache and /dev/null differ diff --git a/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.FileListAbsolute.txt b/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.FileListAbsolute.txt index b6ab9e2..ad66299 100644 --- a/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.FileListAbsolute.txt +++ b/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.FileListAbsolute.txt @@ -1,7 +1,10 @@ +C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\discord_game_sdk.dll +C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\discord_game_sdk.dll.lib C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Jellyfin Rich Presence.exe.config C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Jellyfin Rich Presence.exe C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Jellyfin Rich Presence.pdb C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\AsyncBridge.NET40.dll +C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\MakarovDev.ExpandCollapsePanel.dll C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Microsoft.Threading.Tasks.dll C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Microsoft.Threading.Tasks.Extensions.Desktop.dll C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Microsoft.Threading.Tasks.Extensions.dll @@ -36,7 +39,3 @@ C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2 C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\JellyfinRPCGUI.csproj.CopyComplete C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\Jellyfin Rich Presence.exe C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\Jellyfin Rich Presence.pdb -C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\discord_game_sdk.dll -C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\discord_game_sdk.dll.lib -C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\obj\x86\Debug\JellyfinRPCGUI.csproj.AssemblyReference.cache -C:\Users\random()\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\MakarovDev.ExpandCollapsePanel.dll diff --git a/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.GenerateResource.Cache b/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.GenerateResource.Cache index cc880ad..5b01a10 100644 Binary files a/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.GenerateResource.Cache and b/WindowsFormsApplication2/obj/x86/Debug/JellyfinRPCGUI.csproj.GenerateResource.Cache differ