jef / streetmerchant

🤖 The world's easiest, most powerful stock checker
https://jef.buzz/streetmerchant
MIT License
4.96k stars 1.31k forks source link

SHOW_ONLY_BRANDS does not work correctly #1196

Closed TDCroPower closed 2 years ago

TDCroPower commented 3 years ago

Expected Behavior

Setting the variable SHOW_ONLY_BRANDS to "sony" should filter all series for the set Brand.

Current Behavior

If the SHOW_ONLY_BRANDS variable is set to "sony", all available series are still used.

Steps to Reproduce

Test 1:

Filter "series" -> WORKS

#SHOW_ONLY_BRANDS=""
#SHOW_ONLY_MODELS=""
SHOW_ONLY_SERIES="sonyps5c,sonyps5de"

output...

STREETMERCHANT
3.1.0

[14:35:49] info :: ℹ selected stores: alternate, amazon-de, amazon-de-warehouse, amazon-es, amazon-fr, amazon-it, amazon-nl, amazon-uk, cyberport, elcorteingles, euronics-de, expert, proshop-de, saturn, spielegrotte
[14:35:49] info :: ℹ selected series: sonyps5c, sonyps5de
[14:35:56] info :: [amazon-uk] Running linksBuilder...
[14:35:56] warn :: ✖ [amazon-de-warehouse] [sony (sonyps5c)] ps5 console :: STATUS CODE ERROR 503
[14:35:57] info :: ✖ [amazon-uk] [sony (sonyps5c)] ps5 console :: OUT OF STOCK

Test 2:

Filter "brands" -> FAILED

SHOW_ONLY_BRANDS="sony"
#SHOW_ONLY_MODELS=""
#SHOW_ONLY_SERIES=""

output...

STREETMERCHANT
3.1.0

[14:38:04] info :: ℹ selected stores: alternate, amazon-de, amazon-de-warehouse, amazon-es, amazon-fr, amazon-it, amazon-nl, amazon-uk, cyberport, elcorteingles, euronics-de, expert, proshop-de, saturn, spielegrotte
[14:38:04] info :: ℹ selected brands: sony
[14:38:04] info :: ℹ selected series: 3060ti, 3070, 3080, 3090, rx6800, rx6800xt, rx6900xt, ryzen5600, ryzen5800, ryzen5900, ryzen5950, sonyps5c, sonyps5de, xboxss, xboxsx
[14:38:12] info :: [amazon-uk] Running linksBuilder...

Environment

macOS Big Sur -> 11.0.1

[user@mac:streetmerchant]$ uname -a
Darwin macbook 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64

Logs

see above!

jef commented 3 years ago

I'm not sure I see a problem?

TDCroPower commented 3 years ago

I have restructured my description a bit to make it easier to read. The problem is that it should actually display all underlying objects on the Brand filter.

In Test 1 with "SHOW_ONLY_SERIES=sonyps5c,sonyps5de" is successfully filtered on "selected series: sonyps5c, sonyps5de".

In Test 2 with "SHOW_ONLY_BRAND=Sony" only "sonyps5c, sonyps5de" should be displayed for "selected series", but all available "series" are displayed.

jef commented 3 years ago

Oh jeez, yeah, this isn't great. Let me see if I can reproduce. If so, then I'll get a fix in. Thanks for pointing this out!

TDCroPower commented 3 years ago

Perfect. You can easily implement and test the reproduction with the upper 2 variables.

neatchee commented 3 years ago

Looks like this doesn't actually impact functionality; this is just a display issue.

We still filter to only the Sony brand items (the two PS5 consoles) when actually loading pages; we just don't visually filter the series list by brand

This can probably be triaged down to lowpri

TDCroPower commented 3 years ago

@neatchee thanks you are right, it is only a display issue...

`STREETMERCHANT 3.3.0

[18:06:51] info :: ℹ selected stores: amazon-de, amazon-de-warehouse, amazon-es, amazon-fr, amazon-nl, amazon-uk, cyberport, elcorteingles, euronics-de, mediamarkt, otto, proshop-de, saturn, spielegrotte [18:06:51] info :: ℹ selected brands: sony [18:06:51] info :: ℹ selected series: 3060ti, 3070, 3080, 3090, rx6800, rx6800xt, rx6900xt, ryzen5600, ryzen5800, ryzen5900, ryzen5950, sonyps5c, sonyps5de, xboxss, xboxsx [18:07:01] info :: ✖ [elcorteingles] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:03] info :: ✖ [amazon-de-warehouse] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:05] info :: ✖ [spielegrotte] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:07] info :: ✖ [spielegrotte] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:08] info :: ✖ [amazon-de-warehouse] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:08] info :: ✖ [otto] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:09] info :: ✖ [saturn] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:09] info :: ✖ [euronics-de] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:10] info :: ✖ [elcorteingles] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:13] info :: ✖ [otto] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:17] info :: ✖ [euronics-de] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:18] info :: ✖ [amazon-es] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:18] info :: ✖ [mediamarkt] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:19] info :: ✖ [amazon-uk] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:19] info :: ✖ [spielegrotte] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:19] info :: ✖ [amazon-de-warehouse] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:21] info :: ✖ [otto] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:21] info :: ✖ [spielegrotte] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:22] info :: ✖ [amazon-fr] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:23] info :: ✖ [amazon-de] [sony (sonyps5c)] ps5 console :: OUT OF STOCK [18:07:24] info :: ✖ [saturn] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:24] info :: ✖ [amazon-de-warehouse] [sony (sonyps5de)] ps5 digital :: OUT OF STOCK [18:07:25] info :: ✖ [elcorteingles] [sony (sonyps5c)] ps5 console :: OUT OF STOCK`

scottaculous commented 3 years ago

I think the behavior is correct and working as expected because the user did explicitly select those series. It would be more confusing if the selected series didn't show up because we made selected series a cascading filter from selected brands.

jef commented 2 years ago

going to close. thanks all :)