-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomMetadataDefinition.lua
More file actions
35 lines (27 loc) · 1 KB
/
CustomMetadataDefinition.lua
File metadata and controls
35 lines (27 loc) · 1 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
--[[============================================================================
CustomMetadataDefinition.lua
Dynamically generates metadata field definitions from FieldDefinitions.lua.
DO NOT edit this file — add/remove fields in FieldDefinitions.lua.
============================================================================--]]
local Fields = require "FieldDefinitions"
-- Build the metadataFieldsForPhotos table dynamically
local photoFields = {}
for _, field in ipairs(Fields.FIELDS) do
local entry = {
id = field.id,
title = field.title,
dataType = field.dataType or "string",
searchable = field.searchable ~= false, -- default true
browsable = field.browsable ~= false,
version = 1,
}
-- Enum values
if field.dataType == "enum" and field.values then
entry.values = field.values
end
table.insert(photoFields, entry)
end
return {
metadataFieldsForPhotos = photoFields,
schemaVersion = 2,
}