Release 0.2.5: harden proxy and streamline metadata fetching
Remove obsolete rule formats, batch SQLite work, preserve artwork source URLs, and coordinate refresh workers with maintenance. Add regression coverage and document backup format changes.
This commit is contained in:
@@ -19,7 +19,7 @@ public sealed class AssetStorageServiceTests
|
||||
});
|
||||
var service = new AssetStorageService(factory, store);
|
||||
|
||||
var path = await service.StoreAsync("item", "fi", "poster", "https://images.example/poster.jpg", true, CancellationToken.None);
|
||||
var path = await service.StoreAsync("item", "https://images.example/poster.jpg", true, CancellationToken.None);
|
||||
|
||||
Assert.NotNull(path);
|
||||
Assert.StartsWith(TranslationStore.LocalAssetUrlPrefix, path, StringComparison.Ordinal);
|
||||
@@ -28,6 +28,19 @@ public sealed class AssetStorageServiceTests
|
||||
Assert.True(service.TryResolveLocalAsset(path[TranslationStore.LocalAssetUrlPrefix.Length..], out var resolved, out var contentType));
|
||||
Assert.Equal(fullPath, resolved);
|
||||
Assert.Equal("image/jpeg", contentType);
|
||||
|
||||
store.UpsertAsset("item", "fi", "poster", path, 1);
|
||||
var original = await service.StoreAsync("item", "https://images.example/poster.jpg", true, CancellationToken.None);
|
||||
store.UpsertAsset("item", "Original", "poster", original!, 1);
|
||||
Assert.Equal(path, original);
|
||||
Assert.Single(factory.Requests);
|
||||
Assert.True(store.IsAssetReferenced("item", path));
|
||||
Assert.True(File.Exists(fullPath));
|
||||
File.Delete(fullPath);
|
||||
Assert.False(File.Exists(fullPath));
|
||||
await service.StoreAsync("item", "https://images.example/poster.jpg", true, CancellationToken.None);
|
||||
Assert.True(File.Exists(fullPath));
|
||||
Assert.Equal(2, factory.Requests.Count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -46,7 +59,7 @@ public sealed class AssetStorageServiceTests
|
||||
var service = new AssetStorageService(factory, store);
|
||||
const string url = "https://images.example/poster.webp";
|
||||
|
||||
var result = await service.StoreAsync("item", "fi", "poster", url, false, CancellationToken.None);
|
||||
var result = await service.StoreAsync("item", url, false, CancellationToken.None);
|
||||
|
||||
Assert.Equal(url, result);
|
||||
Assert.Empty(factory.Requests);
|
||||
@@ -73,7 +86,7 @@ public sealed class AssetStorageServiceTests
|
||||
});
|
||||
var service = new AssetStorageService(factory, store);
|
||||
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => service.StoreAsync("item", "fi", "poster", "https://images.example/poster.jpg", true, CancellationToken.None));
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => service.StoreAsync("item", "https://images.example/poster.jpg", true, CancellationToken.None));
|
||||
|
||||
Assert.Empty(Directory.EnumerateFiles(store.AssetsDirectory, "*", SearchOption.AllDirectories));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user