Skip to content

fix: implement persistent volume across sessions and song transitions#119

Open
yuv41 wants to merge 2 commits intoChocoMeow:mainfrom
yuv41:main
Open

fix: implement persistent volume across sessions and song transitions#119
yuv41 wants to merge 2 commits intoChocoMeow:mainfrom
yuv41:main

Conversation

@yuv41
Copy link
Copy Markdown

@yuv41 yuv41 commented Mar 27, 2026

This commit ensures that the volume setting is saved to the database upon change and correctly applied whenever a player connects or restores a session. It also includes a fix for channelId in voice updates to improve session stability.

This commit ensures that the volume setting is saved to the database upon change and correctly applied whenever a player connects or restores a session. It also includes a fix for channelId in voice updates to improve session stability.
Comment thread voicelink/player.py Outdated
await self.send(method=RequestMethod.PATCH, data={"volume": volume})
self._volume = volume
self.settings['volume'] = volume
await func.update_settings(self.guild.id, {"$set": {"volume": volume}})
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The volume settings have already been updated in the volume command. However, I’m curious why the volume settings need to be updated in the database each time the bot connects to the channel.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah ig you're right, it was double-saving during connection. i put the DB update inside set_volume so it would catch changes from the controller buttons, but forgot that it also runs every time the bot joins a channel.

i've tweaked it so it only updates the database if the volume actually changes. i also removed the redundant manual saves from the volume command and IPC since set_volume handles it all now. This
keeps it persistent without the unnecessary writes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants