Skip to content

Commit 0e50655

Browse files
committed
v4.0.11250.0-Beta
1 parent 487c9a2 commit 0e50655

File tree

12 files changed

+107
-41
lines changed

12 files changed

+107
-41
lines changed

Common/Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<RootNamespace>ITHit.FileSystem.Samples.Common</RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<PackageReference Include="ITHit.FileSystem" Version="4.0.11187.0-Beta" />
12+
<PackageReference Include="ITHit.FileSystem" Version="4.0.11250.0-Beta" />
1313
</ItemGroup>
1414
</Project>

Windows/Common/Core/Common.Windows.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
1414
</ItemGroup>
1515
<ItemGroup>
16-
<PackageReference Include="ITHit.FileSystem.Windows" Version="4.0.11187.0-Beta" />
16+
<PackageReference Include="ITHit.FileSystem.Windows" Version="4.0.11250.0-Beta" />
1717
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1818
</ItemGroup>
1919
</Project>

Windows/Common/ShellExtension/Common.Windows.ShellExtension.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
2020
</ItemGroup>
2121
<ItemGroup>
22-
<PackageReference Include="ITHit.FileSystem.Windows" Version="4.0.11187.0-Beta" />
22+
<PackageReference Include="ITHit.FileSystem.Windows" Version="4.0.11250.0-Beta" />
2323
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2424
<ProjectReference Include="..\Rpc.Proto\Common.Windows.Rpc.Proto.csproj" />
2525
<ProjectReference Include="..\Rpc\Common.Windows.Rpc.csproj" />

Windows/Common/ShellExtension/ContextMenusProviderBase.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,16 @@ public int GetState(IShellItemArray itemArray, bool okToBeSlow, out EXPCMDSTATE
118118

119119
try
120120
{
121+
if (itemArray is null)
122+
{
123+
return WinError.E_NOTIMPL;
124+
}
125+
121126
IEnumerable<string> files = itemArray.GetFilesPath().Where(ShellExtensionConfiguration.IsVirtualDriveFolder);
122127
if (!files.Any() || !files.All(File.Exists))
128+
{
123129
return WinError.E_NOTIMPL;
130+
}
124131

125132
Log.Info($"\nGetting menu state for {string.Join(",", files)}");
126133

Windows/Common/VirtualDrive/Common.Windows.VirtualDrive.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
1414
</ItemGroup>
1515
<ItemGroup>
16-
<PackageReference Include="ITHit.FileSystem.Windows" Version="4.0.11187.0-Beta" />
16+
<PackageReference Include="ITHit.FileSystem.Windows" Version="4.0.11250.0-Beta" />
1717
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1818
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
1919
<ProjectReference Include="..\Rpc.Proto\Common.Windows.Rpc.Proto.csproj" />

Windows/Common/VirtualDrive/Rpc/GprcServerServiceImpl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ public override async Task<Thumbnail> GetThumbnail(ThumbnailRequest thumbnailReq
113113
}
114114
catch (NotImplementedException)
115115
{
116+
logger.LogMessage("Thumbnail is not implemented", path);
116117
string msg = $"Thumbnail for {path} is not implemented";
117-
logger.LogMessage(msg);
118118
throw new RpcException(new Status(StatusCode.Internal, msg));
119119
}
120120
catch (Exception ex)
121121
{
122-
logger.LogError(ex.Message);
122+
logger.LogError("Error getting thumbnail", path, null, ex);
123123
throw new RpcException(new Status(StatusCode.Internal, ex.Message));
124124
}
125125
}

Windows/WebDAVDrive/WebDAVDrive.UI/WebDAVDrive.UI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ItemGroup>
1919
<PackageReference Include="log4net" Version="2.0.13" />
2020
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.774.44" />
21-
<PackageReference Include="ITHitWebDAVClient" Version="5.0.2450" />
21+
<PackageReference Include="ITHitWebDAVClient" Version="5.0.2539" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

Windows/WebDAVDrive/WebDAVDrive/AppSettings.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ public class AppSettings : Settings
3535
/// Full synchronization interval in milliseconds.
3636
/// </summary>
3737
public double SyncIntervalMs { get; set; }
38+
/// <summary>
39+
/// URL to get a thumbnail for Windows Explorer thumbnails mode.
40+
/// Your server must return 404 Not Found if the thumbnail can not be generated.
41+
/// If incorrect size is returned, the image will be resized automatically to show the thumbnail.
42+
/// "ThumbnailGeneratorUrl": "{path to file}?width={thumbnail width}&height={thumbnail height}"
43+
/// </summary>
44+
public string ThumbnailGeneratorUrl { get; set; }
45+
/// <summary>
46+
/// File types to request thumbnails for.
47+
/// To request thumbnails for specific file types, list file types using '|' separator.
48+
/// To request thumbnails for all file types set the value to "*".
49+
/// "RequestThumbnailsFor": "*|png|jpg|jpeg|gif|bmp|tiff|"
50+
/// </summary>
51+
public string RequestThumbnailsFor { get; set; }
3852
}
3953

4054
/// <summary>

Windows/WebDAVDrive/WebDAVDrive/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private static void DavClient_WebDavError(ISession sender, WebDavErrorEventArgs
263263
passwordCredential.RetrievePassword();
264264
NetworkCredential networkCredential = new NetworkCredential(passwordCredential.UserName, passwordCredential.Password);
265265
DavClient.Credentials = networkCredential;
266-
Engine.RemoteStorageMonitor.WebSocketCredentials = networkCredential;
266+
Engine.Credentials = networkCredential;
267267
e.Result = WebDavErrorEventResult.Repeat;
268268
}
269269
else
@@ -299,7 +299,7 @@ private static void DavClient_WebDavError(ISession sender, WebDavErrorEventArgs
299299
CredentialManager.SaveCredentials(Settings.ProductName, login, password);
300300
}
301301
NetworkCredential newNetworkCredential = new NetworkCredential(login, password);
302-
Engine.RemoteStorageMonitor.WebSocketCredentials = newNetworkCredential;
302+
Engine.Credentials = newNetworkCredential;
303303
DavClient.Credentials = newNetworkCredential;
304304
e.Result = WebDavErrorEventResult.Repeat;
305305
}

Windows/WebDAVDrive/WebDAVDrive/RemoteStorageMonitor.cs

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public virtual SynchronizationState SyncState
3939
/// <summary>
4040
/// Gets or sets a value that indicates whether to send an authenticate header with the websocket.
4141
/// </summary>
42-
public NetworkCredential WebSocketCredentials { get; set; }
4342

4443
/// <summary>
4544
/// WebSocket client.
@@ -112,7 +111,7 @@ await Task.Factory.StartNew(
112111
try
113112
{
114113
repeat = false;
115-
await StartMonitoringAsync(WebSocketCredentials);
114+
await StartMonitoringAsync(engine.Credentials);
116115
}
117116
catch (Exception e) when (e is WebSocketException || e is AggregateException)
118117
{
@@ -157,30 +156,34 @@ internal async Task StopAsync()
157156
internal async Task ProcessAsync(string jsonString)
158157
{
159158
WebSocketMessage jsonMessage = JsonSerializer.Deserialize<WebSocketMessage>(jsonString);
160-
LogMessage($"EventType: {jsonMessage.EventType}", jsonMessage.ItemPath, jsonMessage.TargetPath);
161-
162159
string remoteStoragePath = Mapping.GetAbsoluteUri(jsonMessage.ItemPath);
163-
switch (jsonMessage.EventType)
160+
161+
// check if remote url starts with WebDAVServerUrl
162+
if (remoteStoragePath.StartsWith(Program.Settings.WebDAVServerUrl))
164163
{
165-
case "created":
166-
await CreatedAsync(remoteStoragePath);
167-
break;
168-
case "updated":
169-
await ChangedAsync(remoteStoragePath);
170-
break;
171-
case "moved":
172-
string remoteStorageNewPath = Mapping.GetAbsoluteUri(jsonMessage.TargetPath);
173-
await MovedAsync(remoteStoragePath, remoteStorageNewPath);
174-
break;
175-
case "deleted":
176-
await DeletedAsync(remoteStoragePath);
177-
break;
178-
case "locked":
179-
await LockedAsync(remoteStoragePath);
180-
break;
181-
case "unlocked":
182-
await UnlockedAsync(remoteStoragePath);
183-
break;
164+
LogMessage($"EventType: {jsonMessage.EventType}", jsonMessage.ItemPath, jsonMessage.TargetPath);
165+
switch (jsonMessage.EventType)
166+
{
167+
case "created":
168+
await CreatedAsync(remoteStoragePath);
169+
break;
170+
case "updated":
171+
await ChangedAsync(remoteStoragePath);
172+
break;
173+
case "moved":
174+
string remoteStorageNewPath = Mapping.GetAbsoluteUri(jsonMessage.TargetPath);
175+
await MovedAsync(remoteStoragePath, remoteStorageNewPath);
176+
break;
177+
case "deleted":
178+
await DeletedAsync(remoteStoragePath);
179+
break;
180+
case "locked":
181+
await LockedAsync(remoteStoragePath);
182+
break;
183+
case "unlocked":
184+
await UnlockedAsync(remoteStoragePath);
185+
break;
186+
}
184187
}
185188
}
186189

0 commit comments

Comments
 (0)