Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-13913: Add SteamDB to the other databases whitelist #3460

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/MusicBrainz/Server/Data/URL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ my %URL_SPECIALIZATIONS = (
'SpiritOfMetal' => qr{^https?://(?:www\.)?spirit-of-metal\.com/}i,
'SpiritOfRock' => qr{^https?://(?:www\.)?spirit-of-rock\.com/}i,
'Stage48' => qr{^https?://(?:www\.)?stage48\.net/}i,
'SteamDB' => qr{^https?://([^/]+\.)?steamdb\.info/}i,
'Target' => qr{^https?://(?:(?:intl|www)\.)?target\.com/}i,
'Theatricalia' => qr{^https?://(?:www\.)?theatricalia\.com/}i,
'TheDanceGypsy' => qr{^https?://(?:www\.)?thedancegypsy\.com/}i,
Expand Down
22 changes: 22 additions & 0 deletions lib/MusicBrainz/Server/Entity/URL/SteamDB.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package MusicBrainz::Server::Entity::URL::SteamDB;

use Moose;

extends 'MusicBrainz::Server::Entity::URL';
with 'MusicBrainz::Server::Entity::URL::Sidebar';

sub sidebar_name { 'SteamDB' }

__PACKAGE__->meta->make_immutable;
no Moose;
1;

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2025 MetaBrainz Foundation

This file is part of MusicBrainz, the open internet music database,
and is licensed under the GPL version 2, or (at your option) any
later version: http://www.gnu.org/licenses/gpl-2.0.txt

=cut
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions root/static/scripts/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export const FAVICON_CLASSES: {
'spirit-of-rock.com': 'spiritofrock',
'spotify.com': 'spotify',
'stage48.net': 'stage48',
'steamdb.info': 'steamdb',
'target.com': 'target',
'tedcrane.com/DanceDB': 'dancedb',
'theatricalia.com': 'theatricalia',
Expand Down
17 changes: 17 additions & 0 deletions root/static/scripts/edit/URLCleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5448,6 +5448,23 @@ const CLEANUPS: CleanupEntries = {
};
},
},
'steamdb': {
match: [/^(https?:\/\/)?(www\.)?steamdb\.info\//i],
restrict: [LINK_TYPES.otherdatabases],
clean(url) {
return url.replace(/^(?:https?:\/\/)?(?:www\.)?steamdb\.info\/app\/(\d+).*$/, 'https://steamdb.info/app/$1/');
},
validate(url, id) {
switch (id) {
case LINK_TYPES.otherdatabases.release:
return {
result: /^https:\/\/steamdb\.info\/app\/\d+\/$/.test(url),
target: ERROR_TARGETS.URL,
};
}
return {result: false, target: ERROR_TARGETS.ENTITY};
},
},
'target': {
match: [/^(https?:\/\/)?((intl|www)\.)?target\.com\/(b|p)/i],
restrict: [LINK_TYPES.mailorder],
Expand Down
8 changes: 8 additions & 0 deletions root/static/scripts/tests/Control/URLCleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5663,6 +5663,14 @@ limited_link_type_combinations: ['downloadpurchase', 'mailorder'],
target: 'url',
},
},
// SteamDB
{
input_url: 'http://www.steamdb.info/app/331230/info/',
input_entity_type: 'release',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://steamdb.info/app/331230/',
only_valid_entity_types: ['release'],
},
// Target
{
input_url: 'https://www.target.com/b/universal-music-group/-/N-l4bvw',
Expand Down
1 change: 1 addition & 0 deletions root/static/styles/favicons.less
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
.favicon("spiritofrock");
.favicon("spotify", 32);
.favicon("stage48");
.favicon("steamdb", 32);
.favicon("target", 32);
.favicon("theatricalia");
.favicon("thedancegypsy");
Expand Down