diff --git a/.vs/JellyfinDiscordRPC/FileContentIndex/13d9318c-07f9-45cb-a5cc-2d43795fca64.vsidx b/.vs/JellyfinDiscordRPC/FileContentIndex/13d9318c-07f9-45cb-a5cc-2d43795fca64.vsidx deleted file mode 100644 index 69930a6..0000000 Binary files a/.vs/JellyfinDiscordRPC/FileContentIndex/13d9318c-07f9-45cb-a5cc-2d43795fca64.vsidx and /dev/null differ diff --git a/.vs/JellyfinDiscordRPC/FileContentIndex/8fd518a7-0ec4-470d-a16d-7571b1300882.vsidx b/.vs/JellyfinDiscordRPC/FileContentIndex/8fd518a7-0ec4-470d-a16d-7571b1300882.vsidx new file mode 100644 index 0000000..0a7f98a Binary files /dev/null and b/.vs/JellyfinDiscordRPC/FileContentIndex/8fd518a7-0ec4-470d-a16d-7571b1300882.vsidx differ diff --git a/.vs/JellyfinDiscordRPC/v17/.futdcache.v2 b/.vs/JellyfinDiscordRPC/v17/.futdcache.v2 index 1eb3ec0..f86f461 100644 Binary files a/.vs/JellyfinDiscordRPC/v17/.futdcache.v2 and b/.vs/JellyfinDiscordRPC/v17/.futdcache.v2 differ diff --git a/.vs/JellyfinDiscordRPC/v17/DocumentLayout.backup.json b/.vs/JellyfinDiscordRPC/v17/DocumentLayout.backup.json index fd01b96..7f04023 100644 --- a/.vs/JellyfinDiscordRPC/v17/DocumentLayout.backup.json +++ b/.vs/JellyfinDiscordRPC/v17/DocumentLayout.backup.json @@ -2,10 +2,6 @@ "Version": 1, "WorkspaceRootPath": "C:\\Users\\joshua\\Documents\\GitHub\\jellyfin-discord-rpc\\", "Documents": [ - { - "AbsoluteMoniker": "D:0:0:{06FF6B5D-B070-4DB7-9A87-9B6E280A794D}|JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj|c:\\users\\joshua\\documents\\github\\jellyfin-discord-rpc\\jellyfindiscordrpc\\jellyfindiscordrpc.csproj||{04B8AB82-A572-4FEF-95CE-5222444B6B64}|", - "RelativeMoniker": "D:0:0:{06FF6B5D-B070-4DB7-9A87-9B6E280A794D}|JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj|solutionrelative:jellyfindiscordrpc\\jellyfindiscordrpc.csproj||{04B8AB82-A572-4FEF-95CE-5222444B6B64}|" - }, { "AbsoluteMoniker": "D:0:0:{06FF6B5D-B070-4DB7-9A87-9B6E280A794D}|JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj|c:\\users\\joshua\\documents\\github\\jellyfin-discord-rpc\\jellyfindiscordrpc\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{06FF6B5D-B070-4DB7-9A87-9B6E280A794D}|JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj|solutionrelative:jellyfindiscordrpc\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -23,24 +19,12 @@ { "$type": "Document", "DocumentIndex": 0, - "Title": "JellyfinDiscordRPC", - "DocumentMoniker": "C:\\Users\\joshua\\Documents\\GitHub\\jellyfin-discord-rpc\\JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj", - "RelativeDocumentMoniker": "JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj", - "ToolTip": "C:\\Users\\joshua\\Documents\\GitHub\\jellyfin-discord-rpc\\JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj", - "RelativeToolTip": "JellyfinDiscordRPC\\JellyfinDiscordRPC.csproj", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|", - "WhenOpened": "2024-11-30T08:49:04.842Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 1, "Title": "Program.cs", "DocumentMoniker": "C:\\Users\\joshua\\Documents\\GitHub\\jellyfin-discord-rpc\\JellyfinDiscordRPC\\Program.cs", "RelativeDocumentMoniker": "JellyfinDiscordRPC\\Program.cs", "ToolTip": "C:\\Users\\joshua\\Documents\\GitHub\\jellyfin-discord-rpc\\JellyfinDiscordRPC\\Program.cs", "RelativeToolTip": "JellyfinDiscordRPC\\Program.cs", - "ViewState": "AgIAANsAAAAAAAAAAAAAwBcBAAAmAAAAAAAAAA==", + "ViewState": "AgIAAAcAAAAAAAAAAAAAABQAAAApAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-11-30T05:30:39.706Z", "EditorCaption": "" diff --git a/.vs/JellyfinDiscordRPC/v17/DocumentLayout.json b/.vs/JellyfinDiscordRPC/v17/DocumentLayout.json index 22c4144..7f04023 100644 --- a/.vs/JellyfinDiscordRPC/v17/DocumentLayout.json +++ b/.vs/JellyfinDiscordRPC/v17/DocumentLayout.json @@ -24,7 +24,7 @@ "RelativeDocumentMoniker": "JellyfinDiscordRPC\\Program.cs", "ToolTip": "C:\\Users\\joshua\\Documents\\GitHub\\jellyfin-discord-rpc\\JellyfinDiscordRPC\\Program.cs", "RelativeToolTip": "JellyfinDiscordRPC\\Program.cs", - "ViewState": "AgIAAA4BAAAAAAAAAAAswBcBAAAmAAAAAAAAAA==", + "ViewState": "AgIAAAcAAAAAAAAAAAAAABQAAAApAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-11-30T05:30:39.706Z", "EditorCaption": "" diff --git a/JellyfinDiscordRPC/Program.cs b/JellyfinDiscordRPC/Program.cs index e0aea60..4f710ac 100644 --- a/JellyfinDiscordRPC/Program.cs +++ b/JellyfinDiscordRPC/Program.cs @@ -32,58 +32,10 @@ class Program // Poll Jellyfin API for currently playing media var updateTask = UpdateRichPresence(); // Start the rich presence update task - // Command loop for toggling screen sharing - while (true) - { - var command = Console.ReadLine()?.ToLower(); - if (command == "toggle") - { - ToggleScreenSharing(); - } - else if (command == "exit") - { - break; // Exit the loop and end the program - } - else - { - Console.WriteLine("Invalid command. Type 'toggle' to toggle screen sharing or 'exit' to quit."); - } - } await updateTask; // Wait for the rich presence update task to finish } - private static void ToggleScreenSharing() - { - isScreenSharing = !isScreenSharing; // Toggle the screen sharing state - Console.WriteLine(isScreenSharing ? "Screen sharing enabled." : "Screen sharing disabled."); - UpdateDiscordPresence(); // Manually update Discord presence when toggling screen sharing - } - - private static void UpdateDiscordPresence() - { - // Log the current status of screen sharing - Console.WriteLine($"Updating Discord Presence. Screen Sharing: {isScreenSharing}"); - - // Ensure we immediately update the Discord presence when toggling screen sharing - _discordClient.SetPresence(new RichPresence - { - Details = isScreenSharing ? "Sharing screen" : "Watching media", - State = isScreenSharing ? "Screen sharing is active" : "Not sharing screen", - Timestamps = new Timestamps - { - Start = DateTime.UtcNow - }, - Assets = new Assets - { - LargeImageKey = isScreenSharing ? "screen_sharing" : "media_playing", - LargeImageText = isScreenSharing ? "Screen sharing on Discord" : "Watching media on Jellyfin" - } - }); - - Console.WriteLine("Presence updated successfully."); - } - private static async Task UpdateRichPresence() { while (true)