-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: Improve Check Media dialog #17842
base: main
Are you sure you want to change the base?
Conversation
Important Maintainers: This PR contains Strings changes
|
b6f458d
to
1bba6f3
Compare
1bba6f3
to
e168034
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue with tagMissing
, but this is great!
@@ -33,6 +36,8 @@ class MediaCheckDialog : AsyncDialogFragment() { | |||
fun mediaCheck() | |||
|
|||
fun deleteUnused(unused: List<String>) | |||
|
|||
fun tagMissing(missingMediaNotes: List<Long>?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the ViewModel, or a Fragment listener, we want to move away from interfaces
val noHaveFormatted = noHave.joinToString("\n") { TR.mediaCheckMissingFile(it) } | ||
val unusedFormatted = unused.joinToString("\n") { TR.mediaCheckUnusedFile(it) } | ||
|
||
val formattedList = | ||
buildString { | ||
if (noHaveFormatted.isNotEmpty()) { | ||
append(TR.mediaCheckMissingHeader()) | ||
append("\n") | ||
append(noHaveFormatted) | ||
append("\n\n") | ||
} | ||
|
||
if (unusedFormatted.isNotEmpty()) { | ||
append(TR.mediaCheckUnusedHeader()) | ||
append("\n") | ||
append(unusedFormatted) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be useful to extract to a method so we can test it
@@ -196,6 +239,7 @@ class MediaCheckDialog : AsyncDialogFragment() { | |||
UNUSED to ArrayList(checkList.unusedFileNames), | |||
INVALID to ArrayList(checkList.invalidFileNames), | |||
MEDIA_CHECK_DIALOG_TYPE_KEY to dialogType.code, | |||
MISSING_MEDIA_NOTES to ArrayList(checkList.missingMediaNotes).toList(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will eventually throw a TransactionTooLargeException
. When?
val noHaveFormatted = noHave.joinToString("\n") { TR.mediaCheckMissingFile(it) } | ||
val unusedFormatted = unused.joinToString("\n") { TR.mediaCheckUnusedFile(it) } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name the arguments
Purpose / Description
Make the media check dialog consistent with Anki, and allow tagging missing media file notes
Fixes
How Has This Been Tested?
Learning (optional, can help others)
More about the Anki codebase
Checklist
Please, go through these checks before submitting the PR.