mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 03:44:49 +00:00 
			
		
		
		
	Remove Smart/Fancy Left/Right Quotation Marks from Filename Sanitizer
This commit is contained in:
		
							parent
							
								
									8df04de1ea
								
							
						
					
					
						commit
						301c026ca9
					
				@ -111,7 +111,7 @@ def sanitize_filename(filename: str, spacer: str = ".") -> str:
 | 
			
		||||
        replace("/", " & ").\
 | 
			
		||||
        replace(";", " & ")  # e.g. multi-episode filenames
 | 
			
		||||
    filename = re.sub(r"[:; ]", spacer, filename)  # structural chars to (spacer)
 | 
			
		||||
    filename = re.sub(r"[\\*!?¿,'\"()<>|$#]", "", filename)  # not filename safe chars
 | 
			
		||||
    filename = re.sub(r"[\\*!?¿,'\"“”()<>|$#]", "", filename)  # not filename safe chars
 | 
			
		||||
    filename = re.sub(rf"[{spacer}]{{2,}}", spacer, filename)  # remove extra neighbouring (spacer)s
 | 
			
		||||
 | 
			
		||||
    return filename
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user