e81c127514
- Add JSON-based config loading with XML fallback for DB and library options - Implement LibraryOptionsRepository with EF Core, migrations, and entity - Update CollectionFolder to use DB-backed options with XML fallback/backfill - Register repository in DI and initialize at startup - Use EF execution strategy for transactional DB operations - Suppress code analysis warnings in .csproj and test files - Add DATABASE_MIGRATION.md, LIBRARY_OPTIONS_DB_DESIGN.md, and WEBSOCKET_AUTHENTICATION.md - Add database.json.example and improve migration docs - Add tests for JSON config loader and update test naming warnings
36 lines
1.5 KiB
C#
36 lines
1.5 KiB
C#
// <copyright file="FfProbeKeyframeExtractorTests.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Jellyfin.MediaEncoding.Keyframes.Tests.FfProbe
|
|
{
|
|
using System.IO;
|
|
using System.Text.Json;
|
|
using Jellyfin.MediaEncoding.Keyframes.FfProbe;
|
|
using Xunit;
|
|
|
|
public class FfProbeKeyframeExtractorTests
|
|
{
|
|
[Theory]
|
|
[InlineData("keyframes.txt", "keyframes_result.json")]
|
|
[InlineData("keyframes_streamduration.txt", "keyframes_streamduration_result.json")]
|
|
#pragma warning disable CA1707 // Identifiers should not contain underscores - xUnit test naming convention
|
|
public void ParseStream_Valid_Success(string testDataFileName, string resultFileName)
|
|
#pragma warning restore CA1707
|
|
{
|
|
var testDataPath = Path.Combine("FfProbe/Test Data", testDataFileName);
|
|
var resultPath = Path.Combine("FfProbe/Test Data", resultFileName);
|
|
using var resultFileStream = File.OpenRead(resultPath);
|
|
var expectedResult = JsonSerializer.Deserialize<KeyframeData>(resultFileStream)!;
|
|
|
|
using var fileStream = File.OpenRead(testDataPath);
|
|
using var streamReader = new StreamReader(fileStream);
|
|
|
|
var result = FfProbeKeyframeExtractor.ParseStream(streamReader);
|
|
|
|
Assert.Equal(expectedResult.TotalDuration, result.TotalDuration);
|
|
Assert.Equal(expectedResult.KeyframeTicks, result.KeyframeTicks);
|
|
}
|
|
}
|
|
}
|