diff --git a/tubearchivist/api/views.py b/tubearchivist/api/views.py index a872d504..14f547f6 100644 --- a/tubearchivist/api/views.py +++ b/tubearchivist/api/views.py @@ -443,7 +443,7 @@ class DownloadApiView(ApiBaseView): # pylint: disable=unused-argument """delete single video from queue""" print(f"{video_id}: delete from queue") - PendingInteract(video_id=video_id).delete_item() + PendingInteract(video_id).delete_item() return Response({"success": True}) diff --git a/tubearchivist/home/src/download/queue.py b/tubearchivist/home/src/download/queue.py index 7c81ebf0..ee7ba462 100644 --- a/tubearchivist/home/src/download/queue.py +++ b/tubearchivist/home/src/download/queue.py @@ -96,13 +96,13 @@ class PendingIndex: class PendingInteract: """interact with items in download queue""" - def __init__(self, video_id=False, status=False): - self.video_id = video_id + def __init__(self, youtube_id=False, status=False): + self.youtube_id = youtube_id self.status = status def delete_item(self): """delete single item from pending""" - path = f"ta_download/_doc/{self.video_id}" + path = f"ta_download/_doc/{self.youtube_id}" _, _ = ElasticWrap(path).delete(refresh=True) def delete_by_status(self): @@ -114,12 +114,12 @@ class PendingInteract: def update_status(self): """update status field of pending item""" data = {"doc": {"status": self.status}} - path = f"ta_download/_update/{self.video_id}" + path = f"ta_download/_update/{self.youtube_id}" _, _ = ElasticWrap(path).post(data=data) def get_item(self): """return pending item dict""" - path = f"ta_download/_doc/{self.video_id}" + path = f"ta_download/_doc/{self.youtube_id}" response, status_code = ElasticWrap(path).get() return response["_source"], status_code