Audio/video uploads: current gaps in the upload flow

Open
#7,106 2 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
android, kotlin
Domain
backend, mobile

Research direction

Start with AndroidManifest.xml and FileUtils.uploadableFileFormats for A and C, then inspect FilePicker.kt and ImageFileLoader.kt for the picker gaps. The issue identifies upload screen audio handling and unsupported gallery formats as additional areas, with related work in #4352, #6825, and #7089. A first step is to implement A and C; done means supported Commons audio and video types can be shared to the app.

Written by the indexing model from the issue text.

Description

I tested Ogg audio files with the upload flow on main (prodDebug, Redmi A3 Pro, Android 14), and checked which other audio and video types the app accepts (AndroidManifest.xml, the file type checks, and Android share targets on the phone). This is to see what is missing for the goals of the Outreachy project T437071 (https://phabricator.wikimedia.org/T437071, see also #6955).

Related older issues: #4208 (audio uploads), #4 (video uploads).

Goal: detect supported audio and video files selected from the device
  • A. Ogg files shared as application/ogg are never offered to Commons. Xiaomi's File Manager shares .ogg files with the type application/ogg, but the app only registers audio/ogg (AndroidManifest.xml) and only allows audio/ogg in FileUtils.uploadableFileFormats. So "Upload to Commons" does not appear in the share menu. Log from the share menu:

    MiuiChooserActivity: Target intent: Intent { act=android.intent.action.SEND typ=application/ogg ... }
    
  • B. The in-app pickers only show images. The gallery picker uses image/* (FilePicker.kt) and the custom selector only queries MediaStore.Images (ImageFileLoader.kt), so audio and video cannot be picked inside the app.

  • C. Most formats that Commons accepts cannot be shared to the app. The share filter only has image/* and audio/ogg:

    Format Accepted by Commons Accepted by the app
    Ogg Vorbis (.ogg) yes only as audio/ogg (see A)
    Opus (.opus) yes (preferred) no
    FLAC / WAV yes no
    WebM video yes no
    Ogg Theora (.ogv) / MPEG yes no
    MP4 (phone camera) no no

    (Source: https://commons.wikimedia.org/wiki/Commons:File_types)

    Goal: extend the existing upload flow
    • Image-only checks run on audio files ("Image is too dark", "Please only upload pictures that you have taken by yourself") - #4352, PR open: #7079
    • D. The upload screen treats audio as an image: the preview is blank, the "Edit Image" button is shown, and the texts say "image"/"picture" ("Problems found in image", "Do you still want to upload this picture?")
Image
Goal: handle validation
  • HEIC/HEIF photos were blocked by #6825 - #7089, PR open: #7100
  • E. The gallery picker offers GIF, TIFF, WebP and XCF, but these are rejected with "Unsupported Format" after the user picks them.

I would like to work on A and C first, since they decide which files can enter the upload flow.

@RitikaPahwa4444 @nicolas-raoul @neeldoshii I would appreciate your feedback on this list, especially on whether A and C are good first steps.

Dominant language
Kotlin
Stars
1.2k
Forks
1.4k
Avg merge
1d 4h
Merged PRs (30d)
156

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from commons-app/apps-android-commons

All issues in commons-app/apps-android-commons

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.