chiark / gitweb /
update: fix detection of Triple-T screenshots
authorHans-Christoph Steiner <hans@eds.org>
Tue, 10 Oct 2017 10:29:04 +0000 (12:29 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Fri, 13 Oct 2017 12:58:15 +0000 (14:58 +0200)
* https://github.com/westnordost/StreetComplete/issues/489
* https://forum.f-droid.org/t/screenshots-dont-show-up-in-client-using-gradle-play-publisher/881/2

#357

fdroidserver/update.py

index 883526c11a8ea5c8d3646fe1288fd0e379f76ed7..a77417a6191d6cdff2f8a90272c44c967dba9ffe 100644 (file)
@@ -717,15 +717,16 @@ def copy_triple_t_store_metadata(apps):
 
                     base, extension = common.get_extension(f)
                     dirname = os.path.basename(root)
-                    if dirname in GRAPHIC_NAMES and extension in ALLOWED_EXTENSIONS:
+                    if extension in ALLOWED_EXTENSIONS \
+                       and (dirname in GRAPHIC_NAMES or dirname in SCREENSHOT_DIRS):
                         if segments[-2] == 'listing':
                             locale = segments[-3]
                         else:
                             locale = segments[-2]
-                        destdir = os.path.join('repo', packageName, locale)
+                        destdir = os.path.join('repo', packageName, locale, dirname)
                         os.makedirs(destdir, mode=0o755, exist_ok=True)
                         sourcefile = os.path.join(root, f)
-                        destfile = os.path.join(destdir, dirname + '.' + extension)
+                        destfile = os.path.join(destdir, os.path.basename(f))
                         logging.debug('copying ' + sourcefile + ' ' + destfile)
                         shutil.copy(sourcefile, destfile)