Merge branch 'main' into autosync-error

This commit is contained in:
Damien Elmes 2025-08-20 01:18:04 +10:00 committed by GitHub
commit 1f7b04b429
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 2590 additions and 3215 deletions

1
Cargo.lock generated
View file

@ -3959,6 +3959,7 @@ dependencies = [
"anki_process",
"anyhow",
"camino",
"serde_json",
"walkdir",
"which",
]

View file

@ -169,7 +169,7 @@ fn build_rsbridge(build: &mut Build) -> Result<()> {
pub fn check_rust(build: &mut Build) -> Result<()> {
let inputs = inputs![
glob!("{rslib/**,pylib/rsbridge/**,ftl/**,build/**,qt/launcher/**}"),
glob!("{rslib/**,pylib/rsbridge/**,ftl/**,build/**,qt/launcher/**,tools/minilints/**}"),
"Cargo.lock",
"Cargo.toml",
"rust-toolchain.toml",

File diff suppressed because it is too large Load diff

View file

@ -99,8 +99,6 @@ impl Collection {
historical_retention.unwrap_or(0.9),
ignore_before,
)?;
let preset_desired_retention =
req.as_ref().map(|w| w.preset_desired_retention).unwrap();
let mut progress = self.new_progress_handler::<ComputeMemoryProgress>();
progress.update(false, |s| s.total_cards = items.len() as u32)?;
for (idx, (card_id, item)) in items.into_iter().enumerate() {
@ -108,6 +106,7 @@ impl Collection {
let mut card = self.storage.get_card(card_id)?.or_not_found(card_id)?;
let original = card.clone();
if let Some(req) = &req {
let preset_desired_retention = req.preset_desired_retention;
// Store decay and desired retention in the card so that add-ons, card info,
// stats and browser search/sorts don't need to access the deck config.
// Unlike memory states, scheduler doesn't use decay and dr stored in the card.

View file

@ -12,5 +12,6 @@ anki_io.workspace = true
anki_process.workspace = true
anyhow.workspace = true
camino.workspace = true
serde_json.workspace = true
walkdir.workspace = true
which.workspace = true

View file

@ -2,6 +2,7 @@
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use std::cell::LazyCell;
use std::collections::BTreeMap;
use std::collections::HashSet;
use std::env;
use std::fs;
@ -267,5 +268,16 @@ fn generate_licences() -> Result<String> {
"--manifest-path",
"rslib/Cargo.toml",
])?;
Ok(output.stdout)
let licenses: Vec<BTreeMap<String, serde_json::Value>> = serde_json::from_str(&output.stdout)?;
let filtered: Vec<BTreeMap<String, serde_json::Value>> = licenses
.into_iter()
.map(|mut entry| {
entry.remove("version");
entry
})
.collect();
Ok(serde_json::to_string_pretty(&filtered)?)
}