瀏覽代碼

Fix: Create TEMP_DIR

Satoshi Yoneda 6 年之前
父節點
當前提交
946f9755c3
共有 1 個文件被更改,包括 4 次插入4 次删除
  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