< Summary

Information
Class: Anichron.API.Endpoints.ProxyKinds
Assembly: Anichron.API
File(s): /home/runner/work/anichron/anichron/src/Anichron.API/Endpoints/ProxyKinds.cs
Tag: 19_45211875487
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 28
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_All()100%11100%
FromSlug(...)100%11100%
UrlOf(...)100%11100%
Table()100%11100%

File(s)

/home/runner/work/anichron/anichron/src/Anichron.API/Endpoints/ProxyKinds.cs

#LineLine coverage
 1using Anichron.API.Infrastructure;
 2using Anichron.Core.Domain;
 3
 4namespace Anichron.API.Endpoints;
 5
 6internal sealed record ProxyKind(ProxyType Type, string Slug, string ContentType);
 7
 8internal static class ProxyKinds
 9{
 19010    internal static IReadOnlyList<ProxyKind> All => Table();
 11
 12    internal static ProxyKind? FromSlug(string slug)
 2913        => All.FirstOrDefault(kind => kind.Slug == slug);
 14
 15    internal static string UrlOf(Guid assetId, ProxyType type, string contentHash)
 2816        => ApiPaths.Proxies.ProxyUrl(assetId, All.Single(kind => kind.Type == type).Slug, contentHash);
 17
 18    private static ProxyKind[] Table()
 19019    {
 19020        return
 19021        [
 19022            new(ProxyType.Thumbnail, "thumbnail", "image/jpeg"),
 19023            new(ProxyType.FullPreview, "preview", "image/jpeg"),
 19024            new(ProxyType.CompactPreview, "compact-preview", "image/jxl"),
 19025            new(ProxyType.WebVideo, "video", "video/mp4"),
 19026        ];
 19027    }
 28}