using ErsatzTV.Core.Domain; namespace ErsatzTV.Application.Graphics; public static class Mapper { public static GraphicsElementViewModel ProjectToViewModel(GraphicsElement graphicsElement) { string fileName = Path.GetFileName(graphicsElement.Path); return graphicsElement.Kind switch { GraphicsElementKind.Text => new GraphicsElementViewModel(graphicsElement.Id, $"text/{fileName}"), GraphicsElementKind.Image => new GraphicsElementViewModel(graphicsElement.Id, $"image/{fileName}"), GraphicsElementKind.Subtitle => new GraphicsElementViewModel(graphicsElement.Id, $"subtitle/{fileName}"), GraphicsElementKind.Motion => new GraphicsElementViewModel(graphicsElement.Id, $"motion/{fileName}"), _ => new GraphicsElementViewModel(graphicsElement.Id, graphicsElement.Path) }; } }