Can't import OPML with .opml extension #87
Describe the bug
Some podcast players export OPML files with
.opml extension, but such file cannot be chosen in the "Import OPML" dialog. After I renamed the file to have
.xml extension, the import worked fine. Wikipedia even lists
.opml as the main file extension.
- Get OPML file with
.opmlextension - in my case the file was named
subscriptions.opmland was generated by Castro on iOS.
- Attempt to load the file in Escapepod through "Settings cog" -> "Import OPML" - not possible, the file is grayed out
.opml file extension should be accepted by the file chooser dialog.
- Device: Google Pixel 4a
- OS: Graphene OS 2021.07.26.20
- App Version: 1.0.4 (latest on F-Droid as of time of writing)
Other podcast players imported this file just fine (Tsacdop, Podverse and AntennaPod, all from F-Droid).
Escapepod starts the file picker with a mime type filter. The filter is set to "text/xml" at the moment. Reading your bug report I was considering to widen the filter to "text/*" (all text file types).
For testing purposes I created a text file with OPML data, saved it as "feeds.opml", and uploaded it to my phone. The system file browser categorizes the file with an .opml extension as a binary file.
With a filter set to "text/*" one would still not be able to open .opml files.
I am a bit hesitant to open the filter to include binary files. I need to check if I can whitelist the .opml file extension.
❓ May I ask as what kind of file the opml file from Castro is identified on your phone - also BIN or TXT or ... ❓
It is classified as a BIN file, like in your screenshot.
By the way, it looks like AntennaPod (at least, I have uninstalled others already) just accepts any file and then shows an error message (a pretty ugly one) when parsing fails. Which, if it isn't possible to specify the filter through an extension or differently, might be a better way to go about this. The current way (
text/xml) isn't bulletproof either, not all XMLs are OPML files, so it shouldn't be a significant problem.
Alternatively, you could specify multiple MIME types and only allow
text/xml and whatever MIME type is assigned to opml files (should be one of
text/x-opml, but will probably be a generic binary MIME type, like
application/octet-stream or just
application/*). If it was my call, I'd allow just
application/*. It wouldn't be perfect, but it would prevent the most obivous errors (like choosing a photo or something) and it would probably work no matter what MIME Android thinks
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?