Repository navigation
Milestone 1 v2 stabilization - #2654
Open
cyberlog69 wants to merge 3 commits into
Open
cyberlog69 wants to merge 3 commits into
cyberlog69 wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
feat: Milestone 1 - DownloaderV2 stabilization, legacy V1 retirement, and test coverageDescription
Overview
This PR completes Milestone 1 of the v2.0 architecture overhaul. It fully deprecates and removes the legacy single-job
Downloader(V1) components, migrates all remaining pages and background receivers toDownloaderV2, refines custom command execution and restart logic, adds multi-task notification action handling (cancel/restart), and introduces comprehensive unit tests for task states, transitions, and queue serialization.Net result: -1,103 lines of obsolete code removed while providing full concurrency support and test coverage.
Key Changes
1. 🗑️ Legacy V1 Retirement & Technical Debt Cleanup
Downloader.kt(-573 lines).DownloadPage.kt(-805 lines) andHomePageViewModel.kt(-145 lines).App.ktandAppEntry.kt.TaskListPage.kt: Switched task listing, creation, and cancellation to useDownloaderV2.getTaskStateMap(),enqueue(), andcancel().TaskLogPage.kt: Updated live log viewing, process cancellation, and restart handling to read from and dispatch toDownloaderV2.YtdlpUpdater.kt: Replaced checks against legacyDownloader.downloaderStatewith active queue inspection fromDownloaderV2.2. ⚡ DownloaderV2 Polish & Notification Actions
DownloaderV2.kt):Task.download()to evaluate and execute custom commands prior to null-checkinginfo(commands don't have video metadata).Task.execute()to accept bothIdle(fresh start) andReadyWithInfo(restart after cancel/error).ACTION_RESTART_TASKsupport toNotificationActionReceiver.ktso individual tasks can be restarted straight from error notifications.NotificationUtil.ktto accept ataskIdinnotifyErrorand attach a Restart action alongside the error report button.3. 🧪 Testing & Quality Assurance
TaskFactoryTest.kt: Unit tests for playlist item extraction and custom command factory methods.TaskStateTransitionTest.kt:Running<ReadyWithInfo<FetchingInfo<Idle<Canceled<Error<Completed).FetchInfo->Idle,Download->ReadyWithInfo).TaskBackupRestoreTest.kt:Map<Task, Task.State>serialization and deserialization via Kotlinx Serialization (allowStructuredMapKeys = true).enqueueFromBackup().Verification & Testing
:app:testGenericDebugUnitTestacross all test classes:TaskFactoryTest: PASSEDTaskStateTransitionTest: PASSEDTaskBackupRestoreTest: PASSEDExampleUnitTest: PASSEDDiff Summary