mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-04 19:30:13 +00:00
process subtitle media url paths
This commit is contained in:
parent
3ea5e9c537
commit
16f33feda0
@ -60,6 +60,12 @@ class ApiBaseView(APIView):
|
|||||||
cache_dir = self.default_conf["application"]["cache_dir"]
|
cache_dir = self.default_conf["application"]["cache_dir"]
|
||||||
new_thumb = f"{cache_dir}/{vid_thumb_url}"
|
new_thumb = f"{cache_dir}/{vid_thumb_url}"
|
||||||
self.response["data"]["vid_thumb_url"] = new_thumb
|
self.response["data"]["vid_thumb_url"] = new_thumb
|
||||||
|
if "subtitles" in all_keys:
|
||||||
|
all_subtitles = self.response["data"]["subtitles"]
|
||||||
|
for idx, _ in enumerate(all_subtitles):
|
||||||
|
url = self.response["data"]["subtitles"][idx]["media_url"]
|
||||||
|
new_url = f"/media/{url}"
|
||||||
|
self.response["data"]["subtitles"][idx]["media_url"] = new_url
|
||||||
|
|
||||||
def get_paginate(self):
|
def get_paginate(self):
|
||||||
"""add pagination detail to response"""
|
"""add pagination detail to response"""
|
||||||
|
Loading…
Reference in New Issue
Block a user