Skip to content

Commit

Permalink
fixed bugs in the downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamYG committed Apr 25, 2019
1 parent c41f1ce commit 9bcc302
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
33 changes: 21 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,27 @@ ipcMain.on(msg.DOWNLOAD_CAMPAIGN, async (event, campaign) => {
const mapsmods = [...mods, ...maps];
console.log("maps and mods:",mapsmods)
const sources = {};
mapsmods.map(mod => {
const {sourceFormat} = mod;
if (!sources[mod.source]){
sources[mod.source] = {
format: sourceFormat,
files:[]
try {
mapsmods.map(mod => {
const {sourceFormat} = mod;
if (!sources[mod.source]){
sources[mod.source] = {
format: sourceFormat,
files:[]
}
downloadtracker.downloads.push({ source: mod.source, progress:0})
}
downloadtracker.downloads.push({ source: mod.source, progress:0})
}
if(sourceFormat === "zip") {sources[mod.source].files.push(mod);}
else{ sources[mod.source].files = mod;}
});
if(sources[mod.source].format === "zip") {
sources[mod.source].files.push(mod);
}
else{
sources[mod.source].files = mod;
}
});
} catch (error) {
console.log("Error!:",error);
}

const myPromises = [];
console.log("sources: ",sources)
for(let source in sources){
Expand Down Expand Up @@ -146,7 +155,7 @@ ipcMain.on(msg.DOWNLOAD_CAMPAIGN, async (event, campaign) => {
else {
const entryData = sources[source].files.find(e => entry.fileName === e.fileEntry)
if(entryData){
const entryBasePath = os.homedir();
const entryBasePath = installDir;
const entryBaseName = entryData.destination;
const entryFullPath = path.join(entryBasePath,entryBaseName);
console.log("entryFullPath",entryFullPath)
Expand Down
1 change: 1 addition & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ body{
overflow: hidden;
}
.campaign-item {
transition: background-color 0.25s, color 0.25s;
.campaign-thumbnail-container {
position:static;
}
Expand Down
9 changes: 0 additions & 9 deletions src/api/campaign-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,6 @@
],
"pattern": "^(.*)$"
},
"maps1": {
"$id": "#/properties/maps1",
"type": "integer",
"title": "The Maps1 Schema",
"default": 0,
"examples": [
14
]
},
"author": {
"$id": "#/properties/author",
"type": "string",
Expand Down

0 comments on commit 9bcc302

Please sign in to comment.