Skip to content
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

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Aug 1, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

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

Before After

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

@opusforlife2
Copy link
Collaborator

Werks. 🎉

Damn that is so much more convenient.

@triallax triallax added the feature request Issue is related to a feature in the app label Aug 1, 2021
@Stypox
Copy link
Member Author

Stypox commented Aug 26, 2021

@TobiGr this should also be safe to merge :-)

Copy link
Member

@TobiGr TobiGr left a 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...

@TobiGr TobiGr merged commit 0787d62 into TeamNewPipe:dev Aug 26, 2021
This was referenced Sep 5, 2021
@NilsIrl
Copy link

NilsIrl commented Oct 26, 2021

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.

@NilsIrl
Copy link

NilsIrl commented Oct 26, 2021

For some reason, by converting the file to *.json (1) instead of *.json makes it become selectable.

@NilsIrl
Copy link

NilsIrl commented Oct 26, 2021

Importing one's settings from a zip file works though.

@NilsIrl
Copy link

NilsIrl commented Oct 26, 2021

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.

@triallax
Copy link
Contributor

For some reason, by converting the file to *.json (1) instead of *.json makes it become selectable.

I think that's expected?

@NilsIrl
Copy link

NilsIrl commented Oct 28, 2021

? To be clear *.json (1) WORKS

*.json DOESN'T WORK

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.

@triallax
Copy link
Contributor

Ah, yeah, I misread your comment.

@NilsIrl
Copy link

NilsIrl commented Oct 29, 2021

Created a separate issue for it: #7326

@Stypox Stypox deleted the picker-mime-type branch August 4, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Requesting changes to exporting database
5 participants