Updated syncer to new API 0.1.5.
Change ID Comparison to string comparison, instead of EqualId()
function.
Updated RemoveAll() to use string comparison, instead of EqualId() to
remove.
Added Try Catch retry 1 after delay. This happens when we post multiple
copies of the same DB line entry, when it doesn't exist, and is added to
the REST Server, while the REST server processes it in one thread, but
it isn't updated properly in the new thread, and it fails, cause the
item is in the database backend, and fails to process. Solution is to
wait for a small delay, before attempting the post request again. If it
fails a second time, then there's something majorly wrong.
Changed interval check from a Numeric spin box, to a pre-defined option
selector.
Now have 1/2 minute, 1 Minute, 30 Minutes, 1 hour, 6 hours, 12 hours and
24 hour intervals.
Needs testing. Switched to using a Temporary file to write out the
freetube database format, removing the old database, then copying over
the new one, instead of writing directly to it, in hope of fixing the
sporadic corruption of the database files.
Changed FlatpakPlatformVersion to 24.08
Removed --socket=wayland (Causes issues with trying to connect to
display server, Avalonia is still X11)
Added socket session-bus and system-bus
Added permission to access io.freetubeapp.FreeTube flatpak config
directory.
Added Device Direct Rendering driver for GL Drawing.
Added DBus interfaces for StatusNotifierItem and StatusNotifierWatcher
to allow System Tray icon to appear from within Flatpak.
Since we can't rely on Process.GetProcessByName() to work from within a
sandboxed environment such as Flatpak, we instead rely on the
SingletonCookie/SingletonLock/SingletonSocket to determine if the
FreeTube Process is still running.
Added fields for Normal icon, Waiting to Sync Icon, and Syncing Complete
icons to let user know of changes in the state of the Syncer.
Added function to ensure that we are changing the Icon and Tooltip on
the UI Thread, instead of some other thread.
Updated SyncMonitor to check for any dirty syncers, and if so, we update
our SysTray icon.
Added update to show we are syncing the data (Tooltip only)
Added update to show we have compeleted sync.
Added timer for 3 seconds before resetting SysTray and tooltip back to
normal status.
Removed un-nesscary Close() as using should automatically close, and
dispose of the file handler.
Added a 100ms wait after we finish writing the file, before we unlock
the watcher, so we don't generate un-nesscary events.
Updated app to implement Serilog logging functionality.
Added GetAppFolder()
Changed GetSettingsPath() to use GetAppFolder()
Removed all Console.WriteLine() and replaed with Logger functions.
Created SetupLogger(), to log to both Console, and a Log file.
Added new read code for reading data in from a database file.
Added Logger to log when a file is created, or the file has been
changed.
Changed Error to log as error, instead of Console writting.
Added Last Update stamp, for when the last update was in the database,
to see if we have newer events to process.
Applied settings for enabling/disabling syncers on startup.
Updated SyncMonitor() to use new Update check, before iterating through
all the syncers and fetching them.
Added logging messages for when we are updating settings to reflect what
has been changed.
Added GetLastUpdated() to ISyncer interface.
Updated code to use new /ping endpoint.
Added GetLastUpdated() REST API call to fetch when the database was last
updated.
Clarified logging for when an Update is from a file, or from the REST
API Server.
Added logging for when a nw File Entry is processed, or when a File
Entry is Updated.
Updated MainWindow.xaml with UI controls for FreeTubeSyncer application
settings.
Updated MainWindow.xaml.cs code behind file top handle logic of not
closing the app when the window is closed, and handling Saving and
Hiding of the Window when close is requestd.
Updated App.xaml to use SukiUI.
Added Event Handlers for System Tray.
Updated App.xaml.cs code behind file to implement Logic that was in
Program.cs, into the core of the UI App. Implemented Async Tasks, to
allow for UI to remain responsive, while doing long running tasks.
Added Loading, Saving and Updating settings from UI updates.
Added parameter for Rest Base URL to allow configurability of the Base
URL for REST API.
Updated ISyncer, to add Enable(), Disable(), IsEnabled(),
UpdateBaseUrl(), SetEnabled() and PingApi() to allow for settings.
PingApi() will test to see if the URL provided is reachable.
UpdatebaseUrl() will set the URL for the server to communicate with.
SetEnabled(), Enable() Disable() and IsEnabled() to allow for settings
to toggle on and off syncing of specific parts of FreeTube.
Added Locking system, so that we don't try to access the same file with
both read and write functions at the same time causing an locked
exception on the file when watching it.
Now utilizing syncers in an Array for each checking of IsDirty() or not,
and running code based upon the state of the syncers. May clean this up
more.
Added polling of the database to see if there's anything new to sync
locally.
Added interface for Syncer class.
Changed IsDirty from Property to Function
Moved order for reading in initial database. First will fetch from the
REST Api, then it will read in the database stored locally.
Changed logic behind reading and fetching database. Fetching the
database from the REST Api will mark internally that it is dirty, and
force syncing.
If an entry exists in our cache, and is equal, then we continue through,
otherwise we remove the old entry, and use the new entry.
While still testing things out, remain in Console mode.
Removed un-used using statements.
Fixed SearchHistorySyner to properly use /searchHistory API end-point.
Added print statement to see when FreeTube closes, and wait for 1.5
seconds before attempting to sync everything up. May need to increase
this more, needs testing. (maybe a good 5 seconds would be enough)
Updated Syncer class to properly sync all classes, even with special
requierments needed for Settings.
Now properly handles all classes, and ensures that the data is properly
stored in the database, and can be written out correctly to the FreeTube
database files.
Updated Seting class to use string for teh data, and the data is the
full setting line, to allow for the flexability for Any data value in
the field. Implemented MarshalData() and JsonData() functions.