Compare commits
No commits in common. "28e48220c2d6a3b3986329e553eab2e887810ec6" and "8127242487e4b687d99c0f81b00d2e12b2a4a920" have entirely different histories.
28e48220c2
...
8127242487
4 changed files with 8 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.4.3
|
current_version = 0.4.2
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "ucast"
|
name = "ucast"
|
||||||
version = "0.4.3"
|
version = "0.4.2"
|
||||||
description = "YouTube to Podcast converter"
|
description = "YouTube to Podcast converter"
|
||||||
authors = ["Theta-Dev <t.testboy@gmail.com>"]
|
authors = ["Theta-Dev <t.testboy@gmail.com>"]
|
||||||
packages = [
|
packages = [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
__version__ = "0.4.3"
|
__version__ = "0.4.2"
|
||||||
|
|
||||||
|
|
||||||
def template_context(request):
|
def template_context(request):
|
||||||
|
|
|
@ -2,7 +2,6 @@ import redis
|
||||||
import rq
|
import rq
|
||||||
import rq_scheduler
|
import rq_scheduler
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.models import ObjectDoesNotExist
|
|
||||||
from rq import registry
|
from rq import registry
|
||||||
|
|
||||||
from ucast.models import Video
|
from ucast.models import Video
|
||||||
|
@ -95,21 +94,15 @@ def get_failed_job_registry():
|
||||||
|
|
||||||
def get_downloading_videos(offset=0, limit=-1):
|
def get_downloading_videos(offset=0, limit=-1):
|
||||||
queue = get_queue()
|
queue = get_queue()
|
||||||
v_ids = set()
|
videos = {}
|
||||||
|
|
||||||
for job in queue.get_jobs(offset, limit):
|
for job in queue.get_jobs(offset, limit):
|
||||||
if (
|
if (
|
||||||
job.func_name == "ucast.tasks.download.download_video"
|
job.func_name == "ucast.tasks.download.download_video"
|
||||||
and job.args
|
and job.args
|
||||||
and job.args[0] > 0
|
and isinstance(job.args[0], Video)
|
||||||
):
|
):
|
||||||
v_ids.add(job.args[0])
|
video = job.args[0]
|
||||||
|
videos[video.id] = video
|
||||||
|
|
||||||
videos = []
|
return list(videos.values())
|
||||||
for v_id in v_ids:
|
|
||||||
try:
|
|
||||||
videos.append(Video.objects.get(id=v_id))
|
|
||||||
except ObjectDoesNotExist:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return videos
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue