Skip to content

Commit

Permalink
Keyword-based categories #45
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasenlaeufer committed Jan 12, 2021
1 parent 9dbdfce commit 1d8013f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mediawiki.lrdevplugin/MediaWikiInterface.lua
Expand Up @@ -209,6 +209,15 @@ MediaWikiInterface.buildFileDescription = function(exportFields, photo)
end
end

-- Keyword-based categories / categories as keyword hashtags, e. g. "#foobar"
local keywordTagsForExport = photo:getFormattedMetadata('keywordTagsForExport')
for category in string.gmatch(keywordTagsForExport, '#([^,]+)') do
if category then
category = MediaWikiUtils.trim(category)
table.insert(categoriesList, category)
end
end

-- remove duplicate categories, see https://stackoverflow.com/questions/20066835/lua-remove-duplicate-elements
local categoriesListTwo = {}
local hash = {}
Expand Down

0 comments on commit 1d8013f

Please sign in to comment.