NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Rewrite import and export subscriptions functionality using coroutines

Open Isira-Seneviratne opened this issue 1 year ago • 1 comments

What is it?

  • [ ] Bugfix (user facing)
  • [x] Feature (user facing)
  • [x] Codebase improvement (dev facing)
  • [ ] Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Implement the subscription import/export functionality using CoroutineWorker for better performance and readability of the code.
  • Make the import process cancellable (exporting usually completes too quickly to show a notification).
  • Read/write subscription data using the Kotlinx Serialization library and plugin.
  • Update WorkManager from 2.8.1 to 2.10.0 (changelog)
  • Update the compile SDK to 35 (required by WorkManager).

Before/After Screenshots/Screen Record

Export

  • Before:

Screen_recording_20241129_071419.webm

Android 6.0

  • After:

Screen_recording_20241129_064527.webm

Android 6.0

https://github.com/user-attachments/assets/db72de5f-c263-4365-8f3e-cd4458df533d

Android 15

Fixes the following issue(s)

  • Fixes #

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

Isira-Seneviratne avatar Nov 29 '24 02:11 Isira-Seneviratne

I rebased on current refactor, and added a commit which kotlin-ifies the SubscriptionImportWorker input data a little, turning them into a sealed class that auto-parcelizes.

Unfortunately, there is no Data.Builder().fromParcelable() or similar, so the Data conversion has to be done manually still, but I centralized it in the sealed class so it should be straightforward as well.

Profpatsch avatar Jan 22 '25 14:01 Profpatsch

Once the missing error handling is added on import & the question about how leniently to parse the json is resolved, I’d say LGTM!

Profpatsch avatar Jan 22 '25 15:01 Profpatsch