MarvNC / vn-userscripts

VN(db) Userscripts
MIT License
7 stars 0 forks source link

[Feature request] VNDB Official Links and Release Dates - Add digital shop links and platform icon list #2

Open enchained opened 1 year ago

enchained commented 1 year ago

Currently the only links included are ones that marked as "Official website". But to find a Steam link for example, you have to search closely through the releases. I recently discovered a nice script that adds VNDB links to Steam, but nothing to do the reverse yet.

I think it could be very useful to add a Digital Shops section to the main infobox, with existing links to digital downloads like Steam, Nintendo, PlayStation Store, App Store, Google Play (a full list of store names is available in the edit form of any release).

This way we can know at a glance whether we can purchase the title digitally for our preferred platform. It could be similar to the existing Shops section with PlayAsia etc, but in format "Edition name @ Store name (demo/trial indicator)". Icons (store website favicons like https://www.google.com/s2/favicons?sz=12&domain=steampowered.com) could be added too. And you'll have to differ demos from free games (maybe a word check by Demo/Trial), and only process the release rows that contain the Internet download icon.

Not sure if necessary, but prices could be added for Steam platform using this public API. Don't know about other platforms.

It would also be useful to add SteamDB links (usually found next to the Steam links) to the main Links list (the one which usually includes VNStat, IGDB, HowLongToBeat, etc).

And another idea - you could collect unique platform icons from the release rows, and add them as a new Platforms section to the main infobox. And there could be an indication (red border?) for titles with future/TBA release dates, when the port is not out yet.

Also, thank you for the userscripts!

MarvNC commented 1 year ago

Adding other external links shouldn't be too hard. Things like steamDB, EGS, and retail links aren't differentiated though so I think I'll probably just add an "other link" section, then maybe add steam price fetching later and maybe differentiate them manually into "Links" and "Shops" later.

Platform release dates does seem like a good quality of life improvement, will have to think about how they'd be presented with possibly differing languages though I can't guarantee I'll have time to work on it.

Also the script just ignores all demos/unofficial releases/MTL right now, probably will just keep it like that.

Thanks for the feedback!

MarvNC commented 1 year ago

Added the other links in kind of a messy way for now, will probably think about making them look less dumb later. Probably will work on platform release dates first, if I do. chrome_蒼の彼方のフォーリズム__vndb_-_Google_Chrome_2023-02-28_19-20-24

enchained commented 1 year ago

Thanks a lot! I tested it a bit, it is a good start.

A few thoughts:

You can collect visible links from Shops section of the main infobox (PlayAsia etc) to an array, and then exclude them from the Other Links, so there won't be any duplicates.

You can check if any languages in release tables are collapsed by default, which means user configured to hide them, and they could be put at the bottom of the Other Links list, or even skipped over completely. I think the same probably can be applied to the Official links, maybe even adding a collapse arrow too.

You can get full list of supported links here https://api.vndb.org/kana/schema - under extlinks, but looks like they can often change. Sadly there are no indicators for a global platform store vs publisher store, so if you want to give platform stores a priority, manual list will need to be constructed from those. Adding favicons of platform stores will also help with visibility of specific links.

As for the platforms, I meant a simple separate platforms listing, like a row of platform icons, added above the whole Release dates block. Adding platforms for release dates is a more complex task, but this could be even more useful in the future.

MarvNC commented 1 year ago

Added favicons for all links and skipped over collapsed languages, open to changing how it looks as it could be a bit messy (I know they're broken for sites that don't have a /favicon.ico, not going to bother for now). I figure it's enough to be able to easily narrow down the link you want.

For platforms listing, I added them by language. Unofficial patches can expand platform support so I included those, but unofficial ones will be grayscale and have that specified in the mouseover.

chrome_蒼の彼方のフォーリズム__vndb_-_Google_Chrome_2023-03-01_16-25-09

enchained commented 1 year ago

Thanks. It's already much easier to find specific links, but I have some ideas for the future to make it look more neat - you could group (and even collapse) multiple links by the same edition name (links with no special edition specified could go first), and maybe even remove the game title from the edition names at all to reduce the clutter (but it looks like that might require checking for all possible titles from Titles and Aliases block).

Looks like some language flags are shrinking for Other Links, flex-shrink: 0; style could be added to the abbr elements.

For the broken favicons a quick fix would be making alt="" (and also flex-shrink: 0; so it would be aligned to the rest), and later some default icon could be added via onerror or something.

For platforms listing, I added them by language. Unofficial patches can expand platform support so I included those, but unofficial ones will be grayscale and have that specified in the mouseover.

Thanks, grayscale is a nice touch. Looks like the platforms are currently skipped for TBA and incomplete releases? Adding some whitespace and "Upcoming:" text or some in-progress icon (like ⏳ or 🚧) with platforms listed after it could indicate upcoming support (currently some language rows in platforms are displayed while being empty cause all releases there incomplete or TBA).

MarvNC commented 1 year ago

Thanks for the all the feedback!

you could group (and even collapse) multiple links by the same edition name

That could make sense on pages where there are a ton of links, but I think for most vns there will be fewer than five other links. The code is bad enough right now that I'd want to rewrite the script first before trying that😂

remove the game title from the edition names

Great idea! I'll definitely do this when I can.

Looks like some language flags are shrinking For the broken favicons

Didn't catch the shrinking issue, thanks for the CSS advice. I glossed over the google favicon converter you originally linked, I'll try that, thanks 🙏

Looks like the platforms are currently skipped for TBA and incomplete releases?

Yep

Adding some whitespace and "Upcoming:" text or some in-progress icon (like ⏳ or 🚧) with platforms listed after it

Good idea, I'll probably try to implement these things to show the status of TBA releases soon. Then price fetching after that.

MarvNC commented 1 year ago

Did all of those things and added price fetching for a few stores, let me know if you have any feedback!

enchained commented 1 year ago

Thank you! I'll try to test more in the future, but for now a few things I noticed:

Thank you so much, you did a pretty good job!

MarvNC commented 1 year ago

If the same store link appears in multiple languages

I coded myself into a corner with bad code, I'll rewrite it and support multiple flags probably next week when exams are over 😅

Looks like $ is always added to the Steam prices?

Yeah, hardcoded that. Changed it and made it return the final_formatted value, but added the price in USD as well next to it if the currency isn't USD. Couldn't test it though since it seems the API blocks VPNs.

Not all info icons inside the links are obvious to me (like the red X), having a text tooltip would be appreciated.

Good point, added tooltips.

listing known domains in the @connect

I tried adding them manually but gave up and just added @connect * so you can whitelist all domains.

domain multiselect

Good idea, will probably maybe do it after I rewrite. #8

thanks for an example of how to do script settings with UI

Glad it helped! I just used the GM_config library, lol.

edit: just noticed I didn't commit the changes... lol, updated now.