diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 6bfdcb8..837fb4f 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.3 +current_version = 0.4.2 commit = True tag = True diff --git a/pyproject.toml b/pyproject.toml index aaf8d74..106007c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ucast" -version = "0.4.3" +version = "0.4.2" description = "YouTube to Podcast converter" authors = ["Theta-Dev "] packages = [ diff --git a/ucast/__init__.py b/ucast/__init__.py index e07686c..8ade61d 100644 --- a/ucast/__init__.py +++ b/ucast/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.4.3" +__version__ = "0.4.2" def template_context(request): diff --git a/ucast/queue.py b/ucast/queue.py index 2248ab1..08c90fc 100644 --- a/ucast/queue.py +++ b/ucast/queue.py @@ -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())