|
|
@@ -167,14 +167,8 @@ const updateGamesList = (({ platform, mk, games } = {}) => {
|
|
|
return reject(new Error('PLATFORM_GAMES_INVALID'));
|
|
|
}
|
|
|
|
|
|
- const marketType = getMarketType(mk);
|
|
|
-
|
|
|
syncGamesList({ platform, mk, games });
|
|
|
|
|
|
- if (platform == 'ps') {
|
|
|
- syncBaseList({ marketType, games });
|
|
|
- }
|
|
|
-
|
|
|
resolve();
|
|
|
});
|
|
|
});
|
|
|
@@ -482,6 +476,22 @@ const updateGamesRelation = () => {
|
|
|
fetchGamesRelation()
|
|
|
.then(gamesRelation => {
|
|
|
|
|
|
+ const baseList = {};
|
|
|
+ gamesRelation.map(item => {
|
|
|
+ const baseGame = item.rel?.['ps'] ?? {};
|
|
|
+ return { ...baseGame };
|
|
|
+ }).forEach(item => {
|
|
|
+ const marketType = getMarketType(item.mk);
|
|
|
+ if (!baseList[marketType]) {
|
|
|
+ baseList[marketType] = [];
|
|
|
+ }
|
|
|
+ baseList[marketType].push(item);
|
|
|
+ });
|
|
|
+
|
|
|
+ Object.keys(baseList).forEach(marketType => {
|
|
|
+ syncBaseList({ marketType, games: baseList[marketType] });
|
|
|
+ });
|
|
|
+
|
|
|
const updateCount = {
|
|
|
add: 0,
|
|
|
update: 0,
|