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

fix: audio autoplay in template previewer #17725

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

RobozinhoD
Copy link
Contributor

Purpose / Description

Describe the problem or feature and motivation

Fixes

Approach

libanki's ephemeralCard() method always used the default deck id (the desktop version has the same issue).

That leads to using the default deck config for the template previews.

This fixes the issue by adding an optional deckId argument

How Has This Been Tested?

  1. Add a new deck type
  2. Set Don't play audios automatically of the new deck type to true
  3. Set Don't play audios automatically of the Default to false
  4. Assign the new deck type to a card with audio
  5. Open the card

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

libanki's ephemeralCard() method always used the default deck id (the desktop version has the same issue).

That leads to using the default deck config for the template previews.

This fixes the issue by adding an option deckId parameter
Copy link
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

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

Great investigation. I believe that it is worth to report the issue in the desktop version as well.

I think that this could be implemented in other ways, but this one is probably the simplest and is versatile, so LGTM

@BrayanDSO BrayanDSO added the Needs Second Approval Has one approval, one more approval to merge label Jan 6, 2025
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.

also LGTM here for AnkiDroid, thanks

@mikehardy mikehardy added this pull request to the merge queue Jan 6, 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 Second Approval Has one approval, one more approval to merge labels Jan 6, 2025
Merged via the queue into ankidroid:main with commit 0774158 Jan 6, 2025
12 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 Jan 6, 2025
@github-actions github-actions bot added this to the 2.21 release milestone Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audio Plays Automatically When it Shouldn't
3 participants