1.1.0 - automations, clean only mode, bug fixes

This commit is contained in:
ponzischeme89
2026-01-19 02:10:08 +13:00
parent 93e8b38e24
commit 9345ac4331
25 changed files with 2690 additions and 499 deletions
+61 -2
View File
@@ -268,10 +268,16 @@ export async function searchTitle(query, mode = "quick", options = {}) {
/**
* POST /api/process - Process files to add plot summaries
* Body: { files: [string], duration: number, titleOverride?: object, forceReprocess?: boolean }
* Body: { files: [string], duration: number, titleOverride?: object, forceReprocess?: boolean, clean_only?: boolean }
* Returns: { success, results: [{file, success, status, summary, error?}] }
*/
export async function processFiles(files, duration, titleOverride = null, forceReprocess = false) {
export async function processFiles(
files,
duration,
titleOverride = null,
forceReprocess = false,
cleanOnly = false
) {
const body = { files, duration }
if (titleOverride) {
@@ -282,6 +288,10 @@ export async function processFiles(files, duration, titleOverride = null, forceR
body.forceReprocess = forceReprocess
}
if (cleanOnly) {
body.clean_only = true
}
return apiFetch('/process', {
method: 'POST',
body: JSON.stringify(body)
@@ -392,6 +402,55 @@ export async function getIntegrationUsage() {
return apiFetch('/integrations/usage')
}
// ============ AUTOMATION API ============
/**
* GET /api/automation/rules - Get automation rules
* Returns: { success, rules: [...] }
*/
export async function getAutomationRules() {
return apiFetch('/automation/rules')
}
/**
* POST /api/automation/rules - Create automation rule
*/
export async function createAutomationRule(rule) {
return apiFetch('/automation/rules', {
method: 'POST',
body: JSON.stringify(rule)
})
}
/**
* PUT /api/automation/rules/<id> - Update automation rule
*/
export async function updateAutomationRule(ruleId, updates) {
return apiFetch(`/automation/rules/${ruleId}`, {
method: 'PUT',
body: JSON.stringify(updates)
})
}
/**
* DELETE /api/automation/rules/<id> - Delete automation rule
*/
export async function deleteAutomationRule(ruleId) {
return apiFetch(`/automation/rules/${ruleId}`, {
method: 'DELETE'
})
}
/**
* POST /api/automation/rules/<id>/run - Run rule now
*/
export async function runAutomationRule(ruleId, dryRun = false) {
return apiFetch(`/automation/rules/${ruleId}/run`, {
method: 'POST',
body: JSON.stringify({ dry_run: dryRun })
})
}
// ============ SUGGESTED MATCHES API ============
/**
@@ -21,4 +21,4 @@
restClass,
)}
{...restProps}
/>
></div>
+1 -1
View File
@@ -9,7 +9,7 @@ function createToastStore() {
update((items) => items.filter((item) => item.id !== id))
}
function addToast({ message, tone = 'info', duration = 3200 } = {}) {
function addToast({ message, tone = 'info', duration = 5200 } = {}) {
if (!message) return
const id = `${Date.now()}-${Math.random().toString(16).slice(2)}`
const toast = { id, message, tone }