Skip to content

Commit

Permalink
added check on empty playlist list
Browse files Browse the repository at this point in the history
  • Loading branch information
icefields committed Jun 16, 2024
1 parent 35c810c commit dcde047
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,14 @@ class PlaylistsRepositoryImpl @Inject constructor(
if (Constants.config.playlistsServerAllFetch) {
val playlistNetwork =
getPlaylistsNetwork(authToken(), user, offset, query, ALWAYS_FETCH_ALL_PLAYLISTS)
val playlistNetworkEntities = playlistNetwork.map {
it.toPlaylistEntity(
username = user,
serverUrl = cred.serverUrl
)
}
val playlistNetworkEntities =
playlistNetwork.map {
it.toPlaylistEntity(username = user, serverUrl = cred.serverUrl)
}

if (query.isNullOrBlank() &&
offset == 0 &&
playlistNetwork.isNotEmpty() && // TODO: check for network errors instead of empty list
(!AmpacheModel.listsHaveSameElements(playlistNetwork, dbList.map { it.toPlaylist() }))
) {
L("aaaa", "lists don't have same elements")
Expand Down

0 comments on commit dcde047

Please sign in to comment.