Simplified internal qso data loading to not be version dependent

rich-presence
Tag 2021-05-08 13:08:32 -07:00
rodzic 2ac1011d75
commit df54f3ce90
1 zmienionych plików z 27 dodań i 31 usunięć

Wyświetl plik

@ -15870,50 +15870,46 @@ function mediaCheck()
// Old log filename, no longer referenced
tryToDeleteLog("lotw.adif");
try
{
if (fs.existsSync(g_NWappData + "internal_qso.json"))
{
var data = JSON.parse(fs.readFileSync(g_NWappData + "internal_qso.json"));
g_tracker = data.tracker;
if (typeof data.version != "undefined" && data.version == gtVersion)
if (typeof g_tracker.worked.px == "undefined")
{
g_tracker = data.tracker;
if (typeof g_tracker.worked.px == "undefined")
{
g_tracker.worked.px = {};
g_tracker.confirmed.px = {};
}
g_QSOhash = data.g_QSOhash;
for (var i in g_QSOhash)
{
if (
typeof g_QSOhash[i].px == "undefined" ||
g_QSOhash[i].px == null
)
{
if (g_QSOhash[i].dxcc != -1)
{ g_QSOhash[i].px = getWpx(g_QSOhash[i].DEcall); }
else g_QSOhash[i].px = null;
}
g_QSOcount++;
if (g_QSOhash[i].confirmed) g_QSLcount++;
}
}
else
{
//clearLogFilesAndCounts();
g_tracker.worked.px = {};
g_tracker.confirmed.px = {};
}
g_QSOhash = data.g_QSOhash;
for (var i in g_QSOhash)
{
if (
typeof g_QSOhash[i].px == "undefined" ||
g_QSOhash[i].px == null
)
{
if (g_QSOhash[i].dxcc != -1)
{ g_QSOhash[i].px = getWpx(g_QSOhash[i].DEcall); }
else g_QSOhash[i].px = null;
}
g_QSOcount++;
if (g_QSOhash[i].confirmed) g_QSLcount++;
}
fs.unlinkSync(g_NWappData + "internal_qso.json");
}
loadReceptionReports();
}
catch (e) {}
catch (e)
{
clearLogFilesAndCounts();
}
return true;
}