Compare commits

..

No commits in common. "28e48220c2d6a3b3986329e553eab2e887810ec6" and "8127242487e4b687d99c0f81b00d2e12b2a4a920" have entirely different histories.

4 changed files with 8 additions and 15 deletions

View file

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.3
current_version = 0.4.2
commit = True
tag = True

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "ucast"
version = "0.4.3"
version = "0.4.2"
description = "YouTube to Podcast converter"
authors = ["Theta-Dev <t.testboy@gmail.com>"]
packages = [

View file

@ -1,4 +1,4 @@
__version__ = "0.4.3"
__version__ = "0.4.2"
def template_context(request):

View file

@ -2,7 +2,6 @@ import redis
import rq
import rq_scheduler
from django.conf import settings
from django.db.models import ObjectDoesNotExist
from rq import registry
from ucast.models import Video
@ -95,21 +94,15 @@ def get_failed_job_registry():
def get_downloading_videos(offset=0, limit=-1):
queue = get_queue()
v_ids = set()
videos = {}
for job in queue.get_jobs(offset, limit):
if (
job.func_name == "ucast.tasks.download.download_video"
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 = []
for v_id in v_ids:
try:
videos.append(Video.objects.get(id=v_id))
except ObjectDoesNotExist:
pass
return videos
return list(videos.values())