mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
645 B
17 lines
645 B
using ErsatzTV.Core.Domain; |
|
|
|
namespace ErsatzTV.Application.Graphics; |
|
|
|
public static class Mapper |
|
{ |
|
public static GraphicsElementViewModel ProjectToViewModel(GraphicsElement graphicsElement) |
|
{ |
|
var 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}"), |
|
_ => new GraphicsElementViewModel(graphicsElement.Id, graphicsElement.Path) |
|
}; |
|
} |
|
} |