Anki is a smart spaced repetition flashcard program https://apps.ankiweb.net
Find a file
llama 3479499569
fix(import): avoid case-folding already existing media filenames (#4851)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

Fixes #4716 

## Summary / motivation (required)

#4435 made it so that all new added media would have lowercased names,
but this was bugged and led to media refs pointing to inexistent files
on case-insensitive filesystems

The fix proposed is to try adding new files with lowercased names only
if they don't already exist, using the existing file otherwise

## Steps to reproduce (required, use N/A if not applicable)

See linked issue

## How to test (required)

Try copy-pasting a media file from the Edit window of an existing note
to the Add window and see that the filename in the resulting media ref
isn't forced to be lowercased

When pasting a new file, see that the filename is now lowercased

### Checklist (minimum)

- [x] I ran `./ninja check` or an equivalent relevant check locally.
- [ ] I added or updated tests when the change is non-trivial or
behavior changed.

## Scope

- [x] This PR is focused on one change (no unrelated edits).
2026-05-18 18:56:54 +03:00
.cargo Statically link MSVC runtime, removing the need to install the redistributable (#4166) 2025-07-05 15:03:14 +03:00
.config Drop workspace-hack in favor of workspace deps 2023-06-23 17:41:31 +10:00
.cursor/rules Make URL schemes dialog more ergonomic (#4002) 2025-05-15 16:17:33 +10:00
.github feat: add Rust test coverage (#4842) 2026-05-18 11:38:37 -03:00
.idea.dist Update PyCharm docs (#4389) 2025-10-27 19:27:50 +07:00
.vscode.dist Update VS Code config (#4397) 2025-10-27 19:31:59 +07:00
build fix: Prevent Windows elevation errors when running ninja_gen's update binaries (#4848) 2026-05-16 11:55:11 +03:00
cargo Release infrastructure improvements (#4802) 2026-05-09 17:34:18 -04:00
docs Release infrastructure improvements (#4802) 2026-05-09 17:34:18 -04:00
ftl Briefcase Installer (#4629) 2026-05-05 17:29:18 -04:00
proto Briefcase Installer (#4629) 2026-05-05 17:29:18 -04:00
pylib fix: beta/rc suffix handling in int_version() (#4828) 2026-05-14 15:12:06 +03:00
python Build and publish dev docs (#4579) 2026-03-31 08:26:59 -04:00
qt feat: Distribute compiled sources in Briefcase bundle (#4856) 2026-05-18 17:47:03 +03:00
rslib fix(import): avoid case-folding already existing media filenames (#4851) 2026-05-18 18:56:54 +03:00
tools feat: add TS test coverage (#4843) 2026-05-18 11:54:16 -03:00
ts feat: add TS test coverage (#4843) 2026-05-18 11:54:16 -03:00
.deny.toml Update to Rust 1.92 (#4461) 2026-01-11 18:50:16 +07:00
.dockerignore Add distroless Dockerfile and implement internal health check (#3366) 2024-08-29 17:05:33 +07:00
.dprint.json Briefcase Installer (#4629) 2026-05-05 17:29:18 -04:00
.eslintrc.cjs Include error message text on page 2024-06-24 15:35:47 +07:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore Build and publish dev docs (#4579) 2026-03-31 08:26:59 -04:00
.gitmodules Briefcase Installer (#4629) 2026-05-05 17:29:18 -04:00
.mypy.ini Briefcase Installer (#4629) 2026-05-05 17:29:18 -04:00
.pre-commit-config.yaml Add pre-commit for automated pre-push checks (#4660) 2026-04-06 12:04:49 -03:00
.prettierrc Switch back to Prettier for Svelte formatting 2025-01-13 15:53:55 +11:00
.python-version feat: Distribute compiled sources in Briefcase bundle (#4856) 2026-05-18 17:47:03 +03:00
.readthedocs.yaml Build and publish dev docs (#4579) 2026-03-31 08:26:59 -04:00
.ruff.toml Switch to Ruff (#4119) 2025-06-29 14:38:35 +07:00
.rustfmt-empty.toml Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
.rustfmt.toml Move ascii_percent_encoding into a separate repo 2023-04-12 08:45:23 +10:00
.version Bump version 2025-09-17 16:50:13 +10:00
.yarnrc.yml chore: add release-age controls for uv and Yarn dependencies (#4761) 2026-04-30 13:38:42 -03:00
Cargo.lock fix: Prevent Windows elevation errors when running ninja_gen's update binaries (#4848) 2026-05-16 11:55:11 +03:00
Cargo.toml chore(deps): bump sha2 from 0.10.9 to 0.11.0 (#4743) 2026-04-24 14:47:12 -03:00
check Add a shortcut to auto-format before running checks 2023-07-02 09:59:05 +10:00
CLAUDE.md Support hidden local Claude config 2025-06-29 22:16:59 +07:00
CONTRIBUTORS fix(export): preserve browser focus after note export (#4845) 2026-05-18 05:30:57 +03:00
justfile feat: add TS test coverage (#4843) 2026-05-18 11:54:16 -03:00
LICENSE Drop Pauker and SuperMemo importers from legacy importer 2025-06-27 16:10:12 +07:00
ninja Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
package.json feat: add TS test coverage (#4843) 2026-05-18 11:54:16 -03:00
pyproject.toml feat: add Python test coverage (#4841) 2026-05-15 21:34:38 -03:00
README.md Add punctuation, convert raw URLs to markdown links in READMEs (#4570) 2026-04-01 10:23:23 -03:00
release.just Release infrastructure improvements (#4802) 2026-05-09 17:34:18 -04:00
run Migrate build system to uv (#4074) 2025-06-19 14:03:16 +07:00
run.bat One step closer to tools/run-qt* on Windows 2025-09-01 13:39:46 +10:00
rust-toolchain.toml Update to Rust 1.92 (#4461) 2026-01-11 18:50:16 +07:00
SECURITY.md Update security.md. (#4790) 2026-05-11 13:04:24 -04:00
uv.lock feat: add Python test coverage (#4841) 2026-05-15 21:34:38 -03:00
yarn Do JS license output from top-level script 2026-02-11 14:26:53 +07:00
yarn.bat Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
yarn.lock feat: add TS test coverage (#4843) 2026-05-18 11:54:16 -03:00

Anki

Build Status Documentation

This repo contains the source code for the computer version of Anki.

About

Anki is a spaced repetition program. Please see the website to learn more.

This repo contains the source code for the computer version of Anki.

Getting Started

Contributing

Want to contribute to Anki? Check out the Contribution Guidelines.

For more information on building and developing, please see Development.

Contributors

The following people have contributed to Anki: CONTRIBUTORS

Anki Betas

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see Anki betas.

License

Anki's license: LICENSE