Add code comments & Improve code quality

This commit is contained in:
Jack251970 2025-06-05 01:12:12 +08:00
parent 72bd4c202a
commit 0ec38faf1d
2 changed files with 4 additions and 1 deletions

View file

@ -132,6 +132,7 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader
// Use a copy to avoid lock issues with the original file
var tempDbPath = Path.Combine(_faviconCacheDir, $"tempfavicons_{Guid.NewGuid()}.db");
// Use a copy to avoid lock issues with the original file
try
{
File.Copy(dbPath, tempDbPath, true);

View file

@ -60,7 +60,7 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
File.Copy(placesPath, tempDbPath, true);
// Create the connection string and init the connection
string dbPath = string.Format(DbPathFormat, tempDbPath);
var dbPath = string.Format($"Data Source={tempDbPath};Mode=ReadOnly");
using var dbConnection = new SqliteConnection(dbPath);
// Open connection to the database file and execute the query
@ -119,8 +119,10 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
private void LoadFaviconsFromDb(string faviconDbPath, List<Bookmark> bookmarks)
{
// Use a copy to avoid lock issues with the original file
var tempDbPath = Path.Combine(_faviconCacheDir, $"tempfavicons_{Guid.NewGuid()}.sqlite");
// Use a copy to avoid lock issues with the original file
try
{
// Use a copy to avoid lock issues with the original file