Screenbox icon indicating copy to clipboard operation
Screenbox copied to clipboard

chore: migrates Newtonsoft.Json to System.Text.Json

Open United600 opened this issue 5 months ago • 6 comments

Works perfectly fine on both Debug and Release builds, but I still have some concerns about the Store build. @rocksdanister Can you take a look and confirm that there are no regressions or hidden edge cases?

Followed the steps in this guide.

United600 avatar Sep 14 '25 16:09 United600

In Lively I am using JsonConverter now.

Here that maybe overkill, don't have experience with System.Text.Json but LivelyProperties.json is designed with backward compatibility in mind - will not have required properties missing (unless the wallpaper itself is bad) and existing properties are not changed in future update.. so the checks are probably not necessary.

LivelyInfo.json can have missing fields depending on how and when its created but here we are deserializing so should be fine, its specification won't change in the future besides adding new properties.

rocksdanister avatar Sep 14 '25 18:09 rocksdanister

Thanks for the info. It should work fine, but I’m still mildly concerned about .Net Native support for System.Text.Json.

United600 avatar Sep 14 '25 20:09 United600

You can verify by running with .NET Native in debug mode with this wallpaper (which I use for testing myself): Property API Test.zip

rocksdanister avatar Sep 15 '25 16:09 rocksdanister

You can verify by running with .NET Native in debug mode with this wallpaper (which I use for testing myself): Property API Test.zip

The info looks correct but can't verify the properties. Debug and Release mode aren't really my concern.

LivelyWallpaper item info

United600 avatar Sep 15 '25 18:09 United600

The info looks correct but can't verify the properties.

Just remove the music wallpaper check and run the wallpaper as visualizer.

https://github.com/huynhsontung/Screenbox/blob/3ac83ff51d1a45d3e27a19e24b559932ee4a38ad/Screenbox.Core/Services/LivelyWallpaperService.cs#L46

rocksdanister avatar Sep 15 '25 19:09 rocksdanister

Correct again, but the app hangs after clicking Continue on the breakpoint (which I assume is expected).

https://github.com/user-attachments/assets/ed813d9c-e879-4439-8b47-1248f8b20d9a

United600 avatar Sep 15 '25 19:09 United600