Code clean up and API versioning (#178)

* Merged tools project into main project

* Applied API versioning
This commit is contained in:
Michael Green
2023-10-31 10:42:15 +11:00
committed by GitHub
parent 1cc7eb22dc
commit 2ade60c551
85 changed files with 338 additions and 297 deletions

View File

@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8" />
<script src="/api/v1/System/VersionFile"></script>
<script src="/api/v1.0/System/VersionFile"></script>
<link type="text/css" rel="stylesheet" dat-href="/styles/style.css" />
<script src="/scripts/jquery-3.6.0.min.js"></script>
<script src="/scripts/moment.js"></script>

View File

@@ -20,7 +20,7 @@
GetCollections();
function GetCollections() {
ajaxCall('/api/v1/Collections', 'GET', function (result) {
ajaxCall('/api/v1.0/Collections', 'GET', function (result) {
if (result) {
var targetDiv = document.getElementById('collection_table_location');
targetDiv.innerHTML = '';
@@ -47,7 +47,7 @@
break;
case "Completed":
statusText = 'Available';
downloadLink = '<a href="/api/v1/Collections/' + result[i].id + '/Roms/Zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
downloadLink = '<a href="/api/v1.0/Collections/' + result[i].id + '/Roms/Zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
packageSize = formatBytes(result[i].collectionBuiltSizeBytes);
break;
case "Failed":

View File

@@ -24,7 +24,7 @@
$('#collection_addgame').select2({
ajax: {
url: '/api/v1/Collections',
url: '/api/v1.0/Collections',
placeholder: 'Select collection',
processResults: function (data) {
var arr = [];
@@ -59,7 +59,7 @@
if (CollectionId != 0) {
ajaxCall(
'/api/v1/Collections/' + CollectionId + '/AlwaysInclude' + RebuildCollection,
'/api/v1.0/Collections/' + CollectionId + '/AlwaysInclude' + RebuildCollection,
'PATCH',
function (result) {
closeSubDialog();

View File

@@ -12,7 +12,7 @@
<script type="text/javascript">
function deleteCollection() {
ajaxCall(
'/api/v1/Collections/' + subModalVariables,
'/api/v1.0/Collections/' + subModalVariables,
'DELETE',
function (result) {
GetCollections();

View File

@@ -136,7 +136,7 @@
// setup dropdowns
$('#collection_platform').select2({
ajax: {
url: '/api/v1/Filter',
url: '/api/v1.0/Filter',
processResults: function (data) {
var filter = data['platforms'];
@@ -159,7 +159,7 @@
$('#collection_genres').select2({
ajax: {
url: '/api/v1/Filter',
url: '/api/v1.0/Filter',
processResults: function (data) {
var filter = data['genres'];
@@ -182,7 +182,7 @@
$('#collection_players').select2({
ajax: {
url: '/api/v1/Filter',
url: '/api/v1.0/Filter',
processResults: function (data) {
var filter = data['gamemodes'];
@@ -205,7 +205,7 @@
$('#collection_playerperspectives').select2({
ajax: {
url: '/api/v1/Filter',
url: '/api/v1.0/Filter',
processResults: function (data) {
var filter = data['playerperspectives'];
@@ -228,7 +228,7 @@
$('#collection_themes').select2({
ajax: {
url: '/api/v1/Filter',
url: '/api/v1.0/Filter',
processResults: function (data) {
var filter = data['themes'];
@@ -258,7 +258,7 @@
// edit mode
ajaxCall(
'/api/v1/Collections/' + modalVariables,
'/api/v1.0/Collections/' + modalVariables,
'GET',
function(result) {
if (result.name) { document.getElementById('collection_name').value = result.name; }
@@ -278,7 +278,7 @@
// fill select2 controls
$.ajax(
{
url: '/api/v1/Filter',
url: '/api/v1.0/Filter',
type: 'GET',
indexValue: result,
dataType: 'json',
@@ -344,7 +344,7 @@
// existing object - save over the top
item.id = modalVariables;
ajaxCall(
'/api/v1/Collections/' + modalVariables,
'/api/v1.0/Collections/' + modalVariables,
'PATCH',
function(result) {
location.reload();
@@ -357,7 +357,7 @@
} else {
// new object
ajaxCall(
'/api/v1/Collections',
'/api/v1.0/Collections',
'POST',
function(result) {
location.reload();
@@ -426,7 +426,7 @@
var item = GenerateCollectionItem();
ajaxCall(
'/api/v1/Collections/Preview',
'/api/v1.0/Collections/Preview',
'POST',
function(result) {
DisplayPreview(result, 'collectionedit_previewbox_content');
@@ -579,7 +579,7 @@
var gameImage = document.createElement('img');
gameImage.className = 'game_tile_image game_tile_image_small';
if (gameItem.cover) {
gameImage.src = '/api/v1/Games/' + gameItem.id + '/cover/image';
gameImage.src = '/api/v1.0/Games/' + gameItem.id + '/cover/image';
} else {
gameImage.src = '/images/unknowngame.png';
gameImage.className = 'game_tile_image game_tile_image_small unknown';

View File

@@ -12,7 +12,7 @@
<script type="text/javascript">
function deleteLibrary() {
ajaxCall(
'/api/v1/Library/' + subModalVariables,
'/api/v1.0/Library/' + subModalVariables,
'DELETE',
function (result) {
drawLibrary();

View File

@@ -32,7 +32,7 @@
$('#newlibrary_defaultplatform').select2({
minimumInputLength: 3,
ajax: {
url: '/api/v1/Search/Platform',
url: '/api/v1.0/Search/Platform',
data: function (params) {
var query = {
SearchString: params.term
@@ -76,7 +76,7 @@
alert("A path must be provided.");
} else {
ajaxCall(
'/api/v1/Library?Name=' + encodeURIComponent(libName) + '&DefaultPlatformId=' + libPlatform[0].id + '&Path=' + encodeURIComponent(libPath),
'/api/v1.0/Library?Name=' + encodeURIComponent(libName) + '&DefaultPlatformId=' + libPlatform[0].id + '&Path=' + encodeURIComponent(libPath),
'POST',
function(result) {
drawLibrary();

View File

@@ -12,7 +12,7 @@
<script type="text/javascript">
function deleteCollection() {
ajaxCall(
'/api/v1/Games/' + gameData.id + '/romgroup/' + subModalVariables,
'/api/v1.0/Games/' + gameData.id + '/romgroup/' + subModalVariables,
'DELETE',
function (result) {
loadRoms();

View File

@@ -105,7 +105,7 @@
DisplayWebEmulatorContent(false);
ajaxCall(
'/api/v1/PlatformMaps/' + modalVariables,
'/api/v1.0/PlatformMaps/' + modalVariables,
'GET',
function (result) {
// set heading
@@ -338,7 +338,7 @@
console.log(JSON.stringify(item));
ajaxCall(
'/api/v1/PlatformMaps/' + modalVariables,
'/api/v1.0/PlatformMaps/' + modalVariables,
'PATCH',
function (result) {
loadPlatformMapping();

View File

@@ -11,7 +11,7 @@
<script type="text/javascript">
function deleteRom() {
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + modalVariables, 'DELETE', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + modalVariables, 'DELETE', function (result) {
window.location.reload();
});
}

View File

@@ -118,7 +118,7 @@
}
}
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + modalVariables, 'GET', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + modalVariables, 'GET', function (result) {
romData = result;
document.getElementById('modal-heading').innerHTML = result.name;
document.getElementById('rominfo_library').innerHTML = result.library.name;
@@ -169,7 +169,7 @@
$('#properties_fixplatform').select2({
minimumInputLength: 3,
ajax: {
url: '/api/v1/Search/Platform',
url: '/api/v1.0/Search/Platform',
data: function (params) {
var query = {
SearchString: params.term
@@ -200,7 +200,7 @@
minimumInputLength: 3,
templateResult: DropDownRenderGameOption,
ajax: {
url: '/api/v1/Search/Game',
url: '/api/v1.0/Search/Game',
data: function (params) {
fixplatform = $('#properties_fixplatform').select2('data');
@@ -236,7 +236,7 @@
document.getElementById('properties_fixsave').setAttribute("disabled", "disabled");
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + modalVariables + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + modalVariables + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
window.location.reload();
});
}

View File

@@ -28,7 +28,7 @@
document.getElementById('upload_platformoverride').innerHTML = "<option value='0' selected='selected'>Automatic Platform</option>";
var myDropzone = new Dropzone("div#upload_target", {
url: "/api/v1/Roms",
url: "/api/v1.0/Roms",
autoProcessQueue: true,
uploadMultiple: true,
paramName: myParamName,
@@ -84,7 +84,7 @@
$('#upload_platformoverride').select2({
minimumInputLength: 3,
ajax: {
url: '/api/v1/Search/Platform',
url: '/api/v1.0/Search/Platform',
data: function (params) {
var query = {
SearchString: params.term
@@ -125,6 +125,6 @@
}
console.log(queryString);
myDropzone.options.url = "/api/v1/Roms" + queryString;
myDropzone.options.url = "/api/v1.0/Roms" + queryString;
});
</script>

View File

@@ -15,7 +15,7 @@
var emuBios = '';
var emuBackground = '';
ajaxCall('/api/v1/Games/' + gameId, 'GET', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId, 'GET', function (result) {
gameData = result;
// load artwork
@@ -27,22 +27,22 @@
} else {
if (result.cover) {
var bg = document.getElementById('bgImage');
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
}
}
if (result.cover) {
emuBackground = '/api/v1/Games/' + gameId + '/cover/image';
emuBackground = '/api/v1.0/Games/' + gameId + '/cover/image';
}
emuGameTitle = gameData.name;
});
ajaxCall('/api/v1/Bios/' + platformId, 'GET', function (result) {
ajaxCall('/api/v1.0/Bios/' + platformId, 'GET', function (result) {
if (result.length == 0) {
emuBios = '';
} else {
emuBios = '/api/v1/Bios/zip/' + platformId;
emuBios = '/api/v1.0/Bios/zip/' + platformId;
}
switch (getQueryString('engine', 'string')) {
@@ -59,7 +59,7 @@
artworksPosition = 0;
}
var bg = document.getElementById('bgImage');
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
}
}
</script>

View File

@@ -94,7 +94,7 @@
var artworksTimer = null;
var selectedScreenshot = 0;
ajaxCall('/api/v1/Games/' + gameId, 'GET', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId, 'GET', function (result) {
// populate games page
gameData = result;
@@ -116,7 +116,7 @@
// get alt name
var gameTitleAltLabel = document.getElementById('gametitle_alts');
if (result.alternativeNames) {
ajaxCall('/api/v1/Games/' + gameId + '/alternativename', 'GET', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/alternativename', 'GET', function (result) {
var altNames = '';
for (var i = 0; i < result.length; i++) {
if (altNames.length > 0) {
@@ -161,7 +161,7 @@
} else {
var bg = document.getElementById('bgImage');
if (result.cover) {
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
} else {
var randomInt = randomIntFromInterval(1, 3);
bg.setAttribute('style', 'background-image: url("/images/gamebg' + randomInt + '.jpg"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
@@ -175,7 +175,7 @@
var gameDeveloperLoaded = false;
var gamePublisherLoaded = false;
if (result.involvedCompanies) {
ajaxCall('/api/v1/games/' + gameId + '/companies', 'GET', function (result) {
ajaxCall('/api/v1.0/games/' + gameId + '/companies', 'GET', function (result) {
var lstDevelopers = [];
var lstPublishers = [];
@@ -227,7 +227,7 @@
var gameImage = document.createElement('img');
gameImage.className = 'game_cover_image';
if (result.cover) {
gameImage.src = '/api/v1/Games/' + result.id + '/cover/image';
gameImage.src = '/api/v1.0/Games/' + result.id + '/cover/image';
} else {
gameImage.src = '/images/unknowngame.png';
gameImage.className = 'game_cover_image unknown';
@@ -240,7 +240,7 @@
var gameRatings = document.createElement('div');
for (var i = 0; i < result.ageRatings.ids.length; i++) {
var ratingImage = document.createElement('img');
ratingImage.src = '/api/v1/Games/' + result.id + '/agerating/' + result.ageRatings.ids[i] + '/image';
ratingImage.src = '/api/v1.0/Games/' + result.id + '/agerating/' + result.ageRatings.ids[i] + '/image';
ratingImage.className = 'rating_image';
gameRatings.appendChild(ratingImage);
}
@@ -252,7 +252,7 @@
// load genres
var gameSummaryGenres = document.getElementById('gamesumarry_genres');
if (result.genres) {
ajaxCall('/api/v1/Games/' + gameId + '/genre', 'GET', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/genre', 'GET', function (result) {
for (var i = 0; i < result.length; i++) {
var genreLabel = document.createElement('span');
genreLabel.className = 'gamegenrelabel';
@@ -281,7 +281,7 @@
var screenshotItem = document.createElement('div');
screenshotItem.id = 'gamescreenshots_gallery_' + imageIndex;
screenshotItem.setAttribute('name', 'gamescreenshots_gallery_item');
screenshotItem.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/screenshots/' + result.screenshots.ids[i] + '/image"); background-position: center; background-repeat: no-repeat; background-size: contain;)');
screenshotItem.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/screenshots/' + result.screenshots.ids[i] + '/image"); background-position: center; background-repeat: no-repeat; background-size: contain;)');
screenshotItem.setAttribute('imageid', imageIndex);
screenshotItem.setAttribute('imagetype', 0);
screenshotItem.className = 'gamescreenshots_gallery_item';
@@ -293,7 +293,7 @@
// load videos
if (result.videos) {
ajaxCall('/api/v1/Games/' + gameId + '/videos', 'GET', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/videos', 'GET', function (result) {
var gameScreenshots_vGallery = document.getElementById('gamescreenshots_gallery_panel');
for (var i = 0; i < result.length; i++) {
var vScreenshotItem = document.createElement('div');
@@ -360,7 +360,7 @@
}
var gameRoms = document.getElementById('gamesummaryroms');
ajaxCall('/api/v1/Games/' + gameId + '/roms', 'GET', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/roms', 'GET', function (result) {
if (result.gameRomItems) {
var gameRomItems = result.gameRomItems;
var mediaGroups = result.mediaGroups;
@@ -391,14 +391,14 @@
if (result.gameRomItems[i].emulator) {
if (gameRomItems[i].emulator.type) {
if (gameRomItems[i].emulator.type.length > 0) {
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItems[i].emulator.type + '&core=' + gameRomItems[i].emulator.core + '&platformid=' + gameRomItems[i].platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name)) + '" class="romstart">Launch</a>';
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItems[i].emulator.type + '&core=' + gameRomItems[i].emulator.core + '&platformid=' + gameRomItems[i].platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1.0/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name)) + '" class="romstart">Launch</a>';
}
}
}
var newRow = [
['<input type="checkbox" name="rom_checkbox" data-gameid="' + gameData.id + '" data-platformid="' + gameRomItems[i].platformId + '" data-romid="' + gameRomItems[i].id + '" onclick="handleChecks();" />', 'rom_checkbox_box_hidden', 'rom_edit_checkbox'],
'<a href="/api/v1/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name) + '" class="romlink">' + gameRomItems[i].name + '</a>',
'<a href="/api/v1.0/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name) + '" class="romlink">' + gameRomItems[i].name + '</a>',
formatBytes(gameRomItems[i].size, 2),
gameRomItems[i].romTypeMedia,
gameRomItems[i].mediaLabel,
@@ -436,7 +436,7 @@
if (gameRomItem.platformId == mediaGroup.platformId) {
if (gameRomItem.emulator) {
if (gameRomItem.emulator.type.length > 0) {
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItem.emulator.type + '&core=' + gameRomItem.emulator.core + '&platformid=' + gameRomItem.platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '(' + mediaGroup.id + ')' + '.zip') + '" class="romstart">Launch</a>';
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItem.emulator.type + '&core=' + gameRomItem.emulator.core + '&platformid=' + gameRomItem.platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1.0/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '(' + mediaGroup.id + ')' + '.zip') + '" class="romstart">Launch</a>';
break;
}
}
@@ -459,7 +459,7 @@
break;
case "Completed":
statusText = 'Available';
downloadLink = '<a href="/api/v1/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '.zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
downloadLink = '<a href="/api/v1.0/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '.zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
packageSize = formatBytes(mediaGroup.size);
launchButtonContent = launchButton;
break;
@@ -525,7 +525,7 @@
artworksPosition = 0;
}
var bg = document.getElementById('bgImage');
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
artworksTimer = setTimeout(rotateBackground, 60000);
}
}
@@ -677,7 +677,7 @@
minimumInputLength: 3,
placeholder: "Platform",
ajax: {
url: '/api/v1/Search/Platform',
url: '/api/v1.0/Search/Platform',
data: function (params) {
var query = {
SearchString: params.term
@@ -709,7 +709,7 @@
templateResult: DropDownRenderGameOption,
placeholder: "Game",
ajax: {
url: '/api/v1/Search/Game',
url: '/api/v1.0/Search/Game',
data: function (params) {
fixplatform = $('#rom_edit_fixplatform').select2('data');
@@ -762,7 +762,7 @@
if (rom_checks[i].checked == true) {
var romId = rom_checks[i].getAttribute('data-romid');
remapCallCounter += 1;
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + romId + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
remapTitlesCallback();
}, function (result) {
remapTitlesCallback();
@@ -804,7 +804,7 @@
if (rom_checks[i].checked == true) {
var romId = rom_checks[i].getAttribute('data-romid');
remapCallCounter += 1;
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId, 'DELETE', function (result) {
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + romId, 'DELETE', function (result) {
remapTitlesCallback();
});
}
@@ -846,7 +846,7 @@
}
ajaxCall(
'/api/v1/Games/' + gameId + '/romgroup?PlatformId=' + platformId,
'/api/v1.0/Games/' + gameId + '/romgroup?PlatformId=' + platformId,
'POST',
function (result) {
DisplayROMCheckboxes(false);

View File

@@ -8,7 +8,7 @@
</div>
<script type="text/javascript">
ajaxCall('/api/v1/Filter', 'GET', function (result) {
ajaxCall('/api/v1.0/Filter', 'GET', function (result) {
var filterElement = document.getElementById('games_filter');
formatFilterPanel(filterElement, result);

View File

@@ -8,7 +8,7 @@
</table>
<script type="text/javascript">
ajaxCall('/api/v1/Bios', 'GET', function (result) {
ajaxCall('/api/v1.0/Bios', 'GET', function (result) {
result.sort((a, b) => a.platformname.charCodeAt(0) - b.platformname.charCodeAt(0));
var lastPlatform = '';
@@ -28,7 +28,7 @@
}
var biosFilename = document.createElement('a');
biosFilename.href = '/api/v1/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.href = '/api/v1.0/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.innerHTML = result[i].filename;
biosFilename.className = 'romlink';
@@ -38,7 +38,7 @@
availableText.className = 'greentext';
biosFilename = document.createElement('a');
biosFilename.href = '/api/v1/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.href = '/api/v1.0/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.innerHTML = result[i].filename;
biosFilename.className = 'romlink';
} else {

View File

@@ -26,7 +26,7 @@
}
ajaxCall(
'/api/v1/Logs' + apiQuery,
'/api/v1.0/Logs' + apiQuery,
'GET',
function (result) {
var newTable = document.getElementById('settings_events_table');

View File

@@ -22,7 +22,7 @@
}
ajaxCall(
'/api/v1/PlatformMaps' + queryString,
'/api/v1.0/PlatformMaps' + queryString,
'GET',
function (result) {
var newTable = document.getElementById('settings_mapping_table');
@@ -61,7 +61,7 @@
}
function DownloadJSON() {
window.open('/api/v1/PlatformMaps', '_blank');
window.open('/api/v1.0/PlatformMaps', '_blank');
}
document.getElementById('importjson').addEventListener('click', openDialog);
@@ -71,7 +71,7 @@
}
$('#uploadjson').change(function () {
$(this).simpleUpload("/api/v1/PlatformMaps", {
$(this).simpleUpload("/api/v1.0/PlatformMaps", {
start: function (file) {
//upload started
console.log("JSON upload started");

View File

@@ -11,7 +11,7 @@
<script type="text/javascript">
function drawLibrary() {
ajaxCall(
'/api/v1/Library',
'/api/v1.0/Library',
'GET',
function (result) {
var newTable = document.getElementById('settings_libraries');

View File

@@ -26,7 +26,7 @@
<div id="system_signatures"></div>
<script type="text/javascript">function SystemLoadStatus() {
ajaxCall('/api/v1/BackgroundTasks', 'GET', function (result) {
ajaxCall('/api/v1.0/BackgroundTasks', 'GET', function (result) {
var newTable = document.createElement('table');
newTable.className = 'romtable';
newTable.setAttribute('cellspacing', 0);
@@ -119,7 +119,7 @@
}
function SystemLoadSystemStatus() {
ajaxCall('/api/v1/System', 'GET', function (result) {
ajaxCall('/api/v1.0/System', 'GET', function (result) {
if (result) {
var totalLibrarySpace = 0;
@@ -234,7 +234,7 @@
}
function SystemSignaturesStatus() {
ajaxCall('/api/v1/Signatures/Status', 'GET', function (result) {
ajaxCall('/api/v1.0/Signatures/Status', 'GET', function (result) {
var newTable = document.createElement('table');
newTable.className = 'romtable';
newTable.setAttribute('cellspacing', 0);
@@ -257,7 +257,7 @@
}
function StartProcess(itemType) {
ajaxCall('/api/v1/BackgroundTasks/' + itemType + '?ForceRun=true', 'GET', function (result) {
ajaxCall('/api/v1.0/BackgroundTasks/' + itemType + '?ForceRun=true', 'GET', function (result) {
SystemLoadStatus();
});
}

View File

@@ -251,7 +251,7 @@ function executeFilter() {
console.log('Query string = ' + queryString);
ajaxCall('/api/v1/Games' + queryString, 'GET', function (result) {
ajaxCall('/api/v1.0/Games' + queryString, 'GET', function (result) {
var gameElement = document.getElementById('games_library');
formatGamesPanel(gameElement, result);
});

View File

@@ -20,7 +20,7 @@ function renderGameIcon(gameObject, showTitle, showRatings) {
var gameImage = document.createElement('img');
gameImage.className = 'game_tile_image lazy';
if (gameObject.cover) {
gameImage.setAttribute('data-src', '/api/v1/Games/' + gameObject.id + '/cover/image');
gameImage.setAttribute('data-src', '/api/v1.0/Games/' + gameObject.id + '/cover/image');
} else {
gameImage.src = '/images/unknowngame.png';
gameImage.className = 'game_tile_image unknown';
@@ -40,7 +40,7 @@ function renderGameIcon(gameObject, showTitle, showRatings) {
ratingsSection.id = 'ratings_section';
for (var i = 0; i < gameObject.ageRatings.ids.length; i++) {
var ratingImage = document.createElement('img');
ratingImage.src = '/api/v1/Games/' + gameObject.id + '/agerating/' + gameObject.ageRatings.ids[i] + '/image';
ratingImage.src = '/api/v1.0/Games/' + gameObject.id + '/agerating/' + gameObject.ageRatings.ids[i] + '/image';
ratingImage.className = 'rating_image_mini';
ratingsSection.appendChild(ratingImage);
}