Fix blocking collection matching with large plugins
This commit is contained in:
@@ -149,6 +149,15 @@ export function getVersion(id: number): ScriptVersionRow | undefined {
|
||||
| undefined;
|
||||
}
|
||||
|
||||
export type ScriptVersionMetadata = Pick<ScriptVersionRow, 'id' | 'version' | 'sha256' | 'size'>;
|
||||
|
||||
/** Planning a launch never needs to load potentially large script or plugin bytes. */
|
||||
export function getVersionMetadata(id: number): ScriptVersionMetadata | undefined {
|
||||
return db().prepare('SELECT id, version, sha256, size FROM script_versions WHERE id = ?').get(id) as
|
||||
| ScriptVersionMetadata
|
||||
| undefined;
|
||||
}
|
||||
|
||||
// Latest version is 'max(version)' — used everywhere we want the freshest
|
||||
// upload, whether or not it has been promoted (current_version_id).
|
||||
export function getLatestVersion(scriptId: number): ScriptVersionRow | undefined {
|
||||
|
||||
Reference in New Issue
Block a user