Fixed various build problems

This commit is contained in:
Geomitron
2020-05-10 21:43:43 -04:00
parent 3e3d3dd137
commit fb1908e063
8 changed files with 49 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
import { Component, AfterViewInit, Input, ViewChild, ElementRef } from '@angular/core'
import { SongResult } from '../../../../../electron/shared/interfaces/search.interface'
import { SelectionService } from 'src/app/core/services/selection.service'
import { SelectionService } from '../../../../core/services/selection.service'
@Component({
selector: 'tr[app-result-table-row]',

View File

@@ -1,9 +1,9 @@
import { Component, Output, EventEmitter, ViewChildren, QueryList, ViewChild, OnInit } from '@angular/core'
import { SongResult } from '../../../../electron/shared/interfaces/search.interface'
import { ResultTableRowComponent } from './result-table-row/result-table-row.component'
import { CheckboxDirective } from 'src/app/core/directives/checkbox.directive'
import { SearchService } from 'src/app/core/services/search.service'
import { SelectionService } from 'src/app/core/services/selection.service'
import { CheckboxDirective } from '../../../core/directives/checkbox.directive'
import { SearchService } from '../../../core/services/search.service'
import { SelectionService } from '../../../core/services/selection.service'
@Component({
selector: 'app-result-table',

View File

@@ -1,10 +1,10 @@
import { Component, ChangeDetectorRef } from '@angular/core'
import { DownloadService } from 'src/app/core/services/download.service'
import { ElectronService } from 'src/app/core/services/electron.service'
import { groupBy } from 'src/electron/shared/UtilFunctions'
import { VersionResult } from 'src/electron/shared/interfaces/songDetails.interface'
import { SearchService } from 'src/app/core/services/search.service'
import { SelectionService } from 'src/app/core/services/selection.service'
import { DownloadService } from '../../../core/services/download.service'
import { ElectronService } from '../../../core/services/electron.service'
import { groupBy } from '../../../../electron/shared/UtilFunctions'
import { VersionResult } from '../../../../electron/shared/interfaces/songDetails.interface'
import { SearchService } from '../../../core/services/search.service'
import { SelectionService } from '../../../core/services/selection.service'
@Component({
selector: 'app-status-bar',

View File

@@ -1,5 +1,5 @@
import { Injectable, EventEmitter } from '@angular/core'
import { SongResult } from 'src/electron/shared/interfaces/search.interface'
import { SongResult } from '../../../electron/shared/interfaces/search.interface'
import { SearchService } from './search.service'
// Note: this class prevents event cycles by only emitting events if the checkbox changes

View File

@@ -109,17 +109,19 @@ export class FileExtractor {
* Extracts a .zip or .7z archive found at `fullPath` and puts the extracted results in `this.sourceFolder`.
*/
private extract7z(fullPath: string) {
const stream = node7z.extractFull(fullPath, this.sourceFolder, { $progress: true, $bin: zipBin.path7za })
const zipBinPath = zipBin.path7za.replace('app.asar', 'app.asar.unpacked') // I love electron-builder packaging :)
const stream = node7z.extractFull(fullPath, this.sourceFolder, { $progress: true, $bin: zipBinPath })
stream.on('progress', this.cancelable((progress: { percent: number; fileCount: number }) => {
this.callbacks.extractProgress(progress.percent, isNaN(progress.fileCount) ? 0 : progress.fileCount)
}))
let extractErrorOccured = false
stream.on('error', this.cancelable(() => {
stream.on('error', this.cancelable((err) => {
extractErrorOccured = true
console.log(`Failed to extract [${fullPath}]; retrying with .rar extractor...`)
this.extract(fullPath, true)
this.callbacks.error({ header: '7zip Error', body: err }, () => this.extract(fullPath, extname(fullPath) == '.rar'))
// console.log(`Failed to extract [${fullPath}]; retrying with .rar extractor...`)
// this.extract(fullPath, true)
}))
stream.on('end', this.cancelable(() => {

View File

@@ -2,6 +2,7 @@ import { app, BrowserWindow, ipcMain } from 'electron'
import * as windowStateKeeper from 'electron-window-state'
import * as path from 'path'
import * as url from 'url'
require('electron-unhandled')({ showDialog: true })
// IPC Handlers
import { getIPCInvokeHandlers, getIPCEmitHandlers, IPCEmitEvents } from './shared/IPCHandler'