avatars: Fix #1576
This commit is contained in:
parent
106fbef51b
commit
baececd569
|
@ -46,11 +46,13 @@ namespace SparkleShare
|
|||
// Search avatars by file name, ignore extension
|
||||
// Delete files over a day old
|
||||
// Return first matching file
|
||||
foreach (string file_path in Directory.GetFiles (avatars_path, email.MD5 () + "*")) {
|
||||
if (new FileInfo (file_path).LastWriteTime < DateTime.Now.AddDays (-1))
|
||||
File.Delete (file_path);
|
||||
else
|
||||
return file_path;
|
||||
if (Directory.Exists (avatars_path)) {
|
||||
foreach (string file_path in Directory.GetFiles (avatars_path, email.MD5 () + "*")) {
|
||||
if (new FileInfo (file_path).CreationTime < DateTime.Now.AddDays (-1))
|
||||
File.Delete (file_path);
|
||||
else
|
||||
return file_path;
|
||||
}
|
||||
}
|
||||
|
||||
string avatar_file_path;
|
||||
|
|
Loading…
Reference in a new issue