StationDB - hack to force QRV database update despite "correct" timestamp

Currently the time stamps of the input files used for updates of the
database are stored in Settings.Default. If the database is cleared
or the stations.db3 file is deleted, the time stamps survive, as they are
stored separately.

That triggers a subtle bug: the location table is updated first and
updates the DB status.
The qrv table than checks the DB status - which is "up-to-date" - and
the timestamp - which may still be set correctly from previous updates.
The qrv table then will never be updated.

Work-around: delete QRV_Update_TimeStamp key in user.config

Hack here: make sure to fill the table if it is empty.

Correct way moving forward: the time stamp needs to go into the database
instead of Settings.Default
stationdb_debug
Alexander Kurpiers 2024-05-01 18:57:14 +02:00
rodzic a397486143
commit 61a9d160fa
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -427,7 +427,7 @@ namespace ScoutBase.Stations
this.ReportProgress(0, "Updating qrv info from web database...");
// get update from url
GetUpdateFromURL(Properties.Settings.Default.Stations_UpdateURL + "qrv.zip", Path.Combine(TmpDirectory, "qrv.zip"), Path.Combine(TmpDirectory, "qrv.json"));
if (HasDatabaseChanged() || HasQRVUpdateChanged())
if (HasDatabaseChanged() || HasQRVUpdateChanged() || StationData.Database.QRVCount() == 0)
{
if (!ReadQRVFromURL(Properties.Settings.Default.Stations_UpdateURL + "qrv.zip", Path.Combine(TmpDirectory, "qrv.zip"), Path.Combine(TmpDirectory, "qrv.json")))
{