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":
|
if data.get("postprocessor") != "MoveFiles" or data.get("status") != "finished":
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.debug:
|
||||||
|
LOG.debug(f"Postprocessor hook: {data}")
|
||||||
|
|
||||||
if "__finaldir" in data["info_dict"]:
|
if "__finaldir" in data["info_dict"]:
|
||||||
filename = os.path.join(data["info_dict"]["__finaldir"], os.path.basename(data["info_dict"]["filepath"]))
|
filename = os.path.join(data["info_dict"]["__finaldir"], os.path.basename(data["info_dict"]["filepath"]))
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,9 @@ class DownloadQueue:
|
||||||
if property in entry:
|
if property in entry:
|
||||||
etr[f"playlist_{property}"] = entry.get(property)
|
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(
|
results.append(
|
||||||
await self.__add_entry(
|
await self.__add_entry(
|
||||||
entry=etr,
|
entry=etr,
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-half-mobile">
|
<div class="column is-half-mobile">
|
||||||
<button type="button" class="button is-fullwidth is-danger" :disabled="!hasSelected"
|
<button type="button" class="button is-fullwidth is-danger" :disabled="!hasSelected" @click="cancelSelected">
|
||||||
@click="$emit('deleteItem', 'queue', selectedElms); selectedElms = []">
|
|
||||||
<span class="icon-text is-block">
|
<span class="icon-text is-block">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<i class="fa-solid fa-trash-can" />
|
<i class="fa-solid fa-trash-can" />
|
||||||
|
|
@ -253,6 +252,15 @@ const confirmCancel = item => {
|
||||||
return true;
|
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 cancelItems = item => {
|
||||||
const items = []
|
const items = []
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue