account for duration in metadata that is set, but has a null value
This commit is contained in:
		
							parent
							
								
									62e2e2f9e6
								
							
						
					
					
						commit
						61cd63bcc1
					
				| 
						 | 
					@ -999,7 +999,10 @@ class Media(models.Model):
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def duration(self):
 | 
					    def duration(self):
 | 
				
			||||||
        field = self.get_metadata_field('duration')
 | 
					        field = self.get_metadata_field('duration')
 | 
				
			||||||
        return int(self.loaded_metadata.get(field, 0))
 | 
					        duration = self.loaded_metadata.get(field, 0)
 | 
				
			||||||
 | 
					        if not isinstance(duration, int):
 | 
				
			||||||
 | 
					            duration = 0
 | 
				
			||||||
 | 
					        return duration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def duration_formatted(self):
 | 
					    def duration_formatted(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue