fix: save playlist problem
This commit is contained in:
		
							
								
								
									
										13
									
								
								mumbleBot.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								mumbleBot.py
									
									
									
									
									
								
							@@ -583,12 +583,15 @@ class MumbleBot:
 | 
				
			|||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
                        self._loop_status = 'Empty queue'
 | 
					                        self._loop_status = 'Empty queue'
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    if var.playlist.current_item()["ready"] != "downloading":
 | 
					                    if var.playlist.current_item():
 | 
				
			||||||
                        self.wait_for_downloading = False
 | 
					                        if var.playlist.current_item()["ready"] != "downloading":
 | 
				
			||||||
                        self.launch_music()
 | 
					                            self.wait_for_downloading = False
 | 
				
			||||||
                        self.async_download_next()
 | 
					                            self.launch_music()
 | 
				
			||||||
 | 
					                            self.async_download_next()
 | 
				
			||||||
 | 
					                        else:
 | 
				
			||||||
 | 
					                            self._loop_status = 'Wait for downloading'
 | 
				
			||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
                        self._loop_status = 'Wait for downloading'
 | 
					                        self.wait_for_downloading = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        while self.mumble.sound_output.get_buffer_size() > 0:
 | 
					        while self.mumble.sound_output.get_buffer_size() > 0:
 | 
				
			||||||
            # Empty the buffer before exit
 | 
					            # Empty the buffer before exit
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -218,9 +218,8 @@ class PlayList(list):
 | 
				
			|||||||
        var.db.set("playlist", "current_index", self.current_index)
 | 
					        var.db.set("playlist", "current_index", self.current_index)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for index, music in enumerate(self):
 | 
					        for index, music in enumerate(self):
 | 
				
			||||||
            for music in self:
 | 
					            if music['type'] == 'url' and music['ready'] == 'downloading':
 | 
				
			||||||
                if music['type'] == 'url' and music['ready'] == 'downloading':
 | 
					                music['ready'] = 'no'
 | 
				
			||||||
                    music['ready'] = 'no'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var.db.set("playlist_item", str(index), json.dumps(music))
 | 
					            var.db.set("playlist_item", str(index), json.dumps(music))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user