@@ -15,7 +15,7 @@ const APIv1 = require('./modules/apiv1');
1515const APIv2 = require ( './modules/apiv2' ) ;
1616const Metrics = require ( './modules/metrics' ) ;
1717const RateLimiter = require ( './modules/rate-limiter' ) ;
18- const { toUcWord, qrg2band, getFreshestSpot, getOldestSpot, normalizeFrequency } = require ( './lib/utils' ) ;
18+ const { toUcWord, qrg2band, getFreshestSpot, getOldestSpot, normalizeFrequency, parseSkimmerMessage } = require ( './lib/utils' ) ;
1919const express = require ( "express" ) ;
2020const app = express ( ) ;
2121const path = require ( "path" ) ;
@@ -1504,6 +1504,7 @@ function validateAndSanitizeSpot(spot) {
15041504 band : String ( spot . band || '' ) ,
15051505 mode : spot . mode || null ,
15061506 submode : spot . submode || null ,
1507+ skimmer : spot . skimmer || null ,
15071508 dxcc_spotter : normalizeDXCCObject ( spot . dxcc_spotter ) ,
15081509 dxcc_spotted : normalizeDXCCObject ( spot . dxcc_spotted )
15091510 } ;
@@ -1538,10 +1539,13 @@ async function handlespot(spot, spot_source = "cluster") {
15381539 return ;
15391540 }
15401541
1542+ // Store original spotter callsign before normalization for skimmer parsing
1543+ const originalSpotter = spot . spotter ;
1544+
15411545 // Normalize spotter callsign - strip RBN/cluster suffixes like -#, -15, etc.
15421546 // This simplifies deduplication and improves cache hit rates
15431547 spot . spotter = normalizeSpotterCallsign ( spot . spotter ) ;
1544-
1548+
15451549 // Normalize frequency for consistency (based on Wavelog PR #2514)
15461550 // All frequencies should be in kHz with 1 decimal place
15471551 const normalizedFreq = normalizeFrequency ( spot . frequency ) ;
@@ -1602,7 +1606,14 @@ async function handlespot(spot, spot_source = "cluster") {
16021606 _sourceData : sourceData // Attach source data for GUI display
16031607 }
16041608
1605- //do DXCC lookup (with timeout protection)
1609+ // Parse skimmer messages if this is a skimmer spot
1610+ // Only processes spots with -# suffix in spotter callsign
1611+ const skimmerData = parseSkimmerMessage ( spot . message , originalSpotter ) ;
1612+ if ( skimmerData ) {
1613+ dxSpot . skimmer = skimmerData ;
1614+ }
1615+
1616+ //do DXCC lookup (with timeout protection)
16061617 try {
16071618 dxSpot . dxcc_spotter = await dxcc_lookup ( spot . spotter ) ;
16081619 dxSpot . dxcc_spotted = await dxcc_lookup ( spot . spotted ) ;
@@ -1934,23 +1945,6 @@ function removeFromIndexes(spot) {
19341945/**
19351946 * Rebuilds all indexes from scratch
19361947 */
1937- function rebuildIndexes ( ) {
1938- bandIndex . clear ( ) ;
1939- frequencyIndex . clear ( ) ;
1940- sourceIndex . clear ( ) ;
1941- spotKeyIndex . clear ( ) ;
1942-
1943- // Clear statistics indexes
1944- modeTypeStats . phone = 0 ;
1945- modeTypeStats . digi = 0 ;
1946- modeTypeStats . cw = 0 ;
1947- modeTypeStats . unknown = 0 ;
1948- Object . keys ( continentStats ) . forEach ( key => delete continentStats [ key ] ) ;
1949- Object . keys ( continentDeStats ) . forEach ( key => delete continentDeStats [ key ] ) ;
1950- rbnSpotCount = 0 ;
1951-
1952- spots . forEach ( spot => updateIndexes ( spot ) ) ;
1953- }
19541948
19551949/**
19561950 * Removes spots older than the configured maximum age
@@ -2008,17 +2002,11 @@ function logStatistics() {
20082002 const analyticsSummary = analytics . getSummary ( ) ;
20092003 totalRequests = analyticsSummary . summary ?. totalRequests || 0 ;
20102004
2011- // Debug: log if analytics seems disabled or has no data
2012- if ( totalRequests === 0 && Object . keys ( analyticsSummary . clients || { } ) . length === 0 ) {
2013- console . log ( `[Core] [DEBUG] Analytics enabled but no requests tracked yet` ) ;
2014- }
20152005 } catch ( e ) {
20162006 console . error ( `[Core] [ERROR] Failed to get analytics summary: ${ e . message } ` ) ;
20172007 }
20182008 } else {
2019- console . log ( `[Core] [DEBUG] Analytics disabled (enabled: ${ config . analyticsEnabled } )` ) ;
2020- }
2021-
2009+ }
20222010 console . log ( `[Core] ═══════════════════════════════════════════════════════════════════════════` ) ;
20232011 console . log ( `[Core] Statistics: Uptime=${ uptimeHours } h ${ uptimeMinutes } m | Requests=${ totalRequests } | Total Spots=${ spots . length } ` ) ;
20242012 console . log ( `[Core] Sources: ${ sourceList || 'none' } ` ) ;
0 commit comments