-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomMetadataTagset.lua
More file actions
46 lines (38 loc) · 1.48 KB
/
CustomMetadataTagset.lua
File metadata and controls
46 lines (38 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--[[============================================================================
CustomMetadataTagset.lua
Dynamically generates the tagset from FieldDefinitions.lua.
Fields are grouped by the `section` property.
============================================================================--]]
local Fields = require "FieldDefinitions"
local Config = require "PluginConfig"
-- Build the items list with sections
local items = {}
local lastSection = nil
for _, field in ipairs(Fields.FIELDS) do
-- Section separator (on change)
if field.section and field.section ~= lastSection then
table.insert(items, {
"com.adobe.separator",
label = "──── " .. field.section .. " ────",
})
lastSection = field.section
end
-- Full field identifier: PLUGIN_ID.fieldId
table.insert(items, Config.PLUGIN_ID .. "." .. field.id)
end
-- Append standard IPTC fields
table.insert(items, { "com.adobe.separator", label = "──── Standard IPTC ────" })
table.insert(items, "com.adobe.title")
table.insert(items, "com.adobe.caption")
table.insert(items, "com.adobe.copyrightState")
table.insert(items, "com.adobe.copyright")
table.insert(items, "com.adobe.creator")
table.insert(items, "com.adobe.location")
table.insert(items, "com.adobe.city")
table.insert(items, "com.adobe.state")
table.insert(items, "com.adobe.country")
return {
title = "Custom Metadata",
id = "CustomMetadataTagset",
items = items,
}