mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
- Created EntityTable component for displaying test entities with expandable rows for releases. - Implemented ReleaseTable component to manage and display test releases with actions for editing and deleting. - Added ReleaseModal component for creating and editing releases - Introduced types for TestEntity, TestRelease, and related evaluations - Enhanced general settings page to include TMDB API configuration with connection testing functionality. - Added TMDBSettings component for managing TMDB API access token with reset and test connection features.
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
/**
|
|
* Update test release operation
|
|
*/
|
|
|
|
import type { PCDCache } from '../../cache.ts';
|
|
import { writeOperation, type OperationLayer } from '../../writer.ts';
|
|
|
|
export interface UpdateTestReleaseInput {
|
|
id: number;
|
|
title: string;
|
|
size_bytes: number | null;
|
|
languages: string[];
|
|
indexers: string[];
|
|
flags: string[];
|
|
}
|
|
|
|
export interface UpdateTestReleaseOptions {
|
|
databaseId: number;
|
|
cache: PCDCache;
|
|
layer: OperationLayer;
|
|
input: UpdateTestReleaseInput;
|
|
}
|
|
|
|
/**
|
|
* Update a test release by writing an operation to the specified layer
|
|
*/
|
|
export async function updateRelease(options: UpdateTestReleaseOptions) {
|
|
const { databaseId, cache, layer, input } = options;
|
|
const db = cache.kb;
|
|
|
|
const updateQuery = db
|
|
.updateTable('test_releases')
|
|
.set({
|
|
title: input.title,
|
|
size_bytes: input.size_bytes,
|
|
languages: JSON.stringify(input.languages),
|
|
indexers: JSON.stringify(input.indexers),
|
|
flags: JSON.stringify(input.flags)
|
|
})
|
|
.where('id', '=', input.id)
|
|
.compile();
|
|
|
|
const result = await writeOperation({
|
|
databaseId,
|
|
layer,
|
|
description: `update-test-release-${input.id}`,
|
|
queries: [updateQuery],
|
|
metadata: {
|
|
operation: 'update',
|
|
entity: 'test_release',
|
|
name: input.title.substring(0, 50)
|
|
}
|
|
});
|
|
|
|
return result;
|
|
}
|