Skip to content

Commit d0bf858

Browse files
committed
Fixes #530
1 parent 68d6785 commit d0bf858

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CompactGUI.Core/WOFHelper.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ public static WOFCompressionAlgorithm WOFConvertCompressionLevel(int level)
2222
};
2323
}
2424

25+
public static CompressionMode CompressionModeFromWOFMode(WOFCompressionAlgorithm mode)
26+
{
27+
return mode switch
28+
{
29+
WOFCompressionAlgorithm.XPRESS4K => CompressionMode.XPRESS4K,
30+
WOFCompressionAlgorithm.XPRESS8K => CompressionMode.XPRESS8K,
31+
WOFCompressionAlgorithm.XPRESS16K => CompressionMode.XPRESS16K,
32+
WOFCompressionAlgorithm.LZX => CompressionMode.LZX,
33+
_ => CompressionMode.None
34+
};
35+
}
36+
37+
2538
public static WOFCompressionAlgorithm WOFConvertCompressionLevel(CompressionMode mode)
2639
{
2740
return mode switch

CompactGUI/ViewModels/HomeViewModel.vb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ Partial Public Class HomeViewModel : Inherits ObservableObject : Implements IRec
121121
End If
122122

123123
If _watcher.WatchedFolders.Any(Function(w) w.Folder = newFolder.FolderName) Then
124+
Dim watchedFolder = _watcher.WatchedFolders.First(Function(w) w.Folder = newFolder.FolderName)
124125
newFolder.CompressionOptions.WatchFolderForChanges = True
126+
newFolder.CompressionOptions.SelectedCompressionMode = Core.WOFHelper.CompressionModeFromWOFMode(watchedFolder.CompressionLevel)
125127
End If
126128

127129

0 commit comments

Comments
 (0)