2
2
using System . Text . Json ;
3
3
using System . Text . RegularExpressions ;
4
4
using CommandLine ;
5
- using Polly ;
6
5
using Spectre . Console ;
7
6
using SyncCodes ;
8
7
using Context = SyncCodes . Context ;
@@ -141,9 +140,6 @@ await catalogResponse.Content.ReadAsStringAsync(),
141
140
142
141
var localCatalog = context . GetFiles ( ) ;
143
142
144
- // app.Logger.LogInformation("Remote catalog: {json}", JsonSerializer.Serialize(catalog, jsonSerializerOptions));
145
- // app.Logger.LogInformation("Local catalog: {json}", JsonSerializer.Serialize(localCatalog, jsonSerializerOptions));
146
-
147
143
var differences = catalog . Concat ( localCatalog ) . GroupBy (
148
144
f => f . Path . RelatedTo ( workBase ) ,
149
145
f => f . Hash ,
@@ -156,20 +152,9 @@ await catalogResponse.Content.ReadAsStringAsync(),
156
152
}
157
153
) ;
158
154
159
- // var toDelete = differences.Where(c => c.LocalHash is not null && c.RemoteHash is null).ToList();
160
- // var toDownload = differences.Where(c => c.LocalHash is null && c.RemoteHash is not null).ToList();
161
- // var toUpdate = differences.Where(c => c.LocalHash is not null && c.RemoteHash is not null && !c.LocalHash.Equals(c.RemoteHash));
162
- //
163
- // app.Logger.LogInformation(
164
- // "Remote: {json1}\n Local: {json2}\n Differences: {json3}",
165
- // JsonSerializer.Serialize(toDelete, jsonSerializerOptions),
166
- // JsonSerializer.Serialize(toDownload, jsonSerializerOptions),
167
- // JsonSerializer.Serialize(toUpdate, jsonSerializerOptions)
168
- // );
169
-
170
155
foreach ( var comparison in differences )
171
156
{
172
- if ( comparison . LocalHash is not null && comparison . RemoteHash is not null )
157
+ if ( comparison . LocalHash is not null && comparison . RemoteHash is null )
173
158
{
174
159
var filePath = Path . Combine ( workBase , comparison . Path ) ;
175
160
if ( ! File . Exists ( filePath ) )
@@ -212,11 +197,16 @@ await catalogResponse.Content.ReadAsStringAsync(),
212
197
213
198
app . MapGet (
214
199
"/" ,
215
- ( ) => HomePageHtml (
216
- subTitle : "Development usage only (Client Mode)" ,
217
- content : $ """
218
- <p class="mt-4 text-xl text-gray-500">🌏 Target Server Address: <a href="{ address } " target="_blank" class="font-semibold text-indigo-600 underline">{ address } </a></p>
219
- """
200
+ ( ) => Results . Content (
201
+ HomePageHtml (
202
+ subTitle : "Development usage only (Client Mode)" ,
203
+ content : $ """
204
+ <p class="mt-4 text-xl text-gray-500">🌏 Target Server Address: <a href="{ address } " target="_blank" class="font-semibold text-indigo-600 underline">{ address } </a></p>
205
+ <p class="mt-4 text-xl text-gray-500">đź“‚ Work Base Path: <a href="file:///{ workBase } " target="_blank" class="font-semibold text-indigo-600 underline">{ workBase } </a></p>
206
+ """
207
+ ) ,
208
+ "text/html" ,
209
+ Encoding . UTF8
220
210
)
221
211
) ;
222
212
0 commit comments