Fixed ratings loading in the preferences
This commit is contained in:
@@ -410,7 +410,7 @@ function LoadGamePlatforms() {
|
|||||||
let platformContainer = document.getElementById('gamesummaryplatformscontent');
|
let platformContainer = document.getElementById('gamesummaryplatformscontent');
|
||||||
platformContainer.innerHTML = '';
|
platformContainer.innerHTML = '';
|
||||||
for (let i = 0; i < result.length; i++) {
|
for (let i = 0; i < result.length; i++) {
|
||||||
let logoUrl = '/api/v1/Platforms/' + result[i].id + '/platformlogo/original/logo.png';
|
let logoUrl = '/api/v1.1/Platforms/' + result[i].id + '/platformlogo/original/logo.png';
|
||||||
|
|
||||||
// create platform container
|
// create platform container
|
||||||
let platformItem = document.createElement('div');
|
let platformItem = document.createElement('div');
|
||||||
|
@@ -181,16 +181,40 @@ class PreferencesWindow {
|
|||||||
"Adult"
|
"Adult"
|
||||||
];
|
];
|
||||||
for (let j = 0; j < ratingGroupsOrder.length; j++) {
|
for (let j = 0; j < ratingGroupsOrder.length; j++) {
|
||||||
let ageGroupValue = AgeRatingGroups[ratingGroupsOrder[j]];
|
let ratingGroup = ratingGroupsOrder[j];
|
||||||
let iconIdList = ageGroupValue[key.toLowerCase()];
|
let ageGroupValue = AgeRatingGroups[ratingGroup];
|
||||||
|
let ageGroupValueLower = {};
|
||||||
|
for (const [key, value] of Object.entries(ageGroupValue)) {
|
||||||
|
ageGroupValueLower[key.toLowerCase()] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
let iconIdList = ageGroupValueLower[key.toLowerCase()];
|
||||||
|
console.log(key.toLowerCase());
|
||||||
|
if (key == 'clasS_IND' || key == 'CLASS_IND') {
|
||||||
|
console.log("here");
|
||||||
|
}
|
||||||
// loop the age rating icons
|
// loop the age rating icons
|
||||||
for (let i = 0; i < iconIdList.length; i++) {
|
if (iconIdList) {
|
||||||
let icon = document.createElement('img');
|
for (const [i, value] of Object.entries(iconIdList)) {
|
||||||
// icon.src = "/images/Ratings/" + key + "/" + AgeRatingStrings[iconIdList[i]] + ".svg";
|
console.log(" " + iconIdList[i]);
|
||||||
icon.src = "/images/Ratings/" + key + "/" + iconIdList[i] + ".svg";
|
let icon = document.createElement('img');
|
||||||
icon.title = AgeRatingStrings[iconIdList[i]];
|
|
||||||
icon.classList.add("rating_image_mini");
|
// get age rating strings
|
||||||
classificationIcons.appendChild(icon);
|
let iconId = iconIdList[i];
|
||||||
|
let ageRatingString;
|
||||||
|
for (const [x, y] of Object.entries(AgeRatingStrings)) {
|
||||||
|
if (AgeRatingStrings[x] == iconId) {
|
||||||
|
ageRatingString = AgeRatingStrings[x];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
icon.src = "/images/Ratings/" + key + "/" + ageRatingString + ".svg";
|
||||||
|
icon.title = ageRatingString;
|
||||||
|
icon.alt = ageRatingString;
|
||||||
|
icon.classList.add("rating_image_mini");
|
||||||
|
classificationIcons.appendChild(icon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
classificationItemBox.appendChild(classificationIcons);
|
classificationItemBox.appendChild(classificationIcons);
|
||||||
|
Reference in New Issue
Block a user