mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2024-10-14 01:37:15 +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):
|
||||
"""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}"
|
||||
look_up = SearchHandler(path, config=False)
|
||||
video_hit = look_up.get_data()
|
||||
@ -692,9 +692,10 @@ class VideoView(View):
|
||||
"video": video_data,
|
||||
"playlist_nav": playlist_nav,
|
||||
"title": video_title,
|
||||
"colors": colors,
|
||||
"cast": cast,
|
||||
"colors": config_handler.colors,
|
||||
"cast": config_handler.config["application"]["enable_cast"],
|
||||
"version": settings.TA_VERSION,
|
||||
"config": config_handler.config,
|
||||
}
|
||||
return render(request, "home/video.html", context)
|
||||
|
||||
@ -711,14 +712,6 @@ class VideoView(View):
|
||||
|
||||
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
|
||||
def star_creator(rating):
|
||||
"""convert rating float to stars"""
|
||||
|
Loading…
Reference in New Issue
Block a user