Rewrite import and export subscriptions functionality using coroutines#11759
Conversation
|
| try { | ||
| @OptIn(ExperimentalSerializationApi::class) | ||
| return json.decodeFromStream<SubscriptionData>(`in`).subscriptions | ||
| } catch (e: Throwable) { | ||
| throw InvalidSourceException("Couldn't parse json", e) | ||
| } | ||
| } |
There was a problem hiding this comment.
From a cursory look, this seems to be a lot stricter than the previous json parser.
e.g. the serviceId would default to 0, and items in the list would simply be skipped if they don’t conform to the schema.
Do we want to change that behavior?
app/src/main/java/org/schabi/newpipe/local/subscription/ImportConfirmationDialog.java
Outdated
Show resolved
Hide resolved
e99c0bc to
dbd11a6
Compare
|
I rebased on current Unfortunately, there is no |
app/src/main/java/org/schabi/newpipe/local/subscription/workers/SubscriptionImportWorker.kt
Outdated
Show resolved
Hide resolved
|
Once the missing error handling is added on import & the question about how leniently to parse the json is resolved, I’d say LGTM! |
# Conflicts: # gradle/libs.versions.toml
144d7f1 to
abaf16e
Compare
|
|
Profpatsch
left a comment
There was a problem hiding this comment.
I still think we might run into issues because the json parsing is now stricter, but if you think it’s fine we can merge
…port-worker Rewrite import and export subscriptions functionality using coroutines



What is it?
Description of the changes in your PR
CoroutineWorkerfor better performance and readability of the code.Before/After Screenshots/Screen Record
Export
Screen_recording_20241129_071419.webm
Android 6.0
Screen_recording_20241129_064527.webm
Android 6.0
Screen_recording_20241129_064829.mp4
Android 15
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence