feat: Add Discord Rich Presence support#23
feat: Add Discord Rich Presence support#23google-labs-jules[bot] wants to merge 4 commits intomainfrom
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
@jules fix the lines linked to what you changed info • Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check • lib/screens/media_detail_screen.dart:453:21 • use_build_context_synchronously |
I have fixed the lint warnings in |
| _discordRpc.updatePresence( | ||
| title: title, | ||
| subtitle: artist.isNotEmpty ? artist : null, | ||
| state: isPlaying ? null : 'Paused', // If paused, show "Paused" in state? Or maybe in small text? | ||
| // Actually state is usually the second line. details is the first line. | ||
| // If paused, we can set small image text to "Paused". | ||
| // Let's refine: | ||
| // details: Title | ||
| // state: Artist (Show - S01E01) | ||
| // smallImage: playing/paused icon? or just keep it simple. | ||
|
|
||
| startTime: isPlaying && endTime == null ? DateTime.now().millisecondsSinceEpoch : null, // Show elapsed if no duration | ||
| endTime: isPlaying ? endTime : null, | ||
| largeImageKey: 'plezy', // Assuming we have this asset uploaded to Discord App | ||
| largeImageText: 'Plezy', | ||
| smallImageKey: isPlaying ? 'play' : 'pause', // Assuming these assets exist, or remove if not | ||
| smallImageText: isPlaying ? 'Playing' : 'Paused', |
There was a problem hiding this comment.
Make comments simple and concise, remove if unnecessary and "make it simple" for the implem
There was a problem hiding this comment.
Simplified the logic and removed unnecessary comments.
- Added `flutter_discord_rpc` dependency. - Created `DiscordRPCService` to handle RPC logic. - Integrated RPC updates into `MediaControlsManager`. - Initialized RPC service in `main.dart` for desktop platforms. - Added TODO for configuring valid Discord Application ID.
0846eaf to
c16c79a
Compare
This PR adds Discord Rich Presence support to Plezy. It displays the currently playing media title, artist (or show details), and playback state (Playing/Paused) with timestamps on the user's Discord profile.
Key changes:
flutter_discord_rpcpackage.DiscordRPCServiceto manage the connection and presence updates.MediaControlsManagerto sync playback state with Discord RPC.main.dart.Note: The Discord Application ID in
lib/services/discord_rpc_service.dartis a placeholder and needs to be updated with a valid ID from the Discord Developer Portal.PR created automatically by Jules for task 15255933584195856215 started by @Doezer