mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-19 15:25:51 +00:00
set vid_type for pending items in ta_download
This commit is contained in:
parent
3db6077adf
commit
7941b0412b
@ -129,14 +129,18 @@ class StartupCheck:
|
||||
|
||||
def es_set_vid_type(self):
|
||||
"""update path 0.3.0 to 0.3.1, set default vid_type to video"""
|
||||
index_list = ["ta_video", "ta_download"]
|
||||
data = {
|
||||
"query": {
|
||||
"bool": {"must_not": [{"exists": {"field": "vid_type"}}]}
|
||||
},
|
||||
"script": {"source": "ctx._source['vid_type'] = 'video'"},
|
||||
}
|
||||
response, _ = ElasticWrap("ta_video/_update_by_query").post(data=data)
|
||||
print(f"ta_video vid_type index update ran: {response}")
|
||||
|
||||
for index_name in index_list:
|
||||
path = f"{index_name}/_update_by_query"
|
||||
response, _ = ElasticWrap(path).post(data=data)
|
||||
print(f"{index_name} vid_type index update ran: {response}")
|
||||
|
||||
|
||||
class HomeConfig(AppConfig):
|
||||
|
@ -96,7 +96,7 @@
|
||||
<button data-id="{{ video.source.youtube_id }}" onclick="addSingle(this)">Add to queue</button>
|
||||
{% else %}
|
||||
<button data-id="{{ video.source.youtube_id }}" onclick="toIgnore(this)">Ignore</button>
|
||||
<button id="{{ video.source.youtube_id }}" data-id="{{ video.source.youtube_id }}" onclick="downloadNow(this)">Download now</button>
|
||||
<button id="{{ video.source.youtube_id }}" data-id="{{ video.source.youtube_id }}" data-type="{{ video.source.vid_type }}" onclick="downloadNow(this)">Download now</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user