Fix Cover sharing and saving (#5335)

* Fix Cover sharing and saving

The newly added manga cover sharing only worked with manga saved to the library (due to the implemented CoverCache only recording covers of library manga).
The changes made with this commit fixes that behaviour by implementing a fallback: the cover can now also be retrieved from the Coil memoryCache.

* Removal of coil MemoryKey usage

No longer uses the coil memory key, instead starts a new Coil request for the cover retrieval.

* Removed try-/catch-wrapper and added context-passing

useCoverAsBitmap lost its try-/catch-wrapper and doesn't call for the context anymore.
Instead shareCover and saveCover now pass their activity as context to useCoverAsBitmap.

* Added missing parameter description for useCoverAsBitmap
This commit is contained in:
E3FxGaming
2021-07-18 19:17:31 +02:00
committed by GitHub
parent a69a833716
commit fcd6fe5d8a
3 changed files with 112 additions and 21 deletions

View File

@@ -75,7 +75,7 @@ class CategoryTest {
assertThat(c.id).isNotZero
// Add a manga to a category
val m = db.getMangas().executeAsBlocking()[0]
val m = db.getLibraryMangas().executeAsBlocking()[0]
val mc = MangaCategory.create(m, c)
db.insertMangaCategory(mc).executeAsBlocking()