using System.IO;
using System.Linq;

namespace AmiReel.Models;

/// <summary>
/// Video file extensions accepted as render sources. FFmpeg can demux far more than this,
/// but this list covers what a screen/video capture workflow is realistically going to produce.
/// </summary>
public static class SupportedVideoFormats
{
    public static readonly IReadOnlyList<string> Extensions =
    [
        ".avi", ".mp4", ".m4v", ".mov", ".mkv", ".webm",
        ".wmv", ".flv", ".mpg", ".mpeg", ".ts", ".3gp"
    ];

    public static bool IsSupported(string path) =>
        Extensions.Contains(Path.GetExtension(path), StringComparer.OrdinalIgnoreCase);

    /// <summary>Picker filter string, e.g. "*.avi;*.mp4;*.m4v;...".</summary>
    public static string PickerFilter => string.Join(';', Extensions.Select(e => "*" + e));
}
