Skip to content

Commit d43c5b3

Browse files
authored
Map View in Fredy :D (#253)
* init map view * switching off 3d buildings when sattelite view is on * rename menu items * upgrading dependencies, adding provider to popups * adding screenshot for map view * fixing readme * next release version
1 parent 7fd8be0 commit d43c5b3

File tree

168 files changed

+16263
-1509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+16263
-1509
lines changed

README.md

Lines changed: 1 addition & 1 deletion

copyright.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

@@ -30,12 +30,16 @@ async function getAllFiles(dir = '.') {
3030

3131
/* eslint-disable no-console */
3232
async function addCopyright(files) {
33+
const oldCopyrightRegex =
34+
/^(\/\*\n \* Copyright \(c\) \d{4} by Christian Kellner\.\n \* Licensed under Apache-2.0 with Commons Clause and Attribution\/Naming Clause\n \*\/\n\n)+/;
3335
for (let file of files) {
3436
try {
3537
let content = await fs.readFile(file, 'utf8');
36-
if (!content.startsWith(COPYRIGHT)) {
37-
await fs.writeFile(file, COPYRIGHT + content);
38-
console.log(`Added copyright to ${file}`);
38+
const strippedContent = content.replace(oldCopyrightRegex, '');
39+
const newContent = COPYRIGHT + strippedContent;
40+
if (content !== newContent) {
41+
await fs.writeFile(file, newContent);
42+
console.log(`Added/Updated copyright in ${file}`);
3943
}
4044
} catch (err) {
4145
console.error(`Error processing ${file}: ${err}`);

doc/screenshot1.png

3.49 MB

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

@@ -12,6 +12,7 @@ import { cleanupDemoAtMidnight } from './lib/services/crons/demoCleanup-cron.js'
1212
import { initTrackerCron } from './lib/services/crons/tracker-cron.js';
1313
import logger from './lib/services/logger.js';
1414
import { initActiveCheckerCron } from './lib/services/crons/listing-alive-cron.js';
15+
import { initGeocodingCron } from './lib/services/crons/geocoding-cron.js';
1516
import { getSettings } from './lib/services/storage/settingsStorage.js';
1617
import SqliteConnection, { computeDbPath } from './lib/services/storage/SqliteConnection.js';
1718
import { initJobExecutionService } from './lib/services/jobs/jobExecutionService.js';
@@ -61,6 +62,7 @@ ensureDemoUserExists();
6162
await initTrackerCron();
6263
//do not wait for this to finish, let it run in the background
6364
initActiveCheckerCron();
65+
initGeocodingCron();
6466

6567
logger.info(`Started Fredy successfully. Ui can be accessed via http://localhost:${settings.port}`);
6668

lib/FredyPipelineExecutioner.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

@@ -9,6 +9,7 @@ import * as notify from './notification/notify.js';
99
import Extractor from './services/extractor/extractor.js';
1010
import urlModifier from './services/queryStringMutator.js';
1111
import logger from './services/logger.js';
12+
import { geocodeAddress } from './services/geocoding/geoCodingService.js';
1213

1314
/**
1415
* @typedef {Object} Listing
@@ -79,12 +80,32 @@ class FredyPipelineExecutioner {
7980
.then(this._normalize.bind(this))
8081
.then(this._filter.bind(this))
8182
.then(this._findNew.bind(this))
83+
.then(this._geocode.bind(this))
8284
.then(this._save.bind(this))
8385
.then(this._filterBySimilarListings.bind(this))
8486
.then(this._notify.bind(this))
8587
.catch(this._handleError.bind(this));
8688
}
8789

90+
/**
91+
* Geocode new listings.
92+
*
93+
* @param {Listing[]} newListings New listings to geocode.
94+
* @returns {Promise<Listing[]>} Resolves with the listings (potentially with added coordinates).
95+
*/
96+
async _geocode(newListings) {
97+
for (const listing of newListings) {
98+
if (listing.address) {
99+
const coords = await geocodeAddress(listing.address);
100+
if (coords) {
101+
listing.latitude = coords.lat;
102+
listing.longitude = coords.lng;
103+
}
104+
}
105+
}
106+
return newListings;
107+
}
108+
88109
/**
89110
* Fetch listings from the provider, using the default Extractor flow unless
90111
* a provider-specific getListings override is supplied.

lib/api/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

lib/api/routes/backupRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

lib/api/routes/dashboardRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

lib/api/routes/demoRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 by Christian Kellner.
2+
* Copyright (c) 2026 by Christian Kellner.
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

0 commit comments

Comments
 (0)