Skip to content

Feature/spec filter#276

Draft
strech345 wants to merge 13 commits intoorangecoding:masterfrom
strech345:feature/spec_filter
Draft

Feature/spec filter#276
strech345 wants to merge 13 commits intoorangecoding:masterfrom
strech345:feature/spec_filter

Conversation

@strech345
Copy link
Contributor

@strech345 strech345 commented Mar 8, 2026

listings can be filtered by specs

  • specs are: price, size, rooms
  • by fiilters: maxPrice, minSize, minRooms
  • will be filtered out for notifications
  • will be filtered out on overview
  • for now its only specFilters, but also blacklist and areaFilter should be added here.
  • can be disabled on overview (in filter section)
  • add rooms into db because its next to price and size one of the three importen specs
  • show rooms in overview and detail
  • update kleinanzeigen config
  • add rooms for now only on kleinanzeigen but on the other it should also be added

@strech345
Copy link
Contributor Author

we are using INTEGER as type for the db but saving floating numbers at least for rooms and size.
Interessting that this will be saved as REAL when its an float. So it returns floating numbers.
Im not shure what would be good. For size its ok to reduze to integer, for rooms with 2.5 rooms it would be nice to store, but a bit to much to use REAL for such little numbers.
What we can do, but maybe ugly, multiply rooms by 10 to save and devide by 10 at read, so we can still use INTEGER.
@orangecoding what do you think?

  1. leave it like it is: default is INTERGER, but if the value is float sqlite will automatically store it as REAL
  2. take always REAL
  3. take INTEGER and multiply by 10

@strech345 strech345 closed this Mar 8, 2026
@orangecoding
Copy link
Owner

@strech345 why did you close the pr?

@strech345 strech345 reopened this Mar 9, 2026
@strech345
Copy link
Contributor Author

@strech345 why did you close the pr?

i really dont know why. I only changed to draft. But dont know why i close it.

@orangecoding
Copy link
Owner

So should I review it now or is this still a draft?

@strech345
Copy link
Contributor Author

So should I review it now or is this still a draft?

Would be nice if you can read my comments here and give me some Feedback. Also you can Start reviewing it. I would only extend it like explained.

@orangecoding
Copy link
Owner

Would be nice if you can read my comments here and give me some Feedback. Also you can Start reviewing it. I would only extend it like explained.

Tbh, I don't see an issue with this...?

leave it like it is: default is INTERGER, but if the value is float sqlite will automatically store it as REAL


function normalize(o) {
const size = o.size || '--- m²';
const parts = (o.tags || '').split('·').map((p) => p.trim());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link
Owner

@orangecoding orangecoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strech345 I have not (yet) checked out your fork and ran it on my machine, bur so far I have 4 comments. Let me know when I should check out the whole thing

return listings.map(this._providerConfig.normalize);
return listings.map((listing) => {
const normalized = this._providerConfig.normalize(listing);
// TODO: every provider should return price, size and rooms in type number. This makes it more strong and strict of the provider output. String formats like "m², Zi,..." should not be part and can be added on fe or massages. Move this logic into the provider-specific normalize function.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make sure this is done in the pr?

// like for kleinanzeigen we have tags (includes multiple fields) but will be than extract at normalize, and deleted because its only internal used.
// I would suggest that we define a standard list like (id, price, rooms, size, title, link, description, address, image, url)
// it might be that some of this props value is null, wich is ok without id, link, title
// Also this might be not needed when using typings with typescript. I would suggest to move the whole project to typescript to have save typings.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like typescript for various reasons which would take way to long to explain here, but Fredy won't move to Typescript ;)

const keys = Object.keys(this._providerConfig.crawlFields);
// i removed it because crawlFields might be different than fields which are required.
// like for kleinanzeigen we have tags (includes multiple fields) but will be than extract at normalize, and deleted because its only internal used.
// I would suggest that we define a standard list like (id, price, rooms, size, title, link, description, address, image, url)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this, but I think what we then should do is letting each provider define their list of required params. A standard function that is available in every provider which returns an array of required keys..

// it might be that some of this props value is null, wich is ok without id, link, title
// Also this might be not needed when using typings with typescript. I would suggest to move the whole project to typescript to have save typings.
//const keys = Object.keys(this._providerConfig.crawlFields);
const keys = ['id', 'link', 'title'];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not have a fixed list in here.

@orangecoding
Copy link
Owner

@strech345 You probably want to merge Master into your branch as I have just pushed a pretty big change. (There's a new migration as well, so you must increase the number of yours)
See https://github.com/orangecoding/fredy/releases/tag/20.0.0

@strech345
Copy link
Contributor Author

Ok, will take some time this week is full 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants