mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-11-03 19:17:05 -05: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)
 | 
						|
        };
 | 
						|
    }
 | 
						|
}
 |