mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-11-03 22:21:55 +00:00 
			
		
		
		
	Update assets/js/watched_widget.js with suggestion of AHOHNMYC
Co-authored-by: AHOHNMYC <24810600+AHOHNMYC@users.noreply.github.com>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							d3d9cfdd0d
						
					
				
				
					commit
					4aa696fa6e
				
			@@ -39,11 +39,9 @@ function get_all_video_times() {
 | 
			
		||||
    return helpers.storage.get(save_player_pos_key) || {};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var watchedIndicators = document.getElementsByClassName('watched-indicator');
 | 
			
		||||
for (var i = 0; i < watchedIndicators.length; i++) {
 | 
			
		||||
    var indicator = watchedIndicators[i];
 | 
			
		||||
    var watched_part = get_all_video_times()[indicator.getAttribute('data-id')];
 | 
			
		||||
    var total = parseInt(indicator.getAttribute('data-length'), 10);
 | 
			
		||||
document.querySelectorAll('.watched-indicator').forEach(function (indicator) {
 | 
			
		||||
    var watched_part = get_all_video_times()[indicator.dataset.id];
 | 
			
		||||
    var total = parseInt(indicator.dataset.length, 10);
 | 
			
		||||
    if (watched_part === undefined) {
 | 
			
		||||
        watched_part = total;
 | 
			
		||||
    }
 | 
			
		||||
@@ -57,4 +55,4 @@ for (var i = 0; i < watchedIndicators.length; i++) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    indicator.style.width = percentage + '%';
 | 
			
		||||
}
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user