@@ -6,6 +6,8 @@ var endRegExp = /^\n -- exit code ([0-9]+)\s/;
6
6
var DEFAULT_DESTINATION_FILENAME = 'fcut-out.mp4' ;
7
7
var DEFAULT_PROJECT_FILENAME = 'fcut-project.json' ;
8
8
9
+ var EXPORTED_FIELDS = [ 'destinationFilename' , 'projectFilename' , 'aspectRatio' , 'exportFormat' , 'exportVideoCodec' , 'exportAudioCodec' , 'exportSubtitleCodec' , 'exportMapAllStreams' , 'time' ] ;
10
+
9
11
function updatePart ( part ) {
10
12
if ( typeof part === 'object' ) {
11
13
var u = hashString ( part . sourceId + ( part . from | 0 ) . toString ( 16 ) ) ;
@@ -93,9 +95,7 @@ var vm = new Vue({
93
95
file : filename ,
94
96
extention : extention
95
97
} )
96
- } ) . then ( function ( response ) {
97
- return response . json ( ) ;
98
- } ) . then ( function ( filenames ) {
98
+ } ) . then ( getJson ) . then ( function ( filenames ) {
99
99
if ( filenames && ( filenames . length > 0 ) ) {
100
100
if ( multiple ) {
101
101
return filenames ;
@@ -139,11 +139,10 @@ var vm = new Vue({
139
139
} ,
140
140
loadConfig : function ( boot ) {
141
141
var that = this ;
142
- return Promise . all ( [ fetch ( 'config/' ) . then ( function ( response ) {
143
- return response . json ( ) ;
144
- } ) , fetch ( '/rest/checkFFmpeg' , { method : 'POST' } ) . then ( function ( response ) {
145
- return response . json ( ) ;
146
- } ) ] ) . then ( function ( values ) {
142
+ return Promise . all ( [
143
+ fetch ( 'config/' ) . then ( getJson ) ,
144
+ fetch ( '/rest/checkFFmpeg' , { method : 'POST' } ) . then ( getJson )
145
+ ] ) . then ( function ( values ) {
147
146
var config = values [ 0 ] ;
148
147
var checkFFmpeg = values [ 1 ] ;
149
148
//console.info('config', config, 'checkFFmpeg', checkFFmpeg);
@@ -171,9 +170,7 @@ var vm = new Vue({
171
170
} ,
172
171
openSourceById : function ( sourceId ) {
173
172
var that = this ;
174
- return fetch ( 'source/' + sourceId + '/info.json' ) . then ( function ( response ) {
175
- return response . json ( ) ;
176
- } ) . then ( function ( info ) {
173
+ return fetch ( 'source/' + sourceId + '/info.json' ) . then ( getJson ) . then ( function ( info ) {
177
174
//console.info('info', info);
178
175
that . sources [ sourceId ] = info ;
179
176
return sourceId ;
@@ -501,6 +498,7 @@ var vm = new Vue({
501
498
parts : this . parts ,
502
499
sources : sources
503
500
} ;
501
+ copyFields ( project , this , EXPORTED_FIELDS ) ;
504
502
return project ;
505
503
} ,
506
504
loadProjectFromJson : function ( project ) {
@@ -515,6 +513,7 @@ var vm = new Vue({
515
513
} ) ;
516
514
} ) ) . then ( function ( ) {
517
515
that . parts = project . parts ;
516
+ copyFields ( that , project , EXPORTED_FIELDS ) ;
518
517
that . refreshParts ( ) ;
519
518
that . navigateTo ( 0 ) ;
520
519
} ) ;
0 commit comments