mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-10-31 10:37:04 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			494 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			494 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using API.Entities.Enums;
 | |
| 
 | |
| namespace API.Extensions;
 | |
| #nullable enable
 | |
| 
 | |
| public static class EncodeFormatExtensions
 | |
| {
 | |
|     public static string GetExtension(this EncodeFormat encodeFormat)
 | |
|     {
 | |
|         return encodeFormat switch
 | |
|         {
 | |
|             EncodeFormat.PNG => ".png",
 | |
|             EncodeFormat.WEBP => ".webp",
 | |
|             EncodeFormat.AVIF => ".avif",
 | |
|             _ => throw new ArgumentOutOfRangeException(nameof(encodeFormat), encodeFormat, null)
 | |
|         };
 | |
|     }
 | |
| }
 |