-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Provide mime type to file picker to gray out unselectable files #6820
Conversation
app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionsImportFragment.java
Show resolved
Hide resolved
Werks. 🎉 Damn that is so much more convenient. |
@TobiGr this should also be safe to merge :-) |
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.
Oh yes, I reviewed this but forgot to approve it...
For some reason this doesn't work for me, I'm on 0.21.13 and all the files are greyed out including the json file containing an export of my subscriptions. |
For some reason, by converting the file to |
Importing one's settings from a zip file works though. |
According to this: the problem is that android doesn't support the json mime type: https://stackoverflow.com/a/58104204/11748992 And looking at the latest android source code it seems it still doesn't support it now. |
I think that's expected? |
? To be clear
The file is just not selectable, the fact there's this workaround, is irrelevant. I only mentioned it as I was trying to understand what was going on. Now we know the reason it doesn't work: Android doesn't support the JSON MIME type. |
Ah, yeah, I misread your comment. |
Created a separate issue for it: #7326 |
What is it?
Description of the changes in your PR
This PR just adds a mime type to all
getPicker
calls. When using SAF now, each time the app will want to open a file (to import the database or subscriptions), all files with the incorrect file format will be grayed out. So the database import picker will only let.zip
be selected and the subscription import picker will only let.json
be selected. The service-specific subscription imports, though, still have*/*
as mime type as the extension of those files could be subject to change and is different between services.Before/After Screenshots/Screen Record
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. @opusforlife2
Due diligence