ankidroid / ankidroid/Anki-Android

[PERF] Import - Avoid copying local files to cache

Aperta
#6,036 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Import Keep Open Performance
Lingua principale
Kotlin
Stelle
11.8k
Fork
2.9k
Merge medio
2g 3h
PR unite (30g)
167

Descrizione

Came across this when looking into cache usage for the visual editor. I had 700MB in my cache (my phone seems buggy and shows this as "data" usage rather than "cache" on the app screen).

It was removed when I cleared the cache.

File was in `/data/data/com.ichi2.anki/cache`

This an easy win in terms of import performance and removing "out of space" errors. It'll also reduce the likelihood of #5880 as we won't leave remnant files in the cache.

###### Reproduction Steps

1. Import
2. Select File from Internal Storage

###### Expected Result

3. File is not copied to cache when local

###### Actual Result

3. File is copied to cache

###### Debug info
AnkiDroid Version = 2.10alpha70

Android Version = 9

ACRA UUID = d84098a2-8ccd-4e01-b2cf-51d99e7b02c5

###### Research
- [x] I have read the [support page](https://ankidroid.org/docs/help.html) and am reporting a bug or enhancement request specific to AnkiDroid
- [x] I have checked the [manual](https://ankidroid.org/docs/manual.html) and the [FAQ](https://github.com/ankidroid/Anki-Android/wiki/FAQ) and could not find a solution to my issue
- [x] I have searched for similar existing issues here and on the user forum

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.