diff --git a/electron-builder.json b/electron-builder.json index bf32a49..6b2c394 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -1,12 +1,13 @@ { - "productName": "angular-electron", + "productName": "audible-to-mp3", + "extraFiles": ["./ffmpeg.exe"], "directories": { "output": "app-builds" }, "win": { "icon": "dist", "target": [ - "portable" + "nsis" ] }, "mac": { diff --git a/main.ts b/main.ts index 040f9dd..87cec91 100644 --- a/main.ts +++ b/main.ts @@ -52,7 +52,7 @@ function createWindow() { // when you should delete the corresponding element. win = null; }); -} +} try { diff --git a/package.json b/package.json index ef94d4a..c9bfcc0 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@angular/flex-layout": "^6.0.0-beta.17", "@angular/material": "^6.4.3", "jspdf": "^1.3.5", + "material-design-icons": "^3.0.1", "ngx-electron": "^1.0.4", "rxjs-compat": "^6.0.0-rc.0" }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index f8d9165..48d2a51 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -30,7 +30,9 @@ import {MatCardModule} from '@angular/material/card'; import {MatListModule} from '@angular/material/list'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {FlexLayoutModule} from "@angular/flex-layout"; +import {MatIconModule} from '@angular/material/icon'; +import {MatStepperModule} from '@angular/material/stepper'; // AoT requires an exported function for factories export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); @@ -51,9 +53,11 @@ export function HttpLoaderFactory(http: HttpClient) { AppRoutingModule, MatCardModule, NgxElectronModule, + MatStepperModule, MatButtonModule, MatToolbarModule, MatListModule, + MatIconModule, FlexLayoutModule, MatProgressSpinnerModule, TranslateModule.forRoot({ diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index 00943bb..ba787ff 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -1,51 +1,90 @@ -
+
+ + + + Source +
+ + + + +
+ + +
+ + Destination +
+ + + + +
+ + +
+ + Encode +
+ IN : {{inPath}} +
OUT: {{getOutFilename(chaptersAs[0],0)}} +
+ + +
+
+
+ + -
- - - - -
- +
+

{{(book | async)?.title}}

+

{{(book | async)?.author}}

-

{{(book | async)?.title}}

-

{{(book | async)?.author}}

+
+ {{slugify(bookAs.author)}}/{{slugify(bookAs.title)}}/ +
-
- {{slugify(bookAs.author)}}/{{slugify(bookAs.title)}}/ -
+
+ +
+
-
-
-
- + {{chapter.name}} - {{chapter.name}} - -
-
- {{(chapter.end - chapter.start) / 60 | number: '1.0-0'}}m -
+
+
+ {{(chapter.end - chapter.start) / 60 | number: '1.0-0'}}m +
-
-   -
-
- - -
+
+   +
+
+ + transform + + + done + +
+
+ -
-
- +
diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index dc6809e..3b8dc74 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -34,6 +34,7 @@ export class HomeComponent implements OnInit { public observableFiles: Observable; private syncChap = []; private inPath = ''; + private targetDir; slugify(text) { return text.toString().toLowerCase() @@ -78,13 +79,13 @@ export class HomeComponent implements OnInit { } - getOutFilename(chapter, i) { + public getOutFilename(chapter, i) { console.log(this.book); console.log(this.syncBook); const numChapter = (i + '').padStart(4, '0'); - return this.slugify(this.syncBook.author) + '/' + this.slugify(this.syncBook.title) + '/' + return this.targetDir + '\\' + this.slugify(this.syncBook.author) + '/' + this.slugify(this.syncBook.title) + '/' + numChapter + '-' + this.slugify(chapter.name) + '.mp3'; } @@ -133,6 +134,15 @@ export class HomeComponent implements OnInit { });*/ } + onChangeTargetDir(file) { + // console.log('on change !'); + // console.log(files[0].path); + + // console.log(file); + const path = file[0].path; + this.targetDir = path; + } + getPDF() { /*console.log(jsPDF); const doc = new jsPDF(); diff --git a/src/styles.scss b/src/styles.scss index 6bfce91..13b6ede 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -6,6 +6,8 @@ html, body { height: 100%; } +@import "material-design-icons/iconfont/material-icons.css"; + @import '~@angular/material/theming'; @include mat-core();