Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ val collectionMethods =
"getIgnoredBeforeCount" to { bytes -> getIgnoredBeforeCountRaw(bytes) },
"getRetentionWorkload" to { bytes -> getRetentionWorkloadRaw(bytes) },
"simulateFsrsWorkload" to { bytes -> simulateFsrsWorkloadRaw(bytes) },
// https://github.com/ankitects/anki/pull/4326 -> saveCustomColours should be no-op in mobile clients
"saveCustomColours" to { bytes -> backendIdentity(bytes) },
"saveCustomColours" to { bytes -> saveCustomColoursRaw(bytes) },
"getCustomColours" to { bytes -> getCustomColoursRaw(bytes) },
)

suspend fun handleCollectionPostRequest(
Expand Down
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/scheduling/Fsrs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ value class FsrsVersion(
when (libraryVersion) {
"0.6.4" -> "FSRS 4.5"
"1.4.3", "2.0.3" -> "FSRS 5"
"4.1.1", "5.1.0" -> "FSRS 6"
"4.1.1", "5.1.0", "5.2.0" -> "FSRS 6"
else -> null
}
}
15 changes: 14 additions & 1 deletion AnkiDroid/src/test/java/com/ichi2/anki/TranslationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class TranslationTest : RobolectricTest() {
@Test
fun `translatable strings do not duplicate GeneratedTranslations`() =
runTest {
val backendStrings = getBackendNonArgStrings()
val backendStrings =
getBackendNonArgStrings()
.filterNot { it.methodName in IGNORED_BACKEND_TRANSLATIONS }
val backendByText = backendStrings.groupBy { it.text }
val backendByTextLower = backendStrings.groupBy { it.text.lowercase() }
val xmlStrings = getTranslatableXmlStrings()
Expand Down Expand Up @@ -363,5 +365,16 @@ class TranslationTest : RobolectricTest() {
// TR.studyingShowAnswer()
// TR.deckConfigQuestionActionShowAnswer()
)

/**
* Backend translation method names (e.g. `TR.xx()`) excluded from the
* duplicate check as the strings are unrelated conceptually.
*
* Do not remove this set when empty.
*/
private val IGNORED_BACKEND_TRANSLATIONS =
setOf(
"launcherOff", // "Off" - unrelated to R.string.full_screen_off
)
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ androidxWebkit = "1.15.0"
# https://developer.android.com/jetpack/androidx/releases/work
androidxWork = "2.11.2"
# https://github.com/ankidroid/Anki-Android-Backend/
ankiBackend = '0.1.64-anki25.09.2'
ankiBackend = '0.1.65-anki26.05b1'
autoService = "1.1.1"
autoServiceAnnotations = "1.1.1"
# https://github.com/skydoves/ColorPickerView/releases
Expand Down
6 changes: 6 additions & 0 deletions libanki/src/main/java/com/ichi2/anki/libanki/Collection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,12 @@ class Collection(

@NotInPyLib
fun evaluateParamsLegacyRaw(input: ByteArray): ByteArray = backend.evaluateParamsLegacyRaw(input = input)

@NotInPyLib
fun saveCustomColoursRaw(input: ByteArray): ByteArray = backend.saveCustomColoursRaw(input = input)

@NotInPyLib
fun getCustomColoursRaw(input: ByteArray): ByteArray = backend.getCustomColoursRaw(input = input)
}

@NotInPyLib
Expand Down
1 change: 1 addition & 0 deletions libanki/src/main/java/com/ichi2/anki/libanki/Deck.kt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ fun Order.toDisplayString(translations: Translations) =
Order.REVERSE_ADDED -> translations.decksLatestAddedFirst()
Order.RETRIEVABILITY_ASCENDING -> translations.deckConfigSortOrderRetrievabilityAscending()
Order.RETRIEVABILITY_DESCENDING -> translations.deckConfigSortOrderRetrievabilityDescending()
Order.RELATIVE_OVERDUENESS -> translations.decksRelativeOverdueness()
Order.UNRECOGNIZED -> throw IllegalArgumentException("Can't display an unknown enum value.")
}

Expand Down
Loading