mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Use vercodes in read_metadata interface
read_metadata is only called in read_app_args with an argument. As vercodes is already there, drop the duplicate call.
This commit is contained in:
parent
8ab1d53318
commit
4d0a21f336
2 changed files with 5 additions and 6 deletions
|
|
@ -950,7 +950,7 @@ def read_app_args(appid_versionCode_pairs, allow_version_codes=False, sort_by_ti
|
||||||
|
|
||||||
"""
|
"""
|
||||||
vercodes = read_pkg_args(appid_versionCode_pairs, allow_version_codes)
|
vercodes = read_pkg_args(appid_versionCode_pairs, allow_version_codes)
|
||||||
allapps = fdroidserver.metadata.read_metadata(appid_versionCode_pairs, sort_by_time)
|
allapps = fdroidserver.metadata.read_metadata(vercodes, sort_by_time)
|
||||||
|
|
||||||
if not vercodes:
|
if not vercodes:
|
||||||
return allapps
|
return allapps
|
||||||
|
|
|
||||||
|
|
@ -545,7 +545,7 @@ def read_srclibs():
|
||||||
srclibs[metadatapath.stem] = parse_yaml_srclib(metadatapath)
|
srclibs[metadatapath.stem] = parse_yaml_srclib(metadatapath)
|
||||||
|
|
||||||
|
|
||||||
def read_metadata(appids={}, sort_by_time=False):
|
def read_metadata(appid_to_vercode={}, sort_by_time=False):
|
||||||
"""Return a list of App instances sorted newest first.
|
"""Return a list of App instances sorted newest first.
|
||||||
|
|
||||||
This reads all of the metadata files in a 'data' repository, then
|
This reads all of the metadata files in a 'data' repository, then
|
||||||
|
|
@ -553,7 +553,7 @@ def read_metadata(appids={}, sort_by_time=False):
|
||||||
sorted based on creation time, newest first. Most of the time,
|
sorted based on creation time, newest first. Most of the time,
|
||||||
the newer files are the most interesting.
|
the newer files are the most interesting.
|
||||||
|
|
||||||
appids is a dict with appids a keys and versionCodes as values.
|
appid_to_vercode is a dict with appids a keys and versionCodes as values.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Always read the srclibs before the apps, since they can use a srlib as
|
# Always read the srclibs before the apps, since they can use a srlib as
|
||||||
|
|
@ -565,9 +565,8 @@ def read_metadata(appids={}, sort_by_time=False):
|
||||||
for basedir in ('metadata', 'tmp'):
|
for basedir in ('metadata', 'tmp'):
|
||||||
Path(basedir).mkdir(exist_ok=True)
|
Path(basedir).mkdir(exist_ok=True)
|
||||||
|
|
||||||
if appids:
|
if appid_to_vercode:
|
||||||
vercodes = common.read_pkg_args(appids)
|
metadatafiles = common.get_metadata_files(appid_to_vercode)
|
||||||
metadatafiles = common.get_metadata_files(vercodes)
|
|
||||||
else:
|
else:
|
||||||
metadatafiles = list(Path('metadata').glob('*.yml')) + list(
|
metadatafiles = list(Path('metadata').glob('*.yml')) + list(
|
||||||
Path('.').glob('.fdroid.yml')
|
Path('.').glob('.fdroid.yml')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue