Use other timestamp for videos.
Easier to manipulate timestamp via exiftool this way.
This commit is contained in:
		@ -273,8 +273,21 @@ class Photo(object):
 | 
				
			|||||||
					self._attributes["rotate"] = s["tags"]["rotate"]
 | 
										self._attributes["rotate"] = s["tags"]["rotate"]
 | 
				
			||||||
				if original:
 | 
									if original:
 | 
				
			||||||
					self._attributes["originalSize"] = (int(s["width"]), int(s["height"]))
 | 
										self._attributes["originalSize"] = (int(s["width"]), int(s["height"]))
 | 
				
			||||||
 | 
									# we break, because a video can contain several streams
 | 
				
			||||||
 | 
									# this way we only get/use values from the first stream
 | 
				
			||||||
				break
 | 
									break
 | 
				
			||||||
				
 | 
									
 | 
				
			||||||
 | 
							# use time from EXIF (rather than file creation)
 | 
				
			||||||
 | 
							if info['format']['tags']['creation_time']:
 | 
				
			||||||
 | 
								# we have time modifiable via exif
 | 
				
			||||||
 | 
								# lets use this
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								try:
 | 
				
			||||||
 | 
									self._attributes["videoCreateDate"] = datetime.strptime(info['format']['tags']['creation_time'], '%Y-%m-%d %H:%M:%S')
 | 
				
			||||||
 | 
								except KeyboardInterrupt:
 | 
				
			||||||
 | 
									raise
 | 
				
			||||||
 | 
								except TypeError:
 | 
				
			||||||
 | 
									pass
 | 
				
			||||||
						
 | 
											
 | 
				
			||||||
	def _photo_thumbnail(self, original_path, thumb_path, size, square=False):
 | 
						def _photo_thumbnail(self, original_path, thumb_path, size, square=False):
 | 
				
			||||||
		try:
 | 
							try:
 | 
				
			||||||
@ -518,7 +531,9 @@ class Photo(object):
 | 
				
			|||||||
		correct_date = None;
 | 
							correct_date = None;
 | 
				
			||||||
		if not self.is_valid:
 | 
							if not self.is_valid:
 | 
				
			||||||
			correct_date = datetime(1900, 1, 1)
 | 
								correct_date = datetime(1900, 1, 1)
 | 
				
			||||||
		if "dateTimeOriginal" in self._attributes:
 | 
							if "videoCreateDate" in self._attributes:
 | 
				
			||||||
 | 
								correct_date = self._attributes["videoCreateDate"]
 | 
				
			||||||
 | 
							elif "dateTimeOriginal" in self._attributes:
 | 
				
			||||||
			correct_date = self._attributes["dateTimeOriginal"]
 | 
								correct_date = self._attributes["dateTimeOriginal"]
 | 
				
			||||||
		elif "dateTime" in self._attributes:
 | 
							elif "dateTime" in self._attributes:
 | 
				
			||||||
			correct_date = self._attributes["dateTime"]
 | 
								correct_date = self._attributes["dateTime"]
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user