remove whenAnnexed and ifAnnexed
In preparation for adding a new variation on lookupKey. Sponsored-by: Max Thoursie on Patreon
This commit is contained in:
		
					parent
					
						
							
								1944549a38
							
						
					
				
			
			
				commit
				
					
						b2ee2496ee
					
				
			
		
					 12 changed files with 56 additions and 36 deletions
				
			
		| 
						 | 
				
			
			@ -40,6 +40,7 @@ import Command.AddUrl (addUrlFile, downloadRemoteFile, parseDownloadOptions, Dow
 | 
			
		|||
import Annex.UUID
 | 
			
		||||
import Backend.URL (fromUrl)
 | 
			
		||||
import Annex.Content
 | 
			
		||||
import Annex.WorkTree
 | 
			
		||||
import Annex.YoutubeDl
 | 
			
		||||
import Types.MetaData
 | 
			
		||||
import Logs.MetaData
 | 
			
		||||
| 
						 | 
				
			
			@ -297,7 +298,9 @@ performDownload' started addunlockedmatcher opts cache todownload = case locatio
 | 
			
		|||
	 - to be re-downloaded. -}
 | 
			
		||||
	makeunique url n file = ifM alreadyexists
 | 
			
		||||
		( ifM forced
 | 
			
		||||
			( ifAnnexed (toRawFilePath f) checksameurl tryanother
 | 
			
		||||
			( lookupKey (toRawFilePath f) >>= \case
 | 
			
		||||
				Just k -> checksameurl k
 | 
			
		||||
				Nothing -> tryanother
 | 
			
		||||
			, tryanother
 | 
			
		||||
			)
 | 
			
		||||
		, return $ Just f
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue