Browse Source

Fix: Create TEMP_DIR

Satoshi Yoneda 6 years ago
parent
commit
946f9755c3
1 changed files with 4 additions and 4 deletions
  1. 4 4
      tree/usr/local/bin/superdac.py

+ 4 - 4
tree/usr/local/bin/superdac.py

@@ -775,6 +775,9 @@ class AlbumArt(Worker, threading.Thread):
 		Worker.__init__(self,pm)
 		self.messageq = queue.Queue()
 		
+		if not os.path.exists(self.TEMP_DIR):
+			os.mkdir(self.TEMP_DIR)
+		
 		if os.path.exists(self.EXTRACTCA):
 			self.use_folderjpg = False
 			
@@ -792,8 +795,6 @@ class AlbumArt(Worker, threading.Thread):
 				smb = simpleSMB(song_path)
 				if smb.isEnable():
 					if smb.exists(remote_song):
-						if not os.path.exists(self.TEMP_DIR):
-							os.mkdir(self.TEMP_DIR)
 						if smb.copyTo(remote_song, self.TEMP_DIR+'/t'+ song_ext) == False:
 							return None
 						song_file = self.TEMP_DIR + '/t'+ song_ext
@@ -834,8 +835,7 @@ class AlbumArt(Worker, threading.Thread):
 					
 					if aafile is None:
 						return None
-					if not os.path.exists(self.TEMP_DIR):
-						os.mkdir(self.TEMP_DIR)
+					
 					if smb.copyTo(aafile, self.TEMP_DIR+'/aa.jpg') == False:
 						del smb
 						return None