File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 12
12
using System . IO ;
13
13
using System ;
14
14
using System . Windows . Media . Imaging ;
15
+ using System . Security . Cryptography ;
16
+ using System . Text ;
15
17
16
18
namespace Community . PowerToys . Run . Plugin . Its_MyPic
17
19
{
@@ -68,7 +70,7 @@ public Result ToResult(string search, Data data)
68
70
}
69
71
public class Data
70
72
{
71
- private static readonly int DATA_VERSION = "なんで春日影やったの!?" . GetHashCode ( ) ;
73
+ private static readonly int DATA_VERSION = BitConverter . ToInt32 ( SHA256 . HashData ( Encoding . UTF8 . GetBytes ( "なんで春日影やったの!?" ) ) , 0 ) ;
72
74
private readonly HttpClient client = new ( ) ;
73
75
readonly JsonSerializerOptions options = new ( ) { PropertyNameCaseInsensitive = true , } ;
74
76
public static string PluginDirectory => Main . PluginDirectory ;
@@ -93,6 +95,7 @@ public Data()
93
95
storage = new ( ) ;
94
96
95
97
history = storage . Load ( ) ;
98
+ Log . Debug ( $ "{ history . Version } { DATA_VERSION } ", GetType ( ) ) ;
96
99
if ( history . Version != DATA_VERSION )
97
100
{
98
101
Log . Info ( "History is outdated, updateing" , GetType ( ) ) ;
You can’t perform that action at this time.
0 commit comments