Altansar69 / CS.RIN.RU-Enhanced-external

The Unlicense
39 stars 3 forks source link

Bug . #5

Closed DogancanYr closed 8 months ago

DogancanYr commented 8 months ago

Cs.rin.ru also exists and steamdb shows it correctly, but steam does not.

https://steamdb.info/app/601360/charts https://store.steampowered.com/app/601360/Portal_Revolution/?curator_clanid=4777282

Altansar69 commented 8 months ago

Indeed, on Steam, the game is detected as DLC, since it's basically a "mod". The script therefore does not execute correctly

Altansar69 commented 8 months ago

So we need to find a better way of detecting whether it's a game or DLC. I tried this: const pageUrl = !document.querySelector("#game_highlights > div.rightcol.as-side-details > div > div.glance_details") ? document.location.pathname // Game page : document.querySelector("#game_highlights > div.rightcol.as-side-details > div > div.glance_details > p > a").getAttribute("href"); // DLC Page

    It works perfectly in the browser console. But not in the script. In fact, the part I'm looking at to see if it's DLC seems to load on the Steam page a little after the script executes this line.
Altansar69 commented 8 months ago

Well done on your find, by the way

Reddiepoint commented 8 months ago

I did some investigating into this issue. Turns out that the problem is not that the page is a mod page, but that the game ID is not a good ID to search (searching for 620 leads to many, many results).

Currently the script searches https://cs.rin.ru/forum/search.php?keywords=620&fid%5B%5D=10&sr=topics&sf=firstpost first. Since there are too many results (267 posts as of this comment), it looks for https://cs.rin.ru/forum/search.php?keywords=620+P2%3ACE%20Team&fid%5B%5D=10&sr=topics&sf=firstpost next, and chooses the first result in the list (which happens to be KarmaZoo).

Our current solution for finding the topic for a game with a commonly used ID is not that great and is prone to breaking in cases like this. The main disadvantage of our current solution is that searching for the developer doesn't work all the time. In this case, the developer P2:CE Team doesn't help to narrow down the number of topics that well because P2 and CE are ignored (because they are too short), so the actual search terms would be 620 Team. Our current solution is also flawed because the developer of the mod is often not the developer of the base game, so when the more detailed search is performed, no results are returned. For example, this mod for Portal 2 doesn't return any results because the ID is searched in conjunction with Odd Time Studios instead of the correct developer Valve.

Altansar69 commented 8 months ago

But that's the problem! The right id is not 620. The case of mods is not foreseen, the script believes that it is a DLC and so instead of taking its id which is 601360 it does as for DLC i.e. take the ID of its parent which is 620 (the id of portal 2 games). That's why there's an error only on Steam and not on SteamDB, because on SteamDB the appid retrieved from the page is the right one, but not on Steam, where our selector didn't take this particular case into account. As you said, the search id is 620, which is precisely wrong.

Translated with www.DeepL.com/Translator (free version)

Reddiepoint commented 8 months ago

Oh, I thought that mods were basically the same as just DLC.

SubZeroPL commented 8 months ago

Maybe we could use the Steam/SteamDB page url to search for rin topic? The url should be present in the first post of each game topic (see FAQ Question E01 or here).

Altansar69 commented 8 months ago

We thought of this @SubZeroPL, the problem is that the / in the url breaks the search and there's no way to fix it (I've asked Ressourector), which is why we only use the appid

Reddiepoint commented 8 months ago

In practice, the only part that really helps is the actual ID of the game, since the initial part of the Steam URL will end up matching almost every post in the main forum.

(What Altansar said ^)

Altansar69 commented 8 months ago

haha in same time

Altansar69 commented 8 months ago

I've already found a solution for the mods, honestly. It's just that I was a bit lazy to do it and I've got my exam tomorrow. If none of you have corrected the problem I'll do it this weekend.

Reddiepoint commented 8 months ago

Me too 😅 Looks like we are too synchronised in thought!

Altansar69 commented 8 months ago

Redpoint

Altansar69 commented 8 months ago

Gj

Altansar69 commented 8 months ago

I hadn't seen that the "div.game_area_bubble.game_area_dlc_bubble" class existed. The only solution I found was to search in this rectangle, and if it contained this href: https://store.steampowered.com/about/communitymods/?snr=1_5_9_ then that meant we were on a mod (all mods contain this href on line 2)

Reddiepoint commented 8 months ago

Good luck with your exam!