Skip to content

Conversation

@Pittvandewitt
Copy link
Contributor

This PR does several things to improve the code quality:

  • Perform Database and Network requests in the ViewModel to make it survive configuration changes
  • IO work is ensured to be performed in the IO dispatcher by defining it at function level
  • Playlists are only fetched once
  • AddToPlaylistDialog UI state now survives process death

…efactor/add-to-playlist

# Conflicts:
#	app/src/main/java/com/github/libretube/ui/dialogs/AddToPlaylistDialog.kt
#	app/src/main/java/com/github/libretube/ui/models/PlaylistViewModel.kt
}
}

fun onPostiveButtonClick(playlistIndex: Int) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this should probably be called something like addToPlaylistAtIndex instead, onPositiveButtonClick is not that descriptive.

@Bnyro Bnyro force-pushed the refactor/add-to-playlist branch from 8dba201 to 6cfec07 Compare February 15, 2025 13:53
Copy link
Member

@Bnyro Bnyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Bnyro Bnyro changed the title Refactor add to playlist dialog refactor: simplify add to playlist dialog Feb 15, 2025
@Bnyro Bnyro merged commit 2ae689c into libre-tube:master Feb 15, 2025
1 of 2 checks passed
@Pittvandewitt Pittvandewitt deleted the refactor/add-to-playlist branch February 15, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants