Using own server to dont kill github.

Some improvements over enlarge images.
This commit is contained in:
Jorge Bolois 2023-02-25 12:04:00 +01:00
parent dd18a984ac
commit c9bb903cf4
3 changed files with 21 additions and 12 deletions

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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;
}
`;