Skip to content

Duplicate device created/previous removed when reconnected. #425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ys27 opened this issue May 1, 2020 · 1 comment
Closed

Duplicate device created/previous removed when reconnected. #425

ys27 opened this issue May 1, 2020 · 1 comment
Labels
Bug Issues which are bug reports Confirmed Confirmed issues

Comments

@ys27
Copy link
Contributor

ys27 commented May 1, 2020

SoundSwitch.zip

image

I have my PC connected to my TV, and whenever it is turned off and then on, the TV no longer appears when I use my hotkey to scroll between playback devices. When I go to settings, I find a duplicate in 'connected' (same name, I'm not sure what is different internally, or what the internal data even contains), which I have to add to my selected list to use. The previous one that I've added previously does not work, even though it is there. The screenshot is at a point where I have added the newly added device in to the selected list.

If there is a more consistent piece of data in the device object (even the name), it could be used to detect reconnected devices.

Thank you.

@ys27
Copy link
Contributor Author

ys27 commented May 2, 2020

I was looking at my logs and realized that the Id of the device changes when it is reconnected, and is not added back into the selected list when the app refreshes. In the overridden Equals fn inside DeviceInfo.cs, checking against the name as well should be able to identify the device again, given that the DeviceInfo (of DeviceFullInfo) only contains id, name, and type.

However, since the GenerateListViewItem runs through all devices (even those in a disconnected state), even the disconnected devices with the same name will show up on the selected list. My changes also make it such that only the connected devices show up on the selected list.

I am assuming that the selected list is kept in some kind of local storage, and not altered just because disconnected devices don't show up in the selected list. GenerateListViewItem seems to be just a UI thing, but the changes made to the condition of adding to the selected list should not alter the internal data of the selected list.

@Belphemur Belphemur added Bug Issues which are bug reports Confirmed Confirmed issues labels May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues which are bug reports Confirmed Confirmed issues
Projects
None yet
Development

No branches or pull requests

2 participants