Use embedded player from artist, label, & tracks
This commit is contained in:
		
							parent
							
								
									aa1095eef2
								
							
						
					
					
						commit
						61f3dbeb5f
					
				
					 4 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -27,5 +27,5 @@ block view
 | 
			
		|||
                  span.s-tag--sponsor!= icons.get("flower", 16)
 | 
			
		||||
                  = label
 | 
			
		||||
          each preview in item.previews
 | 
			
		||||
            a.d-flex(href=preview.item_url target="_blank")
 | 
			
		||||
            a.d-flex(href=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
 | 
			
		||||
              img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,5 +27,5 @@ block view
 | 
			
		|||
                  span.s-tag--sponsor!= icons.get("compact-disc", 16)
 | 
			
		||||
                  = item.total_duration
 | 
			
		||||
          each preview in item.previews
 | 
			
		||||
            a.d-flex(href=preview.item_url target="_blank")
 | 
			
		||||
            a.d-flex(href=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
 | 
			
		||||
              img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ block view
 | 
			
		|||
                  | ☆
 | 
			
		||||
                else
 | 
			
		||||
                  = item.track_number || "-"
 | 
			
		||||
              td: a(href=item.item_url target="_blank")= item.title
 | 
			
		||||
              td: a(href=`/api/play/${item.item_type}/${item.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")= item.title
 | 
			
		||||
              td= item.artist
 | 
			
		||||
              td= item.item_title
 | 
			
		||||
              - let label = item.band_url.replace(/https?:\/\/(.*?)\.bandcamp\.com.*/, "$1")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ const sqls = {
 | 
			
		|||
 | 
			
		||||
function loadPreviews(locals, field, number, whereClause, account, filter_field, filter, filter_fuzzy) {
 | 
			
		||||
	const params = [account, number]
 | 
			
		||||
	let sql = `SELECT ${field}, item_url, item_art_url FROM (SELECT ${field}, item_url, item_art_url, row_number() OVER (PARTITION BY ${field} ORDER BY purchased DESC) AS row_number FROM item {JOIN TAG} WHERE account = ? {WHERE}) WHERE row_number <= ?`
 | 
			
		||||
	let sql = `SELECT ${field}, item_id, item_type, item_art_url FROM (SELECT ${field}, item_id, item_type, item_art_url, row_number() OVER (PARTITION BY ${field} ORDER BY purchased DESC) AS row_number FROM item {JOIN TAG} WHERE account = ? {WHERE}) WHERE row_number <= ?`
 | 
			
		||||
	sql = sql.replace("{WHERE}", whereClause)
 | 
			
		||||
	if (whereClause) {
 | 
			
		||||
		if (filter_field === "band_url" || filter_fuzzy) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue