Skip to content

Hide folder containers without songs from playlist view#291

Merged
theovilardo merged 2 commits intomasterfrom
codex/add-playlist-view-toggle-to-folders-tab-ehpl0z
Oct 23, 2025
Merged

Hide folder containers without songs from playlist view#291
theovilardo merged 2 commits intomasterfrom
codex/add-playlist-view-toggle-to-folders-tab-ehpl0z

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

Summary

  • update the folders playlist-view flattening logic to skip directories that do not contain any songs themselves

Testing

  • ./gradlew :app:compileDebugKotlin (fails: SDK location not found in container)

https://chatgpt.com/codex/tasks/task_e_68fa3921f150832f8971dc4cc00c765a

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1041 to 1045
private fun flattenFolders(folders: List<MusicFolder>): List<MusicFolder> {
return folders.flatMap { folder ->
listOf(folder) + flattenFolders(folder.subFolders)
val current = if (folder.songs.isNotEmpty()) listOf(folder) else emptyList()
current + flattenFolders(folder.subFolders)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not hide folders that only contain songs in subdirectories

The new playlist view builds its list of folder playlists by flattening the folder tree and only keeping entries where folder.songs.isNotEmpty(). This means a parent directory that stores its music exclusively in nested subfolders (a very common structure like Artist/Album/Track.mp3) will never be shown, even though FolderPlaylistItem and PlaylistViewModel.collectAllSongs() can aggregate songs recursively. Users therefore cannot create a playlist for those folders at all. Consider filtering on folder.totalSongCount > 0 (or a similar recursive check) so folders that contain music anywhere in their subtree remain selectable while still hiding truly empty containers.

Useful? React with 👍 / 👎.

@theovilardo theovilardo merged commit 2981125 into master Oct 23, 2025
@lostf1sh lostf1sh deleted the codex/add-playlist-view-toggle-to-folders-tab-ehpl0z branch January 16, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant