Merge pull request #159 from arabcoders/dev
fix cancelling selected items.
This commit is contained in:
commit
4094e98feb
3 changed files with 16 additions and 2 deletions
|
|
@ -97,6 +97,9 @@ class Download:
|
|||
if data.get("postprocessor") != "MoveFiles" or data.get("status") != "finished":
|
||||
return
|
||||
|
||||
if self.debug:
|
||||
LOG.debug(f"Postprocessor hook: {data}")
|
||||
|
||||
if "__finaldir" in data["info_dict"]:
|
||||
filename = os.path.join(data["info_dict"]["__finaldir"], os.path.basename(data["info_dict"]["filepath"]))
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ class DownloadQueue:
|
|||
if property in entry:
|
||||
etr[f"playlist_{property}"] = entry.get(property)
|
||||
|
||||
if "thumbnail" not in etr and "youtube:" in entry.get("extractor", ""):
|
||||
etr["thumbnail"] = f"https://img.youtube.com/vi/{etr['id']}/maxresdefault.jpg"
|
||||
|
||||
results.append(
|
||||
await self.__add_entry(
|
||||
entry=etr,
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="column is-half-mobile">
|
||||
<button type="button" class="button is-fullwidth is-danger" :disabled="!hasSelected"
|
||||
@click="$emit('deleteItem', 'queue', selectedElms); selectedElms = []">
|
||||
<button type="button" class="button is-fullwidth is-danger" :disabled="!hasSelected" @click="cancelSelected">
|
||||
<span class="icon-text is-block">
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-trash-can" />
|
||||
|
|
@ -253,6 +252,15 @@ const confirmCancel = item => {
|
|||
return true;
|
||||
}
|
||||
|
||||
const cancelSelected = () => {
|
||||
if (true !== confirm('Are you sure you want to cancel selected items?')) {
|
||||
return false;
|
||||
}
|
||||
cancelItems(selectedElms.value);
|
||||
selectedElms.value = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
const cancelItems = item => {
|
||||
const items = []
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue