Skip to content

Commit

Permalink
Support subsetting in Android Generic Media provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas FitzRoy-Dale committed Aug 12, 2024
1 parent 9061456 commit fd43e99
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rime/providers/androidgenericmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ def subset(self, subsetter, events, contacts):
"""
Create a subset using the given events and contacts.
"""
return None
for event in events:
if event.provider.NAME != self.NAME:
continue

with self.fs.open(event.local_id) as h:
subsetter.copy_file(h, event.local_id)

def all_files(self):
# TODO
Expand All @@ -65,6 +70,9 @@ def search_events(self, device, filter_):
"""
Search for events matching ``filter_``, which is an EventFilter.
"""
if not self.fs.exists('/sdcard'):
return []

for direntry in self.fs.walk('/sdcard'):
if not direntry.mime_type:
continue
Expand Down

0 comments on commit fd43e99

Please sign in to comment.