Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
froquede committed Sep 21, 2022
1 parent 9f50aa7 commit 406f3af
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ let download_queue = [];
let queue_running = false;

function addToDownloadQueue(id, token, custom_path = maps_path) {
console.log(custom_path);
request(`https://api.mod.io/v1/games/629/mods/${id}`, {headers: {Authorization: "Bearer " + token}, timeout: 20e3}, (err, res, body) => {
try {
body = JSON.parse(body);
Expand Down Expand Up @@ -224,7 +225,7 @@ app.get('/modio/maps', (req, res) => {
});

app.get('/local/maps', (req, res) => {
listMaps(req.query.filter, req.query.sorting, req.query.custom_path && req.query.custom_path.split(" ").join("") != "" ? decodeURI(req.query.custom_path) : undefined).then(maps => {
listMaps(req.query.filter, req.query.sorting, req.query.custom_path && req.query.custom_path.split(" ").join("") != "" ? decodeURIComponent(req.query.custom_path) : undefined).then(maps => {
res.send(maps);
}).catch(err => {
res.status(500).send(err);
Expand All @@ -248,7 +249,8 @@ app.get('/internal/open', (req, res) => {

app.post('/modio/download', (req, res) => {
if(req.body.id) {
addToDownloadQueue(req.body.id, req.body.token, req.body.custom_path && req.body.custom_path.split(" ").join("") != "" ? decodeURI(req.body.custom_path) : undefined);
console.log(req.body.custom_path, decodeURIComponent(req.body.custom_path));
addToDownloadQueue(req.body.id, req.body.token, req.body.custom_path && req.body.custom_path.split(" ").join("") != "" ? decodeURIComponent(req.body.custom_path) : undefined);
res.status(200).send();
}
else {
Expand Down
9 changes: 7 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ function createWindow () {
frame:false,
show: true,
webPreferences: {},
icon: nativeImage.createFromPath(path.resolve(app_path, './webapp/MapHubIcon.ico'))
icon: nativeImage.createFromPath(path.resolve(app_path, './webapp/XLhubIcon.ico'))
});
mainWindow.webContents.setFrameRate(60);
mainWindow.resizable = false;
mainWindow.loadURL('http://localhost:420')
mainWindow.setMenuBarVisibility(false);

if (process.platform === 'win32')
{
app.setAppUserModelId(app.name);
}

// mainWindow.webContents.on('new-window', (e, url) => {
// e.preventDefault();
Expand All @@ -30,7 +35,7 @@ function createWindow () {
let icon;
app.whenReady().then(() => {
createWindow();
icon = nativeImage.createFromPath(path.resolve(app_path, './webapp/MapHubIcon.ico'))
icon = nativeImage.createFromPath(path.resolve(app_path, './webapp/XLhubIcon.ico'))
tray = new Tray(icon)

const menu = Menu.buildFromTemplate([
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"config": {
"forge": {
"packagerConfig": {
"icon": "./webapp/MapHubIcon.ico"
"icon": "./webapp/XLhubIcon.ico"
},
"makers": [
{
Expand Down
Binary file added webapp/XLhubIcon.ico
Binary file not shown.
Binary file modified webapp/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions webapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ function getLocal(refresh = false) {
}

if(result.length == 0) document.querySelector(".local-container .no-data").classList.remove("hidden");
else document.querySelector(".local-container .no-data").classList.add("hidden");

document.querySelector(".local-container").classList.remove("loading");
render(result, document.querySelector(".local-container"));
Expand Down
Binary file modified webapp/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 406f3af

Please sign in to comment.