Fix Jukebox incorrectly discarding songs
This commit is contained in:
		
							parent
							
								
									16a65eea99
								
							
						
					
					
						commit
						f1e65959a0
					
				| @ -536,22 +536,22 @@ void AreaData::toggleJukebox() | ||||
| QString AreaData::addJukeboxSong(QString f_song) | ||||
| { | ||||
|     if(!m_jukebox_queue.contains(f_song)) { | ||||
|         if (m_jukebox_queue.size() == 0) { | ||||
|             int l_song_duration = ConfigManager::songInformation(f_song); | ||||
|             if (l_song_duration >= 0) { | ||||
|                 emit playJukeboxSong(AOPacket("MC",{f_song,QString::number(-1)}), index()); | ||||
|                 m_jukebox_timer->start(l_song_duration * 1000); | ||||
|             if (l_song_duration > 0) { | ||||
|                 if (m_jukebox_queue.size() == 0) { | ||||
|                     emit playJukeboxSong(AOPacket("MC",{f_song,QString::number(-1)}), index()); | ||||
|                     m_jukebox_timer->start(l_song_duration * 1000); | ||||
|                 } | ||||
|                 setCurrentMusic(f_song); | ||||
|                 setMusicPlayedBy("Jukebox"); | ||||
|                 m_jukebox_queue.append(f_song); | ||||
|                 return "Song added to Jukebox."; | ||||
|             } | ||||
|         } | ||||
|         return "Unable to add song. Duration shorther than 1."; | ||||
|     } | ||||
|     else { | ||||
|         return "Unable to add song. Song already in Jukebox."; | ||||
|             else { | ||||
|                 return "Unable to add song. Duration shorther than 1."; | ||||
|             } | ||||
|     } | ||||
|     return "Unable to add song. Song already in Jukebox."; | ||||
| } | ||||
| 
 | ||||
| void AreaData::switchJukeboxSong() | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Salanto
						Salanto