mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-14 05:53:47 -06:00
feat: put a .nomedia in packs unzipped on Android
The RetroArch pack lands in RetroArch Android's system folder, where MediaProvider indexed 3 842 images, sounds and videos (552 MB) into the gallery and music apps: a folder holding .nomedia is hidden with every folder below it (FileUtils.java:1587-1629, ModernMediaScanner.java:845-846, a183e2b9). A pack whose platform files an Android target, unfiltered or built for one, carries an empty .nomedia. pack_files counts it and the integrity check takes it for a marker.
This commit is contained in:
1 parent
c33114714e
commit
39bc5f020b
6 files changed
+97
-7
No files matched your search
@@ -192,6 +192,23 @@ def _register_path(dest: str, seen_files: set[str], seen_parents: set[str]) -> N
|
||||
for parent in _path_parents(dest):
|
||||
seen_parents.add(parent)
|
||||
|
||||
# Android's media scanner hides a folder holding a .nomedia file, and every
|
||||
# folder below it (MediaProvider a183e2b9, FileUtils.java:1587-1629
|
||||
# isDirectoryHidden, ModernMediaScanner.java:845-846). RetroArch writes none
|
||||
# (libretro-common/file/file_path_io.c:194 only skips one), so a pack
|
||||
# unzipped into RetroArch Android's system folder put its samples, overlays
|
||||
# and videos in the gallery and music apps.
|
||||
MEDIA_MARKER = ".nomedia"
|
||||
|
||||
|
||||
def lands_on_android(target_names: Iterable[str], target: str | None) -> bool:
|
||||
"""Whether a pack can be unzipped on Android: its target is an Android
|
||||
one, or, unfiltered, the platform files one."""
|
||||
if target:
|
||||
return target.startswith("android")
|
||||
return any(name.startswith("android") for name in target_names)
|
||||
|
||||
|
||||
def _flat(arcname: str, prefix: str, flatten: bool) -> str:
|
||||
"""Strip base_destination prefix from ZIP arcname when flattening."""
|
||||
if flatten and prefix and arcname.startswith(prefix + "/"):
|
||||
|
||||
Reference in new issue
Block a user