Allow disabling metadata timestamps

This commit is contained in:
Matthias Klumpp 2016-05-24 18:46:45 +02:00
parent 1babdfedda
commit 7b1ff3f44f
3 changed files with 15 additions and 7 deletions

View File

@ -76,3 +76,4 @@ processDesktop | Process .desktop files which do not have a metainfo file. If di
noDownloads | Do not attempt any downloads. This will implicitly disable any handling of screenshots and possibly other features. Using this flag is discouraged. *Default: `OFF`*
createScreenshotsStore | Mirror screenshots and create thumbnails of them in `media/`. This will yield the best experience with software-centers, and also allow full control over which screenshots are displayed. Disabling this will make clients pull screenshots from 3rd-party upstream servers. *Default: `ON`*
optimizePNGSize | Use `optipng` to reduce the size of PNG images. Optipng needs to be installed. *Default: `ON`*
metadataTimestamps | Write timestamps into generated metadata files. *Default: `ON`*

View File

@ -68,11 +68,12 @@ enum Backend
enum GeneratorFeature
{
NONE = 0,
PROCESS_DESKTOP = 1 << 0,
VALIDATE = 1 << 1,
NO_DOWNLOADS = 1 << 2,
STORE_SCREENSHOTS = 1 << 3,
OPTIPNG = 1 << 4
PROCESS_DESKTOP = 1 << 0,
VALIDATE = 1 << 1,
NO_DOWNLOADS = 1 << 2,
STORE_SCREENSHOTS = 1 << 3,
OPTIPNG = 1 << 4,
METADATA_TIMESTAMPS = 1 << 5
}
class Config
@ -219,6 +220,7 @@ class Config
setFeature (GeneratorFeature.VALIDATE, true);
setFeature (GeneratorFeature.STORE_SCREENSHOTS, true);
setFeature (GeneratorFeature.OPTIPNG, true);
setFeature (GeneratorFeature.METADATA_TIMESTAMPS, true);
// apply vendor feature settings
if ("Features" in root.object) {
@ -240,6 +242,9 @@ class Config
case "optimizePNGSize":
setFeature (GeneratorFeature.OPTIPNG, featuresObj[featureId].type == JSON_TYPE.TRUE);
break;
case "metadataTimestamps":
setFeature (GeneratorFeature.METADATA_TIMESTAMPS, featuresObj[featureId].type == JSON_TYPE.TRUE);
break;
default:
break;
}

View File

@ -216,7 +216,8 @@ public:
head ~= format (" priority=\"%s\"", suite.dataPriority);
if (!conf.mediaBaseUrl.empty ())
head ~= format (" media_baseurl=\"%s\"", mediaPoolUrl);
head ~= format (" time=\"%s\"", timeStr);
if (conf.featureEnabled (GeneratorFeature.METADATA_TIMESTAMPS))
head ~= format (" time=\"%s\"", timeStr);
head ~= ">";
} else {
head = "---\n";
@ -229,7 +230,8 @@ public:
head ~= format ("\nMediaBaseUrl: %s", mediaPoolUrl);
if (suite.dataPriority != 0)
head ~= format ("\nPriority: %s", suite.dataPriority);
head ~= format ("\nTime: %s", timeStr);
if (conf.featureEnabled (GeneratorFeature.METADATA_TIMESTAMPS))
head ~= format ("\nTime: %s", timeStr);
}
return head;