feat: report download status in the mood detail
The client can show a per-track Downloading/Added/Failed state in search instead of relying on a snackbar under the keyboard.
This commit is contained in:
1 parent
de1e95bfc6
commit
6763a83b03
4 files changed
+35
-4
No files matched your search
@@ -398,9 +398,13 @@ class ApiRoutesTest {
|
||||
setBody("""{"source":"youtube","externalId":"vid-new"}""")
|
||||
}
|
||||
assertEquals(HttpStatusCode.Accepted, queued.status)
|
||||
assertTrue(
|
||||
parse(queued.bodyAsText())["downloading"]!!.jsonPrimitive.content.toBoolean(),
|
||||
)
|
||||
val queuedBody = parse(queued.bodyAsText())
|
||||
assertTrue(queuedBody["downloading"]!!.jsonPrimitive.content.toBoolean())
|
||||
val queuedDownload = queuedBody["detail"]!!.jsonObject["downloads"]!!.jsonArray
|
||||
.map { it.jsonObject }
|
||||
.first { it.string("externalId") == "vid-new" }
|
||||
assertEquals("queued", queuedDownload.string("state"))
|
||||
assertEquals("youtube", queuedDownload.string("source"))
|
||||
val youtubeJob = DownloadRepository.find(
|
||||
moodId,
|
||||
"vid-new",
|
||||
|
||||
Reference in new issue
Block a user