mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Always create a backup list when shuffling
The backup-list has to be created at all cost (even when current list size <= 2). Otherwise it's not possible to enter shuffle-mode (as ``isShuffled()`` always returns false)!
This commit is contained in:
		| @@ -436,14 +436,16 @@ public abstract class PlayQueue implements Serializable { | ||||
|      * top, so shuffling a size-2 list does nothing) | ||||
|      */ | ||||
|     public synchronized void shuffle() { | ||||
|         // Create a backup if it doesn't already exist | ||||
|         // Note: The backup-list has to be created at all cost (even when size <= 2). | ||||
|         // Otherwise it's not possible to enter shuffle-mode! | ||||
|         if (backup == null) { | ||||
|             backup = new ArrayList<>(streams); | ||||
|         } | ||||
|         // Can't shuffle an list that's empty or only has one element | ||||
|         if (size() <= 2) { | ||||
|             return; | ||||
|         } | ||||
|         // Create a backup if it doesn't already exist | ||||
|         if (backup == null) { | ||||
|             backup = new ArrayList<>(streams); | ||||
|         } | ||||
|  | ||||
|         final int originalIndex = getIndex(); | ||||
|         final PlayQueueItem currentItem = getItem(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 litetex
					litetex