mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 03:44:49 +00:00 
			
		
		
		
	fix(Chapter): Cast values to int prior to formatting
If left as float, then it parses as e.g., `7.0` instead of `07`. This leads to the timestamp format being completely off.
This commit is contained in:
		
							parent
							
								
									10285c3819
								
							
						
					
					
						commit
						5d1b54b8fa
					
				@ -41,7 +41,7 @@ class Chapter:
 | 
				
			|||||||
                seconds, ms = divmod(int(remainder * 1000), 1000)
 | 
					                seconds, ms = divmod(int(remainder * 1000), 1000)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                raise TypeError
 | 
					                raise TypeError
 | 
				
			||||||
            timestamp = f"{hours:02}:{minutes:02}:{seconds:02}.{str(ms).zfill(3)[:3]}"
 | 
					            timestamp = f"{int(hours):02}:{int(minutes):02}:{int(seconds):02}.{str(ms).zfill(3)[:3]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        timestamp_m = TIMESTAMP_FORMAT.match(timestamp)
 | 
					        timestamp_m = TIMESTAMP_FORMAT.match(timestamp)
 | 
				
			||||||
        if not timestamp_m:
 | 
					        if not timestamp_m:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user