| 
					
				 | 
			
			
				@@ -1,15 +1,16 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # variables 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mpc="/usr/bin/mpc -h $mpd_host" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+music="/music/" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # functions 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function mpd_play_folder { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   tag = $1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  mkdir -p /music/$tag 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  mkdir -p $music$tag 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   # Update the directory timestamp to indicate the last tag seen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   # Touch the file alone will not update the directory timestamp, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   # so we'll need delete and re-create the file 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  rm /music/$tag/.lastplay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  touch /music/$tag/.lastplay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  rm $music$tag/.lastplay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  touch $music$tag/.lastplay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   $mpc stop 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   $mpc clear 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   $mpc add $mpd_folder$tag 
			 |