diff --git a/FreeTubeSyncer/Program.cs b/FreeTubeSyncer/Program.cs index 82b1176..24adb90 100644 --- a/FreeTubeSyncer/Program.cs +++ b/FreeTubeSyncer/Program.cs @@ -1,7 +1,5 @@ using Avalonia; using System; -using System.Collections; -using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading; @@ -40,7 +38,7 @@ class Program var historySyncer = new Syncer(dbWatcher, Path.Join(path, "history.db"), "history.db", "/history"); var playlistSyncer = new Syncer(dbWatcher, Path.Join(path, "playlists.db"), "playlists.db", "/playlist"); var profileSyncer = new Syncer(dbWatcher, Path.Join(path, "profiles.db"), "profiles.db", "/profile"); - var searchHistorySyncer = new Syncer(dbWatcher, Path.Join(path, "search-history.db"), "search-history.db", "/search"); + var searchHistorySyncer = new Syncer(dbWatcher, Path.Join(path, "search-history.db"), "search-history.db", "/searchHistory"); var settingsSyncer = new Syncer(dbWatcher, Path.Join(path, "settings.db"), "settings.db", "/settings"); Task.Run(() => CheckCanSync(historySyncer, playlistSyncer, profileSyncer, searchHistorySyncer, settingsSyncer)); @@ -56,6 +54,9 @@ class Program { Thread.Sleep(100); if (Process.GetProcessesByName("FreeTube").Length > 0) continue; + Console.WriteLine("FreeTube has closed, we're going to try and update."); + Thread.Sleep(1500); + if (historySyncer is { IsDirty: true }) historySyncer.Sync(); if (playlistSyncer is { IsDirty: true })