mirror of
				https://git.sr.ht/~cadence/cloudtube
				synced 2025-10-31 11:35:35 +00:00 
			
		
		
		
	Show watched state on channel videos
This commit is contained in:
		
							parent
							
								
									2faaa2e18b
								
							
						
					
					
						commit
						637f648fc7
					
				| @ -12,6 +12,13 @@ module.exports = [ | ||||
| 			const data = await fetchChannel(id, settings.instance) | ||||
| 			const subscribed = user.isSubscribed(id) | ||||
| 			const instanceOrigin = settings.instance | ||||
| 			// apply watched status
 | ||||
| 			const watchedVideos = user.getWatchedVideos() | ||||
| 			if (data.latestVideos) { | ||||
| 				data.latestVideos.forEach(video => { | ||||
| 					video.watched = watchedVideos.includes(video.videoId) | ||||
| 				}) | ||||
| 			} | ||||
| 			return render(200, "pug/channel.pug", {data, subscribed, instanceOrigin}) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @ -39,10 +39,3 @@ | ||||
| 
 | ||||
| #watched-videos-display:checked ~ .video-list-item--watched | ||||
|   display: none | ||||
| 
 | ||||
| .video-list-item--watched | ||||
|   background: c.$bg-darker | ||||
|   padding: 8px 8px 0px | ||||
| 
 | ||||
|   .thumbnail .image | ||||
|     opacity: 0.4 | ||||
|  | ||||
| @ -16,6 +16,17 @@ | ||||
|   align-content: start | ||||
|   margin-bottom: 12px | ||||
| 
 | ||||
|   @at-root .video-list-item--watched#{&} | ||||
|     background: c.$bg-darker | ||||
|     padding: 8px 8px 0px | ||||
|     margin: -8px -8px 12px | ||||
| 
 | ||||
|     .thumbnail | ||||
|       margin-bottom: 8px | ||||
| 
 | ||||
|     .image | ||||
|       opacity: 0.4 | ||||
| 
 | ||||
|   .thumbnail | ||||
|     position: relative | ||||
|     display: flex | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user