mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-10-31 02:27:04 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			513 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			513 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.IO;
 | |
| using System.IO.Compression;
 | |
| using System.Linq;
 | |
| 
 | |
| namespace API.Extensions
 | |
| {
 | |
|     public static class ZipArchiveExtensions
 | |
|     {
 | |
|         /// <summary>
 | |
|         /// Checks if archive has one or more files. Excludes directory entries. 
 | |
|         /// </summary>
 | |
|         /// <param name="archive"></param>
 | |
|         /// <returns></returns>
 | |
|         public static bool HasFiles(this ZipArchive archive)
 | |
|         {
 | |
|             return archive.Entries.Any(x => Path.HasExtension(x.FullName));
 | |
|         }
 | |
|     }
 | |
| } |