aboutsummaryrefslogtreecommitdiff
path: root/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua')
-rwxr-xr-xmediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua b/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
index 04e783a..f2745e4 100755
--- a/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
+++ b/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
@@ -81,6 +81,7 @@ MediaWikiExportServiceProvider.processRenderedPhotos = function(functionContext,
end
if MediaWikiUtils.isStringEmpty(description) then
rendition:uploadFailed(LOC '$$$/LrMediaWiki/Export/NoDescription=No description given for this file!')
+ return
end
local source = exportSettings.info_source
local timestampSeconds = photo:getRawMetadata('dateTimeOriginal')
@@ -95,6 +96,12 @@ MediaWikiExportServiceProvider.processRenderedPhotos = function(functionContext,
local categories = exportSettings.info_categories
local additionalCategories = photo:getPropertyForPlugin(Info.LrToolkitIdentifier, 'categories') or ''
+ local gps = photo:getRawMetadata('gps')
+ if gps and gps.latitude and gps.longitude then
+ local location = '{{Location|' .. gps.latitude .. '|' .. gps.longitude .. '}}\n'
+ templates = location .. templates
+ end
+
local fileDescription = MediaWikiInterface.buildFileDescription(description, source, timestamp, author, license, templates, other, categories, additionalCategories)
MediaWikiInterface.uploadFile(pathOrMessage, fileDescription)