overhauled playlist page
fixes issue #7 A new playlist view UI! It now is more in line with the ones in these following pages: - global faves (home page) - Your Feed - Your favourites - Search It has the same 3-column grid you love from the other pages already. c: It also now displays the playlist title at the top of it.
This commit is contained in:
parent
0fb65a45bf
commit
d0ef4a9e55
|
@ -1,6 +1,17 @@
|
||||||
{{start _playlist}}
|
{{start ?playlist}}
|
||||||
<a href='watch?v={{.id}}&playlist={{.playlist}}")'>
|
<h1>Playlist "{{.playlistname}}"</h1>
|
||||||
<img src='https://i.ytimg.com/vi/{{.id}}/mqdefault.jpg'><br>
|
<div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));'>
|
||||||
{{.title}}
|
{{start _playlist}}
|
||||||
</a><br>
|
<div class='video-image-container'>
|
||||||
{{end _playlist}}
|
<a href='watch?v={{.id}}&playlist={{.playlist}}"'>
|
||||||
|
<div class='video-image' style='background-image: url(http://i.ytimg.com/vi/{{.id}}/mqdefault.jpg)'></div>
|
||||||
|
<b>{{.title}}</b></a>
|
||||||
|
</div>
|
||||||
|
{{end _playlist}}
|
||||||
|
</div>
|
||||||
|
{{else ?playlist}}
|
||||||
|
<h1>First of all, how did you get here?!</h1>
|
||||||
|
<p>Second of all, you need to give me a playlist ID, so that I know what playlist to look for. :p<br>
|
||||||
|
<i>(If you did supply one, then something went south in the backend. Sorry about that.)</i></p>
|
||||||
|
<p><a href="/">Go back to the home page</a></p>
|
||||||
|
{{end ?playlist}}
|
|
@ -3,6 +3,11 @@ title=$(curl -s "https://www.youtube.com/feeds/videos.xml?playlist_id=${get_data
|
||||||
|
|
||||||
declare -A strings
|
declare -A strings
|
||||||
|
|
||||||
|
if [[ "${get_data[list]}" ]]; then
|
||||||
|
strings[playlistname]="$title"
|
||||||
|
strings[?playlist]=true
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${cfg[template]} != 'retro' ]]; then
|
if [[ ${cfg[template]} != 'retro' ]]; then
|
||||||
meta[title]="$title"
|
meta[title]="$title"
|
||||||
#source templates/head.sh
|
#source templates/head.sh
|
||||||
|
@ -12,7 +17,7 @@ fi
|
||||||
if [[ "${get_data[list]}" ]]; then
|
if [[ "${get_data[list]}" ]]; then
|
||||||
data=$(yt-dlp --cookies ${cfg[_cookies]} -j --flat-playlist "https://www.youtube.com/playlist?list=${get_data[list]}")
|
data=$(yt-dlp --cookies ${cfg[_cookies]} -j --flat-playlist "https://www.youtube.com/playlist?list=${get_data[list]}")
|
||||||
else
|
else
|
||||||
strings[playlist]="Please specify id"
|
strings[playlist]="Please specify an ID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|
Loading…
Reference in a new issue