Now pre-compiles age group metadata instead of generating it on every query (#235)
* Server will now quit on start up if schema updates fail (closes Abort start up if an error occurs during database upgrade #221) * Moved AgeGroups to it's own class * Improved query performance by defining the AgeGroupId as a metadata item. A metadata refresh is required to generate this data
This commit is contained in:
@@ -196,40 +196,56 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#properties_fixgame').select2({
|
||||
minimumInputLength: 3,
|
||||
templateResult: DropDownRenderGameOption,
|
||||
ajax: {
|
||||
url: '/api/v1.1/Search/Game',
|
||||
data: function (params) {
|
||||
fixplatform = $('#properties_fixplatform').select2('data');
|
||||
$('#properties_fixplatform').on('select2:select', function (e) {
|
||||
var platformData = e.params.data;
|
||||
console.log(platformData);
|
||||
|
||||
var query = {
|
||||
PlatformId: fixplatform[0].id,
|
||||
SearchString: params.term
|
||||
}
|
||||
var gameValue = $('#properties_fixgame').select2('data');
|
||||
if (gameValue) {
|
||||
console.log(gameValue[0]);
|
||||
|
||||
// Query parameters will be ?SearchString=[term]
|
||||
return query;
|
||||
},
|
||||
processResults: function (data) {
|
||||
var arr = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
arr.push({
|
||||
id: data[i].id,
|
||||
text: data[i].name,
|
||||
cover: data[i].cover
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
results: arr
|
||||
};
|
||||
}
|
||||
setFixGameDropDown();
|
||||
}
|
||||
});
|
||||
|
||||
function setFixGameDropDown() {
|
||||
$('#properties_fixgame').empty().select2({
|
||||
minimumInputLength: 3,
|
||||
placeholder: 'Game',
|
||||
templateResult: DropDownRenderGameOption,
|
||||
ajax: {
|
||||
url: '/api/v1.1/Search/Game',
|
||||
data: function (params) {
|
||||
fixplatform = $('#properties_fixplatform').select2('data');
|
||||
|
||||
var query = {
|
||||
PlatformId: fixplatform[0].id,
|
||||
SearchString: params.term
|
||||
}
|
||||
|
||||
// Query parameters will be ?SearchString=[term]
|
||||
return query;
|
||||
},
|
||||
processResults: function (data) {
|
||||
var arr = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
arr.push({
|
||||
id: data[i].id,
|
||||
text: data[i].name,
|
||||
cover: data[i].cover
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
results: arr
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
setFixGameDropDown();
|
||||
|
||||
function SaveFixedGame() {
|
||||
var fixplatform = $('#properties_fixplatform').select2('data');
|
||||
var fixgame = $('#properties_fixgame').select2('data');
|
||||
|
||||
@@ -741,41 +741,56 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#rom_edit_fixgame').select2({
|
||||
minimumInputLength: 3,
|
||||
templateResult: DropDownRenderGameOption,
|
||||
placeholder: "Game",
|
||||
ajax: {
|
||||
url: '/api/v1.1/Search/Game',
|
||||
data: function (params) {
|
||||
fixplatform = $('#rom_edit_fixplatform').select2('data');
|
||||
$('#rom_edit_fixplatform').on('select2:select', function (e) {
|
||||
var platformData = e.params.data;
|
||||
console.log(platformData);
|
||||
|
||||
var query = {
|
||||
PlatformId: fixplatform[0].id,
|
||||
SearchString: params.term
|
||||
}
|
||||
var gameValue = $('#rom_edit_fixgame').select2('data');
|
||||
if (gameValue) {
|
||||
console.log(gameValue[0]);
|
||||
|
||||
// Query parameters will be ?SearchString=[term]
|
||||
return query;
|
||||
},
|
||||
processResults: function (data) {
|
||||
var arr = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
arr.push({
|
||||
id: data[i].id,
|
||||
text: data[i].name,
|
||||
cover: data[i].cover
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
results: arr
|
||||
};
|
||||
}
|
||||
setRomFixGameDropDown();
|
||||
}
|
||||
});
|
||||
|
||||
function setRomFixGameDropDown() {
|
||||
$('#rom_edit_fixgame').empty().select2({
|
||||
minimumInputLength: 3,
|
||||
templateResult: DropDownRenderGameOption,
|
||||
placeholder: "Game",
|
||||
ajax: {
|
||||
url: '/api/v1.1/Search/Game',
|
||||
data: function (params) {
|
||||
fixplatform = $('#rom_edit_fixplatform').select2('data');
|
||||
|
||||
var query = {
|
||||
PlatformId: fixplatform[0].id,
|
||||
SearchString: params.term
|
||||
}
|
||||
|
||||
// Query parameters will be ?SearchString=[term]
|
||||
return query;
|
||||
},
|
||||
processResults: function (data) {
|
||||
var arr = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
arr.push({
|
||||
id: data[i].id,
|
||||
text: data[i].name,
|
||||
cover: data[i].cover
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
results: arr
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
setRomFixGameDropDown();
|
||||
|
||||
var remapCallCounter = 0;
|
||||
var remapCallCounterMax = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user