Implement new release schedule for backgrounds

This commit is contained in:
Phillip Thelen
2024-01-31 17:33:10 +01:00
committed by Sabe Jones
parent 278d9b74f9
commit 17db6a1772
4 changed files with 44 additions and 28 deletions

View File

@@ -17,6 +17,7 @@ import featuredItems from '../content/shop-featuredItems';
import getOfficialPinnedItems from './getOfficialPinnedItems';
import { getClassName } from './getClassName';
import { assembleScheduledMatchers } from '../content/constants/schedule';
const shops = {};
@@ -529,15 +530,18 @@ shops.getBackgroundShopSets = function getBackgroundShopSets (language) {
const sets = [];
const officialPinnedItems = getOfficialPinnedItems();
const matchers = assembleScheduledMatchers(new Date()).filter(matcher => matcher.type === 'backgrounds').map(matcher => matcher.matcher);
eachRight(content.backgrounds, (group, key) => {
const set = {
identifier: key,
text: i18n.t(key, language),
};
if (matchers.map(matcher => matcher(key)).every(matcher => matcher === true)) {
const set = {
identifier: key,
text: i18n.t(key, language),
};
set.items = map(group, background => getItemInfo(null, 'background', background, officialPinnedItems, language));
set.items = map(group, background => getItemInfo(null, 'background', background, officialPinnedItems, language));
sets.push(set);
sets.push(set);
}
});
return sets;