feat: New tool to remove duplicates in the log

This commit is contained in:
2026-07-05 10:58:49 +02:00
parent 2d742be7df
commit 45b9bcdea7
7 changed files with 300 additions and 2 deletions
+2
View File
@@ -144,6 +144,8 @@ export function ExportCabrilloSelected(arg1:string,arg2:Array<number>):Promise<m
export function FilterFields():Promise<Array<string>>;
export function FindDuplicates(arg1:number):Promise<Array<main.DuplicateGroup>>;
export function FindQSOsForUpload(arg1:string,arg2:string):Promise<Array<qso.QSO>>;
export function FlexATUBypass():Promise<void>;
+4
View File
@@ -250,6 +250,10 @@ export function FilterFields() {
return window['go']['main']['App']['FilterFields']();
}
export function FindDuplicates(arg1) {
return window['go']['main']['App']['FindDuplicates'](arg1);
}
export function FindQSOsForUpload(arg1, arg2) {
return window['go']['main']['App']['FindQSOsForUpload'](arg1, arg2);
}
+32
View File
@@ -1528,6 +1528,38 @@ export namespace main {
this.is_custom = source["is_custom"];
}
}
export class DuplicateGroup {
key: string;
qsos: qso.QSO[];
static createFrom(source: any = {}) {
return new DuplicateGroup(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.key = source["key"];
this.qsos = this.convertValues(source["qsos"], qso.QSO);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class EmailSettings {
enabled: boolean;
smtp_host: string;