mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-12 06:15:45 +02:00
Ignore cached files for updates and viewed images if their contents are empty
This commit is contained in:
parent
bb22c35221
commit
7a976edc82
@ -83,8 +83,8 @@ void ViewImageInternal(string path){
|
||||
}
|
||||
|
||||
string file = Path.Combine(BrowserCache.CacheFolder, GetImageFileName(url) ?? Path.GetRandomFileName());
|
||||
|
||||
if (File.Exists(file)){
|
||||
|
||||
if (WindowsUtils.FileExistsAndNotEmpty(file)){
|
||||
ViewImageInternal(file);
|
||||
}
|
||||
else{
|
||||
|
@ -66,6 +66,14 @@ public static bool CheckFolderWritePermission(string path){
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FileExistsAndNotEmpty(string path){
|
||||
try{
|
||||
return new FileInfo(path).Length > 0;
|
||||
}catch{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool OpenAssociatedProgram(string file, string arguments = "", bool runElevated = false){
|
||||
try{
|
||||
using(Process.Start(new ProcessStartInfo{
|
||||
|
@ -26,7 +26,7 @@ public UpdateInfo(string versionTag, string releaseNotes, string downloadUrl, st
|
||||
}
|
||||
|
||||
public void BeginSilentDownload(){
|
||||
if (File.Exists(InstallerPath)){
|
||||
if (WindowsUtils.FileExistsAndNotEmpty(InstallerPath)){
|
||||
DownloadStatus = UpdateDownloadStatus.Done;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user