mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-04 17:34:07 +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());
|
string file = Path.Combine(BrowserCache.CacheFolder, GetImageFileName(url) ?? Path.GetRandomFileName());
|
||||||
|
|
||||||
if (File.Exists(file)){
|
if (WindowsUtils.FileExistsAndNotEmpty(file)){
|
||||||
ViewImageInternal(file);
|
ViewImageInternal(file);
|
||||||
}
|
}
|
||||||
else{
|
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){
|
public static bool OpenAssociatedProgram(string file, string arguments = "", bool runElevated = false){
|
||||||
try{
|
try{
|
||||||
using(Process.Start(new ProcessStartInfo{
|
using(Process.Start(new ProcessStartInfo{
|
||||||
|
@ -26,7 +26,7 @@ public UpdateInfo(string versionTag, string releaseNotes, string downloadUrl, st
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void BeginSilentDownload(){
|
public void BeginSilentDownload(){
|
||||||
if (File.Exists(InstallerPath)){
|
if (WindowsUtils.FileExistsAndNotEmpty(InstallerPath)){
|
||||||
DownloadStatus = UpdateDownloadStatus.Done;
|
DownloadStatus = UpdateDownloadStatus.Done;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user