Skip to content

Commit

Permalink
7thHeaven.Code: Delete the library temp folder on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Jan 15, 2023
1 parent 3421590 commit ccbe4cf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions 7thHeaven.Code/Sys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ public static string PathToTempFolder
}
}

public static string PathToLibraryTempFolder
{
get
{
return Path.Combine(Sys.Settings.LibraryLocation, "temp");
}
}

public static string PathToCrashReports
{
get
Expand Down Expand Up @@ -499,6 +507,22 @@ static Sys()
Directory.Delete(PathToTempFolder, true);
Directory.CreateDirectory(PathToTempFolder);
}

// Cleanup the library temp folder if it exist
if (Sys.Settings.LibraryLocation != String.Empty)
{
// Create the temp folder if does not exist
if (!Directory.Exists(PathToLibraryTempFolder))
{
Directory.CreateDirectory(PathToLibraryTempFolder);
}
else
{
// Cleanup the temp folder and recreate it
Directory.Delete(PathToLibraryTempFolder, true);
Directory.CreateDirectory(PathToLibraryTempFolder);
}
}
}

/// <summary>
Expand Down

0 comments on commit ccbe4cf

Please sign in to comment.