Skip to content

Fixed bug which was causing AnkiDroid API to not list media on cards.#17859

Merged
mikehardy merged 1 commit intoankidroid:mainfrom
ujjol1234:filesinStr-BUG-Fix
Jun 25, 2025
Merged

Fixed bug which was causing AnkiDroid API to not list media on cards.#17859
mikehardy merged 1 commit intoankidroid:mainfrom
ujjol1234:filesinStr-BUG-Fix

Conversation

@ujjol1234
Copy link
Contributor

Purpose / Description

Fixed the bug which was causing AnkiDroid API to not list media on cards. Added a unit test to confirm that media files are listed correctly in the ReviewInfo.

Fixes

Approach

Reimplemented the filesinStr function which was causing the bug.

How Has This Been Tested?

A unit test testMediaFilesAddedCorrectlyInReviewInfo() has been added in the ContentProviderTest.kt to confirm that the MEDIA_FILES attribute of ReviewInfo gets populated correctly.

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@welcome
Copy link

welcome bot commented Jan 22, 2025

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Jan 23, 2025
@github-actions
Copy link
Contributor

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Feb 28, 2025
@github-actions github-actions bot closed this Mar 7, 2025
@mikehardy
Copy link
Member

I feel like we were close here but both David and I have been really busy, apologies for the default-stale-close
Will reopen to give another chance for @ujjol1234 to advance the comments under discussion

@mikehardy mikehardy reopened this Apr 2, 2025
@github-actions github-actions bot removed the Stale label Apr 2, 2025
@github-actions

This comment has been minimized.

@github-actions github-actions bot added Stale and removed Stale labels Apr 16, 2025
@david-allison

This comment was marked as outdated.

@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the Stale label May 5, 2025
@github-actions github-actions bot closed this May 12, 2025
@david-allison david-allison added the Needs a new dev For PR that were good start but the original dev' left. Any dev can take over and finish it. label Jun 3, 2025
@david-allison david-allison reopened this Jun 3, 2025
@david-allison david-allison removed Needs Author Reply Waiting for a reply from the original author Needs a new dev For PR that were good start but the original dev' left. Any dev can take over and finish it. Has Conflicts labels Jun 9, 2025
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have force pushed this and feel it's ready for review

@ujjol1234
Copy link
Contributor Author

Hi @david-allison, apologies for the delayed response — I had semester exams going on. I’m back now and will be able to contribute consistently moving forward!

@david-allison
Copy link
Member

No worries! I've taken this to the finish line and added a decent amount more issues

Thanks so much for the hard work here

Fixed bug which was causing AnkiDroid API to not list media on cards.

Due to card rendering being moved to the backend, and Anki
using different Regex handling code, we needed to change the
implementation of `files_in_str`:

[sound:] tags were stripped, for example

https://github.com/ankitects/anki/blob/64ca90934bc26ddf7125913abc9dd9de8cb30c2b/pylib/anki/media.py#L136-L150

Fixes 17062
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not going to second-guess your work here, let's get this in and we can do follow-ons as needed. Will pick to 2.21 branch so it'll hit the next release

@mikehardy mikehardy added this pull request to the merge queue Jun 25, 2025
@mikehardy mikehardy added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Review labels Jun 25, 2025
Merged via the queue into ankidroid:main with commit e8dce4e Jun 25, 2025
9 checks passed
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AnkiDroid API no longer lists media on cards

4 participants