mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
add config var to video.html template
This commit is contained in:
parent
552636d882
commit
236215cc4c
@ -670,7 +670,7 @@ class VideoView(View):
|
|||||||
|
|
||||||
def get(self, request, video_id):
|
def get(self, request, video_id):
|
||||||
"""get single video"""
|
"""get single video"""
|
||||||
colors, cast = self.read_config(user_id=request.user.id)
|
config_handler = AppConfig(request.user.id)
|
||||||
path = f"ta_video/_doc/{video_id}"
|
path = f"ta_video/_doc/{video_id}"
|
||||||
look_up = SearchHandler(path, config=False)
|
look_up = SearchHandler(path, config=False)
|
||||||
video_hit = look_up.get_data()
|
video_hit = look_up.get_data()
|
||||||
@ -692,9 +692,10 @@ class VideoView(View):
|
|||||||
"video": video_data,
|
"video": video_data,
|
||||||
"playlist_nav": playlist_nav,
|
"playlist_nav": playlist_nav,
|
||||||
"title": video_title,
|
"title": video_title,
|
||||||
"colors": colors,
|
"colors": config_handler.colors,
|
||||||
"cast": cast,
|
"cast": config_handler.config["application"]["enable_cast"],
|
||||||
"version": settings.TA_VERSION,
|
"version": settings.TA_VERSION,
|
||||||
|
"config": config_handler.config,
|
||||||
}
|
}
|
||||||
return render(request, "home/video.html", context)
|
return render(request, "home/video.html", context)
|
||||||
|
|
||||||
@ -711,14 +712,6 @@ class VideoView(View):
|
|||||||
|
|
||||||
return all_navs
|
return all_navs
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def read_config(user_id):
|
|
||||||
"""read config file"""
|
|
||||||
config_handler = AppConfig(user_id)
|
|
||||||
cast = config_handler.config["application"]["enable_cast"]
|
|
||||||
colors = config_handler.colors
|
|
||||||
return colors, cast
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def star_creator(rating):
|
def star_creator(rating):
|
||||||
"""convert rating float to stars"""
|
"""convert rating float to stars"""
|
||||||
|
Loading…
Reference in New Issue
Block a user