github vivizzz007/vivi-music B5.0.2
VIVI-MUSIC-BETA

latest releases: v6.0.5, v6.0.4, v6.0.3...
pre-release6 months ago

**CHECK IF THE PLAYLIST DISAPPEARS OR NOT **

implemented several improvements to make the application more robust when handling Liked songs, Library songs, and Downloaded songs. These changes prevent songs from "disappearing" due to API inconsistencies or transient network states.

Changes

  1. Robust YouTube Parsing
    I've made the InnerTube parser more flexible to handle variations in YouTube Music's API responses.

PlaylistPage.kt
: setVideoId is now optional. This prevents skipping entire songs if this specific metadata is missing.
YouTube.kt
:
Updated the playlist and continuation parsing to support both musicPlaylistShelfRenderer and musicShelfRenderer. This ensures the "Liked Music" auto-playlist (which sometimes uses the shorter shelf) is always correctly parsed.
Fixed a compilation error ("Unresolved reference: contents") by ensuring that the contents property is accessed from the correct shelf type within
let
blocks.
2. Safeguarded Synchronization
The synchronization logic in
SyncUtils.kt
was refined to prevent accidental local data loss.

SyncUtils.kt
:
Added checks for empty remote lists in
syncLikedSongs
and
syncLibrarySongs
. If the remote list is empty (which can happen during an API error or network glitch), the local database will not be purged of liked/library songs.
Optimized the Liked songs update logic. It now uses a 1-second tolerance for timestamps to avoid constant database rewrites if the time is slightly off during a sync.
3. Stable Download Status
DownloadUtil.kt
: Refined the download state observer. Completed downloads will no longer be unmarked in the database if they transition to a STATE_STOPPED state (which can happen if the background service is paused or network is lost). The isDownloaded flag is now only reset if a download is explicitly being removed (STATE_REMOVING) or failed (STATE_FAILED).
Verification Results
The changes have been reviewed for logical consistency:

Empty Sync Case: If YouTube returns 0 songs for "Liked", the code now return@onSuccess instead of iterating and removing all local likes.
Shelf Type Variation: The
playlist
method now checks for both known renderer types, covering more edge cases for the auto-generated "Liked Music" list.
Download Persistence: By ignoring STATE_STOPPED, the UI state for "Downloaded" songs remains stable even if the underlying DownloadManager is temporarily inactive.

PLEASE TEST AND REPORT THROUGH TELEGRAM
https://t.me/+Nen-QpiY0tk1OTE9

Don't miss a new vivi-music release

NewReleases is sending notifications on new releases.