ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

Thumbnails and previews missing #138

Closed kirillt closed 2 years ago

kirillt commented 2 years ago

_1 _2 _3

kirillt commented 2 years ago

Probably this happens for existing resources after the app restarted. New resources have their previews and thumbnails loaded.

This issue reproduces on my Android 9 device and it doesn't on Android 11.

kirillt commented 2 years ago

The way to reproduce (I guess, on any device, but better to check):

  1. Index a folder, previews and thumbnails must be visible.
  2. Close the app.
  3. Go to Android settings, find Apps section, locate the app.
  4. Go to Storage section of the app, press "clear cache".
  5. Run the app again, open the same folder. Expected: previews and thumbnails are still visible. Actual: previews and thumbnails are missing.

Explanation: we store the index as app's data and previews/thumbnails as app's cache. The index still contains all resources, so re-indexing doesn't heppen, but previews generation is triggered only during indexing.

Apparently, Android can clean cache at any moment, so we should either store previews/thumbnails as data or the index as cache. If we want to stick to keeping images in cache, then we should check their presence during folder opening. This may reduce performance significantly for huge folders.

cnzqa commented 2 years ago

Creating folder: space.taran.arknavigator D/previews: previews provided in 12553ms space.taran.arknavigator D/resources-index: 1572 resources returned

After cleaning cache: /space.taran.arknavigator D/previews: previews provided in 25169ms sace.taran.arknavigator D/resources-index: 1572 resources returned

Phone: Xiaomi A2 Android: 10 Folder: 1572 files, ~400mb size

Used build 165, previews and thumbnails are visible

kirillt commented 2 years ago

@vedranqa that's strange.. no mistakes? Was the second result (after cleaning cache) opening or creating the folder?

cnzqa commented 2 years ago

@kirillt this second case After cleaning cache is Opening same folder like in first case.

kirillt commented 2 years ago

Implemented in #143

cnzqa commented 2 years ago

This is active on main build (id 204) after deleting cache we dont have thumbnails and previews.

cnzqa commented 2 years ago

Build 204 issue is active.

Build 208 seems ok

We can resolve this task. Video is large, open Link

kirillt commented 2 years ago

@vedranqa build 204 is too early, build 208 is correct one. Thank you, it looks good.