-
Notifications
You must be signed in to change notification settings - Fork 7.7k
[expo-media-library][iOS] add support for filtering assets by media subtype #36756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Subscribed to pull request
Generated by CodeMention |
@vonovak thanks for self-assigning this. idk how to re-run the |
can you please rebase this on latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR!
I believe mediaSubtypes
need to receive the arrayize
treatment like here
mediaType: arrayize(mediaType || [MediaType.photo]), |
Also if you could add an example of this in one of the screens here that'd be great - it'll speed up the review process, though not strictly necessary.
Also pls rebase on latest main.
Thank you!
.yarnrc.yml
Outdated
@@ -0,0 +1 @@ | |||
nodeLinker: node-modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this file pls
@clarkg hello, can you please resolve the review comments? |
Co-authored-by: Expo Bot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed my own review, did some small refactors
@@ -2,38 +2,6 @@ import ExpoModulesCore | |||
import Photos | |||
import CoreServices | |||
|
|||
func stringify(mediaType: PHAssetMediaType) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this to MediaType.init(fromPHAssetMediaType mediaType: PHAssetMediaType)
to prevent the two from going out of sync
} | ||
|
||
func stringifyMedia(mediaSubtypes: PHAssetMediaSubtype) -> [String] { | ||
let subtypesDict: [String: PHAssetMediaSubtype] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to MediaSubtype.stringify
oh wow thank you @vonovak ! |
Why
this would be very convenient to be able to filter for screenshots, for example, without needing to overfetch
How
extended
AssetOptions
withmediaSubtypes
main logic implemented in
getAssetsWithAfter
inMediaLibraryUtilities.swift
Test Plan
test-suite
Checklist
changelog.md
entry and rebuilt the package sources according to this short guidenpx expo prebuild
& EAS Build (eg: updated a module plugin).