forked from 500px/500pxPublisher.lrplugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
500pxMetadataDefinition.lua
executable file
·112 lines (112 loc) · 2.97 KB
/
500pxMetadataDefinition.lua
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
return {
metadataFieldsForPhotos = {
{
id = "photoId",
datatype = "string",
},
{
id = "publishedUUID",
dataType = "string",
},
{
id = "privacy",
dataType = "enum",
values = {
{ value = 0, title="public" },
{ value = 1, title="private" },
}
},
{
id = "nsfw",
title = "Mature Content",
dataType = "enum",
values = {
{ value = 0, title = "No" },
{ value = 1, title = "Yes" },
},
},
{
id = "license_type",
title = "License Type",
dataType = "enum",
values = {
{ value = 0, title = "Standard 500px License" },
{ value = 4, title = "Attribution 3.0" },
{ value = 5, title = "Attribution-NoDerivs 3.0" },
{ value = 6, title = "Attribution-ShareAlike 3.0" },
{ value = 1, title = "Attribution-NonCommercial 3.0" },
{ value = 2, title = "Attribution-NonCommercial-NoDerivs 3.0" },
{ value = 3, title = "Attribution-NonCommercial-ShareAlike 3.0" }
},
},
{
id = "category",
title = "Category",
dataType = "enum",
values = {
{ value = 10, title="Abstract" },
{ value = 11, title="Animals" },
{ value = 5, title="Black and White" },
{ value = 1, title="Celebrities" },
{ value = 9, title="City and Architecture" },
{ value = 15, title="Commercial" },
{ value = 16, title="Concert" },
{ value = 20, title="Family" },
{ value = 14, title="Fashion" },
{ value = 2, title="Film" },
{ value = 24, title="Fine Art" },
{ value = 23, title="Food" },
{ value = 3, title="Journalism" },
{ value = 8, title="Landscapes" },
{ value = 12, title="Macro" },
{ value = 18, title="Nature" },
{ value = 4, title="Nude" },
{ value = 7, title="People" },
{ value = 19, title="Performing Arts" },
{ value = 17, title="Sport" },
{ value = 6, title="Still Life" },
{ value = 21, title="Street" },
{ value = 26, title="Transportation" },
{ value = 13, title="Travel" },
{ value = 22, title="Underwater" },
{ value = 27, title="Urban Exploration" },
{ value = 25, title="Wedding" },
{ value = 0, title="Uncategorized" }
},
},
{
id = "views",
title = "Views",
dataType = "string",
readOnly = true,
},
{
id = "favorites",
title = "Favorites",
dataType = "string",
readOnly = true,
},
{
id = "votes",
title = "Votes",
dataType = "string",
readOnly = true,
},
{
id = "previous_tags",
dataType = "string",
},
},
schemaVersion = 7,
updateFromEarlierSchemaVersion = function( catalog, previousSchemaVersion, progressScope )
if previousSchemaVersion == 7 then
return
end
catalog:assertHasPrivateWriteAccess( "updateFromEarlierSchemaVersion" )
local photosToMigrate = catalog:findPhotosWithProperty( "com.500px.publisher", "photoId" )
for _, photo in ipairs( photosToMigrate ) do
photo:setPropertyForPlugin( _PLUGIN, "publishedUUID", photo:getRawMetadata( "uuid" ) )
photo:setPropertyForPlugin( _PLUGIN, "nsfw", 0 )
end
end
}