diff --git a/app.py b/app.py index d932176..818675f 100644 --- a/app.py +++ b/app.py @@ -110,4 +110,7 @@ def get_language_priority(language_code: str) -> int: mime="application/zip", ) -show_file_list(root_dir) +enable_filter = st.checkbox(label=_("Filter available files by DF variant, operating system, language"), value=True) +glob_filter = f"*_{df_variant}_{operating_system}_{dict_entry.code}.zip" if enable_filter else "*.zip" + +show_file_list(root_dir, glob_filter=glob_filter) diff --git a/package_build/file_list.py b/package_build/file_list.py index 0eec31f..c637830 100644 --- a/package_build/file_list.py +++ b/package_build/file_list.py @@ -8,10 +8,10 @@ from package_build.package import get_file_modification_datetime, package_up_to_date -def show_file_list(root_dir: Path) -> None: +def show_file_list(root_dir: Path, glob_filter: str) -> None: st.subheader(_("Package files awailable to download")) - file_list = [file for file in root_dir.glob("*.zip") if package_up_to_date(file)] + file_list = [file for file in root_dir.glob(glob_filter) if package_up_to_date(file)] if not file_list: st.write(_("No package files available."))