mirror of
https://github.com/immich-app/immich.git
synced 2026-06-04 13:15:22 -04:00
b75d9b74b9
Adds a filterByAlbum core plugin method so workflows (e.g. the AlbumAssetAdded trigger) can be scoped to specific albums. The step checks the asset's album membership via the searchAlbums host function and halts the workflow when the asset is not in any of the configured albums (or, with inverse, when it is).
361 lines
10 KiB
JSON
361 lines
10 KiB
JSON
{
|
|
"name": "immich-plugin-core",
|
|
"version": "2.0.1",
|
|
"title": "Immich Core Plugin",
|
|
"description": "Core workflow capabilities for Immich",
|
|
"author": "Immich Team",
|
|
"wasmPath": "dist/plugin.wasm",
|
|
"templates": [
|
|
{
|
|
"name": "screenshots-smart-album",
|
|
"title": "Archive screenshots",
|
|
"description": "Archive uploads with \"screenshot\" in the filename and optionally add them to an album",
|
|
"trigger": "AssetCreate",
|
|
"steps": [
|
|
{
|
|
"method": "immich-plugin-core#assetFileFilter",
|
|
"config": {
|
|
"pattern": "screenshot",
|
|
"matchType": "contains",
|
|
"caseSensitive": false
|
|
}
|
|
},
|
|
{
|
|
"method": "immich-plugin-core#assetArchive",
|
|
"config": {
|
|
"inverse": false
|
|
}
|
|
},
|
|
{
|
|
"method": "immich-plugin-core#assetAddToAlbums",
|
|
"config": {
|
|
"albumName": "Screenshots",
|
|
"albumIds": []
|
|
}
|
|
}
|
|
],
|
|
"uiHints": ["SmartAlbum"]
|
|
},
|
|
{
|
|
"name": "missing-timezone-smart-album",
|
|
"title": "Missing timezone",
|
|
"description": "Automatically create an album for assets without a time zone",
|
|
"trigger": "AssetMetadataExtraction",
|
|
"steps": [
|
|
{
|
|
"method": "immich-plugin-core#assetMissingTimeZoneFilter",
|
|
"config": {}
|
|
},
|
|
{
|
|
"method": "immich-plugin-core#assetAddToAlbums",
|
|
"config": {
|
|
"albumName": "Missing time zone",
|
|
"albumIds": []
|
|
}
|
|
}
|
|
],
|
|
"uiHints": ["SmartAlbum"]
|
|
}
|
|
],
|
|
"methods": [
|
|
{
|
|
"name": "assetFileFilter",
|
|
"title": "Filter by filename",
|
|
"description": "Filter assets by filename pattern using text matching or regular expressions",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"pattern": {
|
|
"type": "string",
|
|
"title": "Filename pattern",
|
|
"description": "Text or regex pattern to match against filename"
|
|
},
|
|
"matchType": {
|
|
"type": "string",
|
|
"title": "Match type",
|
|
"enum": ["contains", "startsWith", "exact", "regex"],
|
|
"default": "contains",
|
|
"description": "Type of pattern matching to perform"
|
|
},
|
|
"caseSensitive": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"title": "Case sensitive",
|
|
"description": "Whether matching should be case-sensitive"
|
|
}
|
|
},
|
|
"required": ["pattern"]
|
|
},
|
|
"uiHints": ["Filter"]
|
|
},
|
|
{
|
|
"name": "assetMissingTimeZoneFilter",
|
|
"title": "Filter by missing time zone",
|
|
"description": "Filter assets that have no time zone information",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"inverse": {
|
|
"type": "boolean",
|
|
"title": "Inverse",
|
|
"description": "Missing by default, set to true to filter assets with a time zone",
|
|
"default": false
|
|
}
|
|
}
|
|
},
|
|
"uiHints": ["Filter"]
|
|
},
|
|
{
|
|
"name": "filterFileType",
|
|
"title": "Filter by file type",
|
|
"description": "Filter assets by file type",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"fileTypes": {
|
|
"title": "File types",
|
|
"description": "Allowed file types",
|
|
"type": "string",
|
|
"array": true,
|
|
"enum": ["image", "video"]
|
|
}
|
|
},
|
|
"required": ["fileTypes"]
|
|
},
|
|
"uiHints": ["Filter"]
|
|
},
|
|
{
|
|
"name": "filterPerson",
|
|
"title": "Filter by person",
|
|
"description": "Filter by detected person",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"properties": {
|
|
"personIds": {
|
|
"type": "string",
|
|
"array": true,
|
|
"title": "Person IDs",
|
|
"description": "List of person to match",
|
|
"uiHint": "personId"
|
|
},
|
|
"matchAny": {
|
|
"type": "boolean",
|
|
"title": "Match any",
|
|
"default": true,
|
|
"description": "Match any name (true) or require all names (false)"
|
|
}
|
|
},
|
|
"required": ["personIds"]
|
|
},
|
|
"uiHints": ["Filter"]
|
|
},
|
|
{
|
|
"name": "filterByAlbum",
|
|
"title": "Filter by album",
|
|
"description": "Continue only when the asset belongs to one of the selected albums",
|
|
"types": ["AssetV1"],
|
|
"hostFunctions": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"albumIds": {
|
|
"type": "string",
|
|
"array": true,
|
|
"title": "Album IDs",
|
|
"description": "Albums to match against",
|
|
"uiHint": "AlbumId"
|
|
},
|
|
"inverse": {
|
|
"type": "boolean",
|
|
"title": "Inverse",
|
|
"description": "Continue only when the asset is NOT in the selected albums",
|
|
"default": false
|
|
}
|
|
},
|
|
"required": ["albumIds"]
|
|
},
|
|
"uiHints": ["Filter"]
|
|
},
|
|
{
|
|
"name": "assetArchive",
|
|
"title": "Archive asset",
|
|
"description": "Change asset visibility to archive",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"properties": {
|
|
"inverse": {
|
|
"title": "Inverse",
|
|
"description": "When true will unarchive any archived assets",
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "assetLock",
|
|
"title": "Move to locked folder",
|
|
"description": "Change visibility to locked",
|
|
"types": ["AssetV1"]
|
|
},
|
|
{
|
|
"name": "assetTimeline",
|
|
"title": "Move to timeline",
|
|
"description": "Change visibility to timeline",
|
|
"types": ["AssetV1"]
|
|
},
|
|
{
|
|
"name": "assetVisibility",
|
|
"title": "Update visibility",
|
|
"description": "Change visibility to selected option",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"properties": {
|
|
"visibility": {
|
|
"title": "Visibility",
|
|
"description": "Asset visibility",
|
|
"type": "string",
|
|
"enum": ["archive", "timeline", "locked"]
|
|
}
|
|
},
|
|
"required": ["visibility"]
|
|
}
|
|
},
|
|
{
|
|
"name": "assetFavorite",
|
|
"title": "Favorite",
|
|
"description": "Favorite an asset",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"inverse": {
|
|
"type": "boolean",
|
|
"title": "Inverse",
|
|
"description": "Unfavorite by default, set to true to favorite instead",
|
|
"default": false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "assetAddToAlbums",
|
|
"title": "Add to Album(s)",
|
|
"description": "Add asset to selected albums",
|
|
"types": ["AssetV1"],
|
|
"hostFunctions": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"albumIds": {
|
|
"type": "string",
|
|
"title": "Album IDs",
|
|
"array": true,
|
|
"description": "Target album IDs",
|
|
"uiHint": "AlbumId"
|
|
},
|
|
"albumName": {
|
|
"type": "string",
|
|
"title": "Album name",
|
|
"description": "Use an album with this name if one exists, otherwise create a new one"
|
|
}
|
|
},
|
|
"required": ["albumIds"]
|
|
}
|
|
},
|
|
{
|
|
"name": "noop1",
|
|
"title": "DEV: Nested properties",
|
|
"description": "Example configuration with nested properties",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"number1": {
|
|
"type": "number",
|
|
"title": "Number 1",
|
|
"description": "Basic number"
|
|
},
|
|
"number2": {
|
|
"type": "number",
|
|
"title": "Number 2",
|
|
"array": true,
|
|
"description": "List of numbers"
|
|
},
|
|
"string1": {
|
|
"type": "string",
|
|
"title": "String 1",
|
|
"description": "Basic string"
|
|
},
|
|
"string2": {
|
|
"type": "string",
|
|
"title": "String 2",
|
|
"array": true,
|
|
"description": "List of strings"
|
|
},
|
|
"string3": {
|
|
"type": "string",
|
|
"title": "String 3",
|
|
"enum": ["choice-1", "choice-2"],
|
|
"description": "Select from a list"
|
|
},
|
|
"nested": {
|
|
"type": "object",
|
|
"title": "Nested",
|
|
"description": "Nested properties for nesting",
|
|
"properties": {
|
|
"nested1": {
|
|
"type": "string",
|
|
"title": "Nested 1",
|
|
"description": "Nested string"
|
|
},
|
|
"nested2": {
|
|
"type": "number",
|
|
"title": "Nested 2",
|
|
"description": "Nested number"
|
|
},
|
|
"nested3": {
|
|
"type": "object",
|
|
"title": "Nested 3",
|
|
"description": "Nested again",
|
|
"properties": {
|
|
"nested4": {
|
|
"type": "boolean",
|
|
"title": "Nested 4",
|
|
"description": "Nested, nested boolean"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "noop2",
|
|
"title": "DEV: Album pickers",
|
|
"description": "Example configuration with album pickers",
|
|
"types": ["AssetV1"],
|
|
"schema": {
|
|
"properties": {
|
|
"albumId": {
|
|
"type": "string",
|
|
"title": "Album ID",
|
|
"description": "Target album ID",
|
|
"uiHint": "AlbumId"
|
|
},
|
|
"albumIds": {
|
|
"type": "string",
|
|
"title": "Album IDs",
|
|
"description": "Target album IDs",
|
|
"array": true,
|
|
"uiHint": "AlbumId"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|