diff --git a/webroot/index.shs b/webroot/index.shs
index 211fec2..bf1701a 100755
--- a/webroot/index.shs
+++ b/webroot/index.shs
@@ -5,19 +5,23 @@ source ${cfg[namespace]}/templates/header.shs
declare -A strings
if [[ -s storage/faves ]]; then
- strings[favourites]=""
-else
- strings[favourites]="No favorite videos found,
you can do it first! ^w^"
+ strings[?favourites]=true
fi
+nested_declare fav
+declare -A fav_
IFS=$'\n'
for i in $(tac storage/faves); do
IFS=':'
- array=($i)
+ array=($i) # please redo me i'm stupid
if [[ ${array[1]} == '' ]]; then
break
fi
- strings[favourites]+="
";
+ fav_[favourited_by]="${array[0]}"
+ fav_[id]=${array[1]}
+ fav_[title]=${array[@]:2:999}
+ nested_add fav fav_
done
-render_unsafe strings "${cfg[namespace]}/templates/themes/${cfg[template]}/index.html"
+strings[_favourites]="fav"
+render strings "${cfg[namespace]}/templates/themes/${cfg[template]}/index.html"
diff --git a/webroot/watch.shs b/webroot/watch.shs
index 39a8caf..5a9e390 100755
--- a/webroot/watch.shs
+++ b/webroot/watch.shs
@@ -226,9 +226,9 @@ if [[ "${get_data[v]}" ]]; then
strings[comments_list]='An error ocurred during fetching comments.'
fi
-# source "${cfg[namespace]}/templates/header.shs"
-# echo "$player_render"
- strings[@player]="meow$player_render"
+ [[ "${cfg[template]}" == "default" ]] && source "${cfg[namespace]}/templates/header.shs"
+
+ strings[@player]="$player_render"
strings[@header]="$(cat "${cfg[namespace]}/templates/themes/${cfg[template]}/elements/top.html")"
strings[@footer]="$(cat "${cfg[namespace]}/templates/themes/${cfg[template]}/elements/footer.html")"
render strings "${cfg[namespace]}/templates/themes/${cfg[template]}/watch.html"