diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 6ffb54ae..8ced40c9 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -93,6 +93,7 @@ default_config = { 'keystore': 'keystore.jks', 'smartcardoptions': [], 'char_limits': { + 'Author': 256, 'Name': 30, 'Summary': 80, 'Description': 4000, diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 4a4da899..f4480ec1 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -574,6 +574,14 @@ def _set_localized_text_entry(app, locale, key, f): localized[key] = text +def _set_author_entry(app, key, f): + limit = config['char_limits']['Author'] + with open(f) as fp: + text = fp.read()[:limit] + if len(text) > 0: + app[key] = text + + def copy_triple_t_store_metadata(apps): """Include store metadata from the app's source repo @@ -623,6 +631,15 @@ def copy_triple_t_store_metadata(apps): _set_localized_text_entry(app, segments[-1], 'WhatsNew', os.path.join(root, f)) continue + elif f == 'contactEmail': + _set_author_entry(app, 'AuthorEmail', os.path.join(root, f)) + continue + elif f == 'contactPhone': + _set_author_entry(app, 'AuthorPhone', os.path.join(root, f)) + continue + elif f == 'contactWebsite': + _set_author_entry(app, 'AuthorWebSite', os.path.join(root, f)) + continue base, extension = common.get_extension(f) dirname = os.path.basename(root)