diff options
author | Yorhel <git@yorhel.nl> | 2021-12-06 15:03:32 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-12-06 15:03:32 +0100 |
commit | a6383ccdbf640436114f238d10fe68315efece1a (patch) | |
tree | 6afebda1bb6d049c98c862b5e0f66b9ca9e84243 | |
parent | 926ff4cc553fbe6b15a08c089939846bdd88dd5b (diff) |
ExtLinks: Add PlayStation stores
-rw-r--r-- | lib/VNDB/ExtLinks.pm | 15 | ||||
-rw-r--r-- | sql/schema.sql | 15 | ||||
-rw-r--r-- | util/updates/2021-12-06-extlinks-playstation-stores.sql | 13 |
3 files changed, 40 insertions, 3 deletions
diff --git a/lib/VNDB/ExtLinks.pm b/lib/VNDB/ExtLinks.pm index 2c7b8497..e9be887a 100644 --- a/lib/VNDB/ExtLinks.pm +++ b/lib/VNDB/ExtLinks.pm @@ -48,6 +48,9 @@ our %WIKIDATA = ( soundcloud => { type => 'text[]', property => 'P3040', label => 'Soundcloud', fmt => 'https://soundcloud.com/%s' }, humblestore => { type => 'text[]', property => 'P4477', label => undef, fmt => undef }, itchio => { type => 'text[]', property => 'P7294', label => undef, fmt => undef }, + playstation_jp => { type => 'text[]', property => 'P5999', label => undef, fmt => undef }, + playstation_na => { type => 'text[]', property => 'P5944', label => undef, fmt => undef }, + playstation_eu => { type => 'text[]', property => 'P5971', label => undef, fmt => undef }, ); @@ -167,6 +170,15 @@ our %LINKS = ( l_nutaku => { label => 'Nutaku' , fmt => 'https://www.nutaku.net/games/%s/' , regex => qr{(?:www\.)?nutaku\.net/games/(?:mobile/|download/|app/)?([a-z0-9-]+)/?} }, # The section part does sometimes link to different pages, but it's the same game and the non-section link always works. + l_playstation_jp => { label => 'PlayStation Store (JP)' + , fmt => 'https://store.playstation.com/ja-jp/product/%s' + , regex => qr{store\.playstation\.com/(?:[-a-z]+\/)?product\/(JP\d{4}-[A-Z]{4}\d{5}_00-[\dA-Z_]{16})} }, + l_playstation_na => { label => 'PlayStation Store (NA)' + , fmt => 'https://store.playstation.com/en-us/product/%s' + , regex => qr{store\.playstation\.com/(?:[-a-z]+\/)?product\/(UP\d{4}-[A-Z]{4}\d{5}_00-[\dA-Z_]{16})} }, + l_playstation_eu => { label => 'PlayStation Store (EU)' + , fmt => 'https://store.playstation.com/en-gb/product/%s' + , regex => qr{store\.playstation\.com/(?:[-a-z]+\/)?product\/(EP\d{4}-[A-Z]{4}\d{5}_00-[\dA-Z_]{16})} }, # deprecated l_dlsiteen => { label => 'DLsite (eng)', fmt => 'https://www.dlsite.com/eng/work/=/product_id/%s.html' }, }, @@ -300,6 +312,9 @@ sub enrich_extlinks { l 'l_getchudl'; l 'l_dmm'; l 'l_toranoana'; + l 'l_playstation_jp'; + l 'l_playstation_na'; + l 'l_playstation_eu'; push @links, map [ 'PlayAsia', $_->{url}, $_->{price} ], @{$obj->{l_playasia}} if $obj->{l_playasia}; } diff --git a/sql/schema.sql b/sql/schema.sql index c80b3e53..dd2c5201 100644 --- a/sql/schema.sql +++ b/sql/schema.sql @@ -406,7 +406,10 @@ CREATE TABLE releases ( -- dbentry_type=r l_gyutto integer[] NOT NULL DEFAULT '{}', -- [pub] l_dmm text[] NOT NULL DEFAULT '{}', -- [pub] l_freegame text NOT NULL DEFAULT '', -- [pub] - c_search text NOT NULL GENERATED ALWAYS AS (public.search_gen(ARRAY[title, original])) STORED + c_search text NOT NULL GENERATED ALWAYS AS (public.search_gen(ARRAY[title, original])) STORED, + l_playstation_jp text NOT NULL DEFAULT '', -- [pub] + l_playstation_na text NOT NULL DEFAULT '', -- [pub] + l_playstation_eu text NOT NULL DEFAULT '' -- [pub] ); -- releases_hist @@ -458,7 +461,10 @@ CREATE TABLE releases_hist ( l_fakku text NOT NULL DEFAULT '', l_gyutto integer[] NOT NULL DEFAULT '{}', l_dmm text[] NOT NULL DEFAULT '{}', - l_freegame text NOT NULL DEFAULT '' + l_freegame text NOT NULL DEFAULT '', + l_playstation_jp text NOT NULL DEFAULT '', + l_playstation_na text NOT NULL DEFAULT '', + l_playstation_eu text NOT NULL DEFAULT '' ); -- releases_lang @@ -1221,5 +1227,8 @@ CREATE TABLE wikidata ( doujinshi_author integer[], -- [pub] P7511 soundcloud text[], -- [pub] P3040 humblestore text[], -- [pub] P4477 - itchio text[] -- [pub] P7294 + itchio text[], -- [pub] P7294 + playstation_jp text[], -- [pub] P5999 + playstation_na text[], -- [pub] P5944 + playstation_eu text[] -- [pub] P5971 ); diff --git a/util/updates/2021-12-06-extlinks-playstation-stores.sql b/util/updates/2021-12-06-extlinks-playstation-stores.sql new file mode 100644 index 00000000..648fb74d --- /dev/null +++ b/util/updates/2021-12-06-extlinks-playstation-stores.sql @@ -0,0 +1,13 @@ +ALTER TABLE releases + ADD COLUMN l_playstation_jp text NOT NULL DEFAULT '', + ADD COLUMN l_playstation_na text NOT NULL DEFAULT '', + ADD COLUMN l_playstation_eu text NOT NULL DEFAULT ''; +ALTER TABLE releases_hist + ADD COLUMN l_playstation_jp text NOT NULL DEFAULT '', + ADD COLUMN l_playstation_na text NOT NULL DEFAULT '', + ADD COLUMN l_playstation_eu text NOT NULL DEFAULT ''; +ALTER TABLE wikidata + ADD COLUMN playstation_jp text[], + ADD COLUMN playstation_na text[], + ADD COLUMN playstation_eu text[]; +\i sql/editfunc.sql |