Skip to content

Commit

Permalink
specifiy video format when adding task
Browse files Browse the repository at this point in the history
  • Loading branch information
d0u9 committed Sep 27, 2017
1 parent b7e47e8 commit df33112
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions youtube_dl_webui/static/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var videoDownload = (function (Vue, extendAM){
showTab: 'Status',
stateCounter: { all: 0, downloading: 0, finished: 0, paused: 0, invalid: 0},
modalData: {
add: { url: '' },
add: { url: '', ydl_opts: {} },
remove: {removeFile: false }
},
currentSelected: null,
Expand Down Expand Up @@ -73,9 +73,12 @@ var videoDownload = (function (Vue, extendAM){
this.modalType = 'removeTask';
},
addTask: function(){
console.log(this.modalData.add);
var _self = this;
var url = _self.headPath + 'task';
for (var key in _self.modalData.add.ydl_opts) {
if (_self.modalData.add.ydl_opts[key].trim() == '')
delete _self.modalData.add.ydl_opts[key];
}
Vue.http.post(url, _self.modalData.add, {emulateJSON: false}).then(function(res){
_self.showModal = false;
that.getTaskList();
Expand Down
2 changes: 1 addition & 1 deletion youtube_dl_webui/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<hr class="left-hr" /><span style="font-weight: bold;">youtube-dl options</span><hr class="right-hr" />
</div>
<div>
<label>Format:</label><input type="text" ref="format" v-model="modalData.format" v-cloak @keyup.esc="showModal = false"/>
<label>Format:</label><input type="text" ref="format" v-model="modalData.add.ydl_opts.format" v-cloak @keyup.esc="showModal = false"/>
</div>
</div>
</template>
Expand Down

0 comments on commit df33112

Please sign in to comment.