public IEnumerable <FirefoxBookmarkEntry> GetBookmarkEntries(string username) { var placesDbPath = _disk.GetLocalFilePath($@"{GetProfilePath(username)}\places.sqlite"); using (var conn = new SQLiteConnection($"Data Source={placesDbPath}")) { conn.Open(); string sql = "SELECT * FROM moz_bookmarks INNER JOIN moz_places ON moz_bookmarks.fk = moz_places.id"; SQLiteCommand command = new SQLiteCommand(sql, conn); SQLiteDataReader reader = command.ExecuteReader(); while (reader.Read()) { var lastModified = DateTimeOffset.FromUnixTimeSeconds((long)reader["lastModified"] / 1_000_000).LocalDateTime; DateTime?lastVisited = null; if (reader["last_visit_date"] is long lastVisit) { lastVisited = DateTimeOffset.FromUnixTimeSeconds(lastVisit / 1_000_000).LocalDateTime; } yield return(new FirefoxBookmarkEntry(reader["url"] as string, reader["title"] as string ?? string.Empty, lastVisited, lastModified, (long)reader["visit_count"])); } conn.Close(); } }
private string GetDbPath(string skypeUserName) => _disk.GetLocalFilePath($@"{MainFolderPath}\{skypeUserName}\main.db");
private string FindDbPath() => _disk.GetLocalFilePath($@"Users/{_userName}/AppData/Local/Google/Drive/user_default/sync_config.db");