ungive / discord-music-presence

The Discord music status that works with any media player
https://musicpresence.app
Other
229 stars 2 forks source link

[Bug] Settings not saved on exit #34

Closed PapitaConPure closed 2 months ago

PapitaConPure commented 2 months ago

Is there an existing issue for this?

Describe the bug

Settings aren't being saved after closing the program for the first time. I can't edit the settings.json file because I don't have write permissions for it.

Reproduction Steps

  1. Start Music Presence
  2. Tick the 'Show the song title and artist on separate lines' checkbox
  3. Click 'Exit'
  4. Start Music Presence again
  5. See the error - change wasn't saved

Expected behavior

I expect settings to be saved after I close the program.

Screenshots

https://github.com/user-attachments/assets/c7c7025e-375d-4e0f-8f22-e9ccc9d888f7

Device Info

Additional context

I am the main and only user of the computer.

My Windows username has a tilde, "Papita con Puré". I believe this might be related to the write permission issue, which could be causing this problem (I'm not sure though). The settings.json and stat.json files are saved here: image

Notice how the last modification date ("fecha de modificación") of these two files is many hours behind the date of the video submitted above (08/30/2024 14:12): image

ungive commented 2 months ago

Hey, thanks for reporting. Is there no presence.log file? It should exist, as well as some other files, but that's probably related to your username containing these characters which seem to cause the issue. If you can find any presence.log file, please share it, it might contain valuable error messages.

Are there any other files in the folder that you marked with a red box? Or only AppData\Roaming\Music Presence? If there are other files too other programs might have issues with it as well, if not, then it's likely just an issue with Music Presence.

PapitaConPure commented 2 months ago

Thank you for the fast response.

Unfortunately, I couldn't find a presence.log file anywhere. I also used Windows Search but didn't find anything either.

There are also these two folders with some files in them, inside the user folder with the correct name: image

As for other programs inside the "incorrect" user folder, there's PureRef crash data inside AppData/Local/, but that program never had any issues for me. There's nothing else.

PapitaConPure commented 2 months ago

For now, I was able to save some settings after opening the file with VSCode and saving it as a superuser image

PapitaConPure commented 2 months ago

After looking into it a bit more, I was able to manually enable the write permissions. image

It's weird that I had to do that in the first place though. If you need more information, I'll be here.

ungive commented 2 months ago

I can reproduce this, where it doesn't write the settings or other files at all. But I don't get a strange folder name like that. I'll investigate further! Thanks for the detailed information.

ungive commented 2 months ago

I was converting between strings and wide strings, which messed up the encoding. Using the proper types now and it's fixed.

You reported this at the perfect time, I'm about to release version 2.2.0, so the fix will be part of that release!

While I was reproducing this I also encountered another important bug that I fixed, thanks for that!

You can expect the release for version 2.2.0 either tomorrow or on sunday.

ungive commented 2 months ago

@PapitaConPure Version 2.2.0 is here now, although released a little bit later. :)

PapitaConPure commented 2 months ago

Nice! Thank you for your hard work

PapitaConPure commented 2 months ago

Can confirm it's fixed now! image