Skip to content

Conversation

@wutschel
Copy link
Collaborator

@wutschel wutschel commented Jan 25, 2026

Description

This PR was motivated by reviewing the implementation of editing UITableView. The review showed four main findings:

Unneeded calls of reloadData and selectRowAtIndexPath

Calls of reloadData and selectRowAtIndexPath are not required inside commitEditingStyle and moveRowAtIndexPath:ToIndexPath. They got removed.

Handling removal last playlist

It was also found that after deleting the last playlist item the info label "No items found." was not shown, and that the edit button was still shown active and selected. This is now corrected.

Improper error handling in moveRowAtIndexPath:ToIndexPath

In case an error was reported for Playlist.Remove (e.g. when attempting to move the current playing item) the playlist was not properly reloaded. This resulted in inconsistency between the real playlist in Kodi and the one displayed by the remote app. Also, the wrong item was shown as playing. The correct solution is to call createPlaylistAnimated which will reload the playlist from Kodi and update the UITableView. In case of a (theoretical) issue with Playlist.Insert the same error handling is applied.

Repeated action to remove playlist on server disconnect

In case of server being disconnected a set of actions (fade out playlistTableView, delete playlistData, reloadData, send notification for iPad that playlist is empty) was called repeated, even though playlistData is already empty. An early return is added to serverIsDisconnected to avoid this.

Important: Needs minor rebasing once #1441 and #1442 were merged.

Summary for release notes

Bugfix: Fixes wrong playlist state when facing an error during moving an item in the playlist
Improvement: Shows "No items found." in the playlist once all items were removed by user

The playlist is already empty, so there is no need to animate / delete / reload / notify anything again. It was already dine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant