Skip to content

Commit

Permalink
fix issue d0u9#35
Browse files Browse the repository at this point in the history
- int values from config.json are loaded properly now
- added ratelimit and outtmpl parameters in Preferences windows
  • Loading branch information
zaharcelac committed Feb 26, 2021
1 parent 65e3e3d commit b6903a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions youtube_dl_webui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def load(self, conf_dict):
# More check can be made here
if key in conf_dict:
self._conf[key] = conf_dict[key] if func is None else func(conf_dict.get(key, dft_val))
self._conf[key] = int(self._conf[key]) if val_type == 'int' else self._conf[key]
elif dft_val is not None:
self._conf[key] = dft_val if func is None else func(conf_dict.get(key, dft_val))

Expand Down
4 changes: 3 additions & 1 deletion youtube_dl_webui/static/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var videoDownload = (function (Vue, extendAM){
modalData: {
add: { url: '', ydl_opts: {} },
remove: { removeFile: false },
preference: {youtube_dl: {fomart: '', proxy: ''}, general: {download_dir: '', db_path: '', log_size: ''}},
preference: {youtube_dl: {fomart: '', proxy: ''}, general: {download_dir: '', db_path: '', log_size: '', ratelimit: '', outtmpl: ''}},
},
currentSelected: null,
taskDetails: {},
Expand Down Expand Up @@ -158,6 +158,8 @@ var videoDownload = (function (Vue, extendAM){
_self.modalData.preference.general.log_size = config.general.log_size;
_self.modalData.preference.youtube_dl.format = config.youtube_dl.format;
_self.modalData.preference.youtube_dl.proxy = config.youtube_dl.proxy;
_self.modalData.preference.youtube_dl.ratelimit = config.youtube_dl.ratelimit;
_self.modalData.preference.youtube_dl.outtmpl = config.youtube_dl.outtmpl;
}
});
},
Expand Down
6 changes: 6 additions & 0 deletions youtube_dl_webui/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@
<div>
<label>Proxy:</label><input type="text" ref="proxy" v-model="modalData.preference.youtube_dl.proxy" v-cloak @keyup.esc="showModal = false"/>
</div>
<div>
<label>Out Tmpl:</label><input type="text" ref="outtmpl" v-model="modalData.preference.youtube_dl.outtmpl" v-cloak @keyup.esc="showModal = false"/>
</div>
<div>
<label>Rate Limit:</label><input type="text" ref="ratelimit" v-model="modalData.preference.youtube_dl.ratelimit" v-cloak @keyup.esc="showModal = false"/>
</div>
</div>
<div slot="footer">
<button class="modal-default-button" @click="updatePreference" style="width:auto;">save</button>
Expand Down

0 comments on commit b6903a1

Please sign in to comment.