Skip to content

Commit e126771

Browse files
committed
Fixed "Last Compressed" not being updated in the watchlist when compressing. Closes #522
1 parent 3bce318 commit e126771

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CompactGUI.Watcher/Watcher.vb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@ Public Class Watcher : Inherits ObservableObject
126126
existingItem.LastCheckedDate = DateTime.Now
127127
existingItem.LastCheckedSize = analyser.CompressedBytes
128128
existingItem.LastUncompressedSize = analyser.UncompressedBytes
129-
existingItem.LastSystemModifiedDate = existingFolderMonitor.LastChangedDate
129+
existingItem.LastSystemModifiedDate = DateTime.Now
130130
If analyser.FileCompressionDetailsList.Count <> 0 Then
131131
existingItem.CompressionLevel = analyser.FileCompressionDetailsList.Select(Function(f) f.CompressionMode).Max
132132
End If
133133

134+
If isFreshlyCompressed Then
135+
existingItem.LastCompressedDate = DateTime.Now
136+
End If
134137

135138
If isFreshlyCompressed OrElse existingItem.CompressionLevel = WOFCompressionAlgorithm.NO_COMPRESSION Then
136139
existingItem.LastCompressedSize = analyser.CompressedBytes
@@ -169,7 +172,6 @@ Public Class Watcher : Inherits ObservableObject
169172
WatchedFolders.Remove(item)
170173
WriteToFile()
171174

172-
173175
End Sub
174176

175177

CompactGUI/ViewModels/FolderViewModel.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Public Class FolderViewModel : Inherits ObservableObject
9595

9696
Public Async Function UncompressFolderAsync() As Task
9797
Await Folder.UncompressFolder()
98-
Application.GetService(Of Watcher.Watcher).UpdateWatched(Folder.FolderName, Folder.Analyser, True)
98+
Application.GetService(Of Watcher.Watcher).UpdateWatched(Folder.FolderName, Folder.Analyser, False)
9999

100100
End Function
101101

0 commit comments

Comments
 (0)