Skip to content

Commit

Permalink
Fixes #1155: Remove Opencritic
Browse files Browse the repository at this point in the history
  • Loading branch information
Agreon committed Nov 14, 2024
1 parent 56a5fa7 commit 9704068
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 266 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ Receive updates of game release dates, prices and news
- Nintendo Store
- ProtonDB
- Metacritic
- OpenCritic
- (E-Mail) Notifications for
- Price reduction
- Release date change
- Release of game
- Game left Early Access
- Addition to a store
- Addition of Metacritic rating
- Addition of OpenCritic rating
- Addition of ProtonDB rating
- Improvement of ProtonDB rating

Expand Down
4 changes: 0 additions & 4 deletions client/components/InfoSource/InfoSource.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
InfoSourceType,
MetacriticData,
OpenCriticData,
PlaystationGameData,
ProtonGameData,
StoreGameData,
Expand All @@ -10,7 +9,6 @@ import React from 'react';

import { useInfoSourceContext } from '../../providers/InfoSourceProvider';
import { MetacriticInfoSource } from './MetacriticInfoSource';
import { OpenCriticInfoSource } from './OpenCriticInfoSource';
import { PlaystationInfoSource } from './PlaystationInfoSource';
import { ProtonDbInfoSource } from './ProtonDbInfoSource';
import { StoreInfoSource } from './StoreInfoSource';
Expand All @@ -28,8 +26,6 @@ export const InfoSource: React.FC = () => {
return <PlaystationInfoSource data={source.data as PlaystationGameData} country={source.country} />;
case InfoSourceType.Metacritic:
return <MetacriticInfoSource data={source.data as MetacriticData} />;
case InfoSourceType.OpenCritic:
return <OpenCriticInfoSource data={source.data as OpenCriticData} />;
case InfoSourceType.Proton:
return <ProtonDbInfoSource data={source.data as ProtonGameData} />;
}
Expand Down
61 changes: 0 additions & 61 deletions client/components/InfoSource/OpenCriticInfoSource.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions client/components/InfoSource/SourceTypeLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import React from 'react';

import epicLogo from '../../assets/epic';
import metacriticLogo from '../../assets/metacritic.svg';
import opencriticLogo from '../../assets/opencritic.png';
import psLogo from '../../assets/playstation.svg';
import protonLogo from '../../assets/protondb.svg';
import steamLogo from '../../assets/steam.svg';
Expand Down Expand Up @@ -99,25 +98,6 @@ export const SourceTypeLogoWithName: Record<InfoSourceType, React.ReactElement>
</Text>
</Flex>
),
[InfoSourceType.OpenCritic]: (
<Flex align="center" pl="0.25rem" pr="0.5rem">
<Box position="relative" width={30} height={30}>
<Box position="absolute" width="27px" height="27px" top="1.25px" left="1.25px">
<Image
alt="source-icon"
priority={true}
src={opencriticLogo}
quality={100}
height={27}
width={27}
/>
</Box>
</Box>
<Text fontWeight="bold" ml="0.25rem">
{InfoSourceTypeNames[InfoSourceType.OpenCritic]}
</Text>
</Flex>
),
[InfoSourceType.Proton]: (
<Flex align="center" pl="0.25rem" pr="0.5rem">
<Box position="relative" width={30} height={30}>
Expand Down Expand Up @@ -189,14 +169,6 @@ export const SourceTypeLogo: Record<InfoSourceType, React.ReactElement> = {
</Text>
</Flex>
),
[InfoSourceType.OpenCritic]: (
<Flex align="center">
<Image alt="openCritic" priority={true} src={opencriticLogo} quality={100} height={30} width={30} />
<Text fontWeight="bold" ml="0.25rem">
{InfoSourceTypeNames[InfoSourceType.OpenCritic]}
</Text>
</Flex>
),
[InfoSourceType.Proton]: (
<Flex align="end">
<Image alt="source-icon" priority={true} src={protonLogo} quality={100} height={30} width={30} />
Expand Down Expand Up @@ -238,11 +210,6 @@ export const SourceTypeLogoSmall: Record<InfoSourceType, React.ReactElement> = {
<Image alt="metacritic" priority={true} src={metacriticLogo} quality={100} height={20} width={20} />
</Flex>
),
[InfoSourceType.OpenCritic]: (
<Flex align="start">
<Image alt="opencritic" priority={true} src={opencriticLogo} quality={100} height={20} width={20} />
</Flex>
),
[InfoSourceType.Proton]: (
<Flex align="start" mt="-0.2rem">
<Image alt="source-icon" priority={true} src={protonLogo} quality={100} height={20} width={20} />
Expand Down
3 changes: 0 additions & 3 deletions client/components/Notifications/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const NotificationTypeNames: Record<NotificationType, string> = {
[NotificationType.GameReduced]: 'Game reduced',
[NotificationType.NewMetacriticRating]: 'Game rated',
[NotificationType.NewMetacriticUserRating]: 'Game rated',
[NotificationType.NewOpenCriticRating]: 'Game rated',
[NotificationType.NewProtonDbRating]: 'Game rated',
[NotificationType.ProtonDbRatingIncreased]: 'Rating increased',
[NotificationType.LeftEarlyAccess]: 'Game left Early Access',
Expand Down Expand Up @@ -65,8 +64,6 @@ const getNotificationText = (notification: NotificationDto) => {
return <>{infoSourceName} received a rating!</>;
case NotificationType.NewMetacriticUserRating:
return <>{infoSourceName} received a user rating!</>;
case NotificationType.NewOpenCriticRating:
return <>{infoSourceName} received a rating!</>;
case NotificationType.NewProtonDbRating:
return <>{infoSourceName} received a rating!</>;
case NotificationType.ProtonDbRatingIncreased:
Expand Down
1 change: 0 additions & 1 deletion client/providers/GameProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const INFO_SOURCE_PRIORITY = [
InfoSourceType.Epic,
InfoSourceType.Xbox,
InfoSourceType.Metacritic,
InfoSourceType.OpenCritic,
InfoSourceType.Proton
];

Expand Down
2 changes: 0 additions & 2 deletions client/util/source-url-placeholder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export const SourceUrlPlaceholder = (sourceType: InfoSourceType, userCountry: Co
return 'https://store.steampowered.com/app/...';
case InfoSourceType.Metacritic:
return 'https://www.metacritic.com/game/pc/...';
case InfoSourceType.OpenCritic:
return 'https://opencritic.com/game/...';
case InfoSourceType.Proton:
return 'https://www.protondb.com/app/...';
case InfoSourceType.Switch:
Expand Down
38 changes: 38 additions & 0 deletions lib/database/src/migrations/Migration20240906064651.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Migration } from '@mikro-orm/migrations';

export class Migration20240906064651 extends Migration {
async up(): Promise<void> {
this.addSql('alter table "info_source" drop constraint if exists "info_source_type_check"');
this.addSql('alter table "info_source" alter column "type" type text using ("type"::text)');
this.addSql(`
alter table "info_source"
add constraint "info_source_type_check" check ("type" in (
'steam',
'switch',
'playstation',
'epic',
'metacritic',
'proton'
))
`);

this.addSql('alter table "notification" drop constraint if exists "notification_type_check"');
this.addSql('alter table "notification" alter column "type" type text using ("type"::text)');
this.addSql(`
alter table "notification"
add constraint "notification_type_check" check ("type" in (
'new-store-entry',
'release-date-changed',
'game-released',
'game-reduced',
'new-metacritic-rating',
'new-metacritic-user-rating',
'new-proton-db-rating',
'proton-db-rating-increased',
'left-early-access',
'added-to-ps-plus',
'resolve-error'
))
`);
}
}
2 changes: 2 additions & 0 deletions lib/database/src/mikro-orm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { Migration20231006064639 } from './migrations/Migration20231006064639';
import { Migration20231020064650 } from './migrations/Migration20231020064650';
import { Migration20231120064650 } from './migrations/Migration20231120064650';
import { Migration20240906064650 } from './migrations/Migration20240906064650';
import { Migration20240906064651 } from './migrations/Migration20240906064651';
import { Game } from './models/game-model';
import { InfoSource } from './models/info-source-model';
import { Notification } from './models/notification-model';
Expand Down Expand Up @@ -103,6 +104,7 @@ const config: MikroOrmModuleSyncOptions = {
{ name: 'Migration20231020064650.ts', class: Migration20231020064650 },
{ name: 'Migration20231120064650.ts', class: Migration20231120064650 },
{ name: 'Migration20240906064650.ts', class: Migration20240906064650 },
{ name: 'Migration20240906064651.ts', class: Migration20240906064651 },
]
}
};
Expand Down
12 changes: 0 additions & 12 deletions lib/shared/src/types/info-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export enum InfoSourceType {
Xbox = 'xbox',
Epic = 'epic',
Metacritic = 'metacritic',
OpenCritic = 'opencritic',
Proton = 'proton'
}
export type StoreInfoSource =
Expand Down Expand Up @@ -69,13 +68,6 @@ export interface MetacriticData extends BaseGameData {
userScore: string;
}

export type OpenCriticRating = 'mighty' | 'strong' | 'fair' | 'weak';
export interface OpenCriticData extends BaseGameData {
rating: OpenCriticRating;
criticScore: number;
recommendedBy: number;
}

export type ProtonDbScore = 'native' | 'platinum' | 'gold' | 'silver' | 'bronze' | 'borked';

export type DeckVerified = 'verified' | 'playable' | 'unsupported' | 'unknown';
Expand All @@ -93,19 +85,16 @@ export type GameData = {
[InfoSourceType.Xbox]: StoreGameData;
[InfoSourceType.Epic]: StoreGameData;
[InfoSourceType.Metacritic]: MetacriticData;
[InfoSourceType.OpenCritic]: OpenCriticData;
[InfoSourceType.Proton]: ProtonGameData;
};
export type AnyGameData =
| StoreGameData
| MetacriticData
| OpenCriticData
| ProtonGameData;

export const SupportedCountries: Record<InfoSourceType, readonly Country[]> = {
[InfoSourceType.Steam]: Countries,
[InfoSourceType.Metacritic]: Countries,
[InfoSourceType.OpenCritic]: Countries,
[InfoSourceType.Proton]: Countries,
[InfoSourceType.Switch]: Countries.filter(country => country !== 'RU' && country !== 'US'),
[InfoSourceType.Playstation]: Countries.filter(country => country !== 'RU'),
Expand All @@ -120,6 +109,5 @@ export const InfoSourceTypeNames: Record<InfoSourceType, string> = {
[InfoSourceType.Xbox]: 'Xbox',
[InfoSourceType.Epic]: 'Epic',
[InfoSourceType.Metacritic]: 'Metacritic',
[InfoSourceType.OpenCritic]: 'OpenCritic',
[InfoSourceType.Proton]: 'ProtonDB',
};
2 changes: 0 additions & 2 deletions lib/shared/src/types/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export enum NotificationType {
GameReduced = 'game-reduced',
NewMetacriticRating = 'new-metacritic-rating',
NewMetacriticUserRating = 'new-metacritic-user-rating',
NewOpenCriticRating = 'new-opencritic-rating',
NewProtonDbRating = 'new-proton-db-rating',
ProtonDbRatingIncreased = 'proton-db-rating-increased',
LeftEarlyAccess = 'left-early-access',
Expand All @@ -29,7 +28,6 @@ export type NotificationData = {
[NotificationType.GameReduced]: StorePriceInformation,
[NotificationType.NewMetacriticRating]: { criticScore: string, userScore: string },
[NotificationType.NewMetacriticUserRating]: { criticScore: string, userScore: string },
[NotificationType.NewOpenCriticRating]: { criticScore: number, recommendedBy: number },
[NotificationType.NewProtonDbRating]: { score: string },
[NotificationType.ProtonDbRatingIncreased]: { score: string },
[NotificationType.LeftEarlyAccess]: Record<string, never>,
Expand Down
4 changes: 0 additions & 4 deletions notifier/src/mail-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export class MailService {
return `${infoSourceName} received a Metacritic rating`;
case NotificationType.NewMetacriticUserRating:
return `${infoSourceName} received a Metacritic user rating`;
case NotificationType.NewOpenCriticRating:
return `${infoSourceName} received a OpenCritic rating`;
case NotificationType.NewProtonDbRating:
return `${infoSourceName} received a Proton DB rating`;
case NotificationType.ProtonDbRatingIncreased:
Expand Down Expand Up @@ -117,8 +115,6 @@ ${unsubscribeLink}
return `${infoSourceName} received a Metacritic rating.`;
case NotificationType.NewMetacriticUserRating:
return `${infoSourceName} received a Metacritic user rating`;
case NotificationType.NewOpenCriticRating:
return `${infoSourceName} received a OpenCritic rating.`;
case NotificationType.NewProtonDbRating:
return `${infoSourceName} received a Proton DB rating.`;
case NotificationType.ProtonDbRatingIncreased:
Expand Down
2 changes: 0 additions & 2 deletions notifier/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
import {
NewMetacriticUserRatingNotificationCreator
} from './notifiers/new-metacritic-user-rating-notification-creator';
import { NewOpenCriticRatingNotificationCreator } from './notifiers/new-opencritic-rating-notification-creator';
import {
NewProtonDbRatingNotificationCreator
} from './notifiers/new-proton-db-rating-notification-creator';
Expand Down Expand Up @@ -56,7 +55,6 @@ const notificationCreators = [
new GameReleasedNotificationCreator(),
new NewMetacriticRatingNotificationCreator(),
new NewMetacriticUserRatingNotificationCreator(),
new NewOpenCriticRatingNotificationCreator(),
new NewProtonDbRatingNotificationCreator(),
new ProtonDbRatingIncreasedNotificationCreator(),
new NewStoreEntryNotificationCreator(),
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions resolver/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { EnvironmentStructure } from './environment';
import { CriticalError, ResolveService } from './resolve-service';
import { EpicResolver } from './resolvers/epic-resolver';
import { MetacriticResolver } from './resolvers/metacritic-resolver';
import { OpenCriticResolver } from './resolvers/opencritic-resolver';
import { PlaystationResolver } from './resolvers/playstation-resolver';
import { ProtonResolver } from './resolvers/proton-resolver';
import { SteamResolver } from './resolvers/steam-resolver';
Expand Down Expand Up @@ -70,7 +69,6 @@ const resolvers = [
new XboxResolver(axiosInstance),
new EpicResolver(),
new MetacriticResolver(axiosInstance),
new OpenCriticResolver(axiosInstance),
new ProtonResolver(axiosInstance),
];

Expand Down
Loading

0 comments on commit 9704068

Please sign in to comment.