← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 650: Fixed an issue where files with the same name but in different folders would have the same thumbn...

 

------------------------------------------------------------
revno: 650
fixes bug: https://launchpad.net/bugs/538720
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Tue 2012-04-10 22:52:25 +0100
message:
  Fixed an issue where files with the same name but in different folders would have the same thumbnail in the project files tree.
modified:
  openshot/classes/thumbnail.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/thumbnail.py'
--- openshot/classes/thumbnail.py	2012-03-22 21:39:12 +0000
+++ openshot/classes/thumbnail.py	2012-04-10 21:52:25 +0000
@@ -16,7 +16,7 @@
 #	You should have received a copy of the GNU General Public License
 #	along with OpenShot Video Editor.  If not, see <http://www.gnu.org/licenses/>.
 
-import os, threading, time
+import os, threading, time, uuid
 from PIL import Image
 from classes import files, profiles, messagebox
 
@@ -53,15 +53,19 @@
 			self.thumbnail_path = ""
 			self.file_type = "video"
 			self.label = ""
+			self.unique_id = str(uuid.uuid1())	
 			project_path = self.project.folder
 			(dirName, fileName) = os.path.split(file_location)
 			(fileBaseName, fileExtension) = os.path.splitext(fileName)
 			fileExtension = fileExtension.replace(".", "")
-			actual_thumbnail_path = project_path + "/thumbnail/" + fileBaseName + "_" + fileExtension + "_1.png"
+			
+			
+			uniqueFileBaseName = self.unique_id
+			actual_thumbnail_path = project_path + "/thumbnail/" + uniqueFileBaseName + "_" + fileExtension + "_1.png"
 
 			if only_thumbnail:
 				# just get 1 thumbnail frame
-				self.thumbnail_path = project_path + "/thumbnail/" + fileBaseName + "_" + fileExtension + "_%d.png"
+				self.thumbnail_path = project_path + "/thumbnail/" + uniqueFileBaseName + "_" + fileExtension + "_%d.png"
 				
 				# set the profile
 				self.profile = mlt.Profile("quarter_ntsc")