From c9bb903cf4ed7bd7e7ceaa56c1ec9f459b0831e2 Mon Sep 17 00:00:00 2001 From: Jorge Bolois Date: Sat, 25 Feb 2023 12:04:00 +0100 Subject: [PATCH] Using own server to dont kill github. Some improvements over enlarge images. --- src/LocationStorage.js | 4 ++-- src/Locations.js | 6 +++--- src/Styles.js | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/LocationStorage.js b/src/LocationStorage.js index 7095e52..bee3a87 100644 --- a/src/LocationStorage.js +++ b/src/LocationStorage.js @@ -16,7 +16,7 @@ export default class LocationStorage { } static get _data() { - return this.storage.getItem(this.key); + return this.storage.getItem(this.KEY); } static get(name) { @@ -37,7 +37,7 @@ export default class LocationStorage { static _save(data) { const json = JSON.stringify(data); - this.storage.setItem(this.key, json); + this.storage.setItem(this.KEY, json); } } \ No newline at end of file diff --git a/src/Locations.js b/src/Locations.js index 50a79f2..38a6a97 100644 --- a/src/Locations.js +++ b/src/Locations.js @@ -10,16 +10,16 @@ export default class Locations { return storageLocation; } - const response = await fetch(`https://raw.githubusercontent.com/Midefos/idealista-enhancer/main/locations/${name}.json`); + const response = await fetch(`https://ih-data.midefos.com/api/town/${name}`); Log.debug(`Requested location '${name}'`); - if (response.status == 404) { + const data = await response.json(); + if (!data) { Log.debug(`Missing information for location: '${name}'`); const errorLocation = { name: name, errorMessage: 'Datos no disponibles...' }; LocationStorage.save(errorLocation); return errorLocation; } - const data = await response.json(); const location = Location.fromRaw(data); LocationStorage.save(location); diff --git a/src/Styles.js b/src/Styles.js index ae6d9e2..448b718 100644 --- a/src/Styles.js +++ b/src/Styles.js @@ -114,6 +114,7 @@ export default class Styles { static DARK_MODE = ` div.listing-top, div.item-info-container, + .items-container:not(.items-list) .item-info-container, section.links-block-home, div.item-toolbar, .links-block-home div.content, @@ -178,30 +179,38 @@ export default class Styles { static ENLARGE_IMAGES = ` .item-multimedia { - width: 60%; + width: 100% !important; } .item-info-container { - width: 40%; + width: 100% !important; } .item-multimedia, .item-gallery, .item-gallery .mask-wrapper { - height: 300px; + height: 400px !important; } .rs-gallery .item-gallery { - height: unset; + height: unset !important; } .description { - height: auto; + height: auto !important; } .description p.ellipsis { - display: block; - position: unset; + display: block !important; + position: unset !important; + } + + .logo-branding, + .items-container:not(.items-list) .item-toolbar, + .items-container:not(.items-list) .description::before, + .items-container:not(.items-list) .listing-tags-container, + .items-container:not(.items-list) .listing-tags-no-toggle-container { + display: none; } `;