Currently, the Wikisource reader app is downloading a book as many times as possible, which are then listed in the library section multiple times. So, if a book with the wikidata id already exists in local library, the book detail screen should show Start Reading button instead of Download button to avoid duplicate downloads.
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | LGoto | T403210 Projects and mentors for Wikimedia Outreachy Round 31 | |||
| Resolved | Muguro | T405593 Outreachy 31: Improve the Wikisource Reader App | |||
| Resolved | Muguro | T408176 Fix duplicate book downloads |
Event Timeline
The local library section of the app contains multiple copies of the same book when they are downloaded multiple times, which is redundant for book readers. Some of the app users mentioned this to be resolved on different occasions.
OK. I think disabling it completely is a bad idea, but telling people that they have already downloaded a copy of the book based on revisionID #### might have more legs.
We could replace the download button with go to library for books that are already in library. This will prevent the multiple downloads of the same book.
@Muguro, I think replacing it with a go to library button would bring back the issue users complained of previously of having to carry out an extra step of navigating to the library section before they can read their books.
@Deba_Jeff For sure, starting to read instead of going to the Library is a better approach. I'll proceed as soon as T406819 is fixed.
@Saiphani02 I have opened a PR for this, please check it out.
https://github.com/cis-india/Wikisource-Reader/pull/55
@Muguro Books with "?" in title are throwing an error on Download. Feel free to create a new task if this merged PR did not cause it.
Build version: 1.2.2
Current date: 2025-11-12 12:08:36
Device: Nothing A015
OS version: Android 15 (SDK 35)
Stack trace:
V5.b: /storage/emulated/0/Android/data/org.cis_india.wsreader/files/temp_books/Rani+na+Khuni?+(Last+Part).epub: The source file doesn't exist.
at V5.c.c0(Unknown Source:119)
at w8.c.u(Unknown Source:165)
at Q5.a.p(Unknown Source:8)
at w7.I.run(Unknown Source:109)
at t5.t.run(Unknown Source:497)
at D7.j.run(Unknown Source:2)
at D7.a.run(Unknown Source:93)
Suppressed: B7.f: [s0{Cancelling}@dcebb5a, Dispatchers.IO]
@Saiphani02 This is happening because we are encoding the URL for books with a question mark ("?")
I'll create a new task to fix this.
@Saiphani02 I have noticed the "?" in the title is whats causing the issue as it is an invalid character while using File class.
val tempFile = File(tempFolder, filename)
I have created the following task T409896 to fix this.