Repository navigation
Add commands for external playlist management - #1297
Conversation
|
All done |
| if (list_len(&pl_head) == 1) { | ||
| last = pl; | ||
| break; | ||
| } |
There was a problem hiding this comment.
Can this special case for the last item be removed now?
There was a problem hiding this comment.
I've tested the code without that block and it was working but I'm not entirely sure how the list functions with additions inside the loop so I didn't want to risk an infinite loop. I could remove it if it's fine. I removed the "last" variable with 68d9b0b for now.
| struct playlist *temp; | ||
| list_for_each_entry_safe(pl, temp, &pl_head, node) { | ||
| if (list_len(&pl_head) == 1) | ||
| break; |
There was a problem hiding this comment.
Still not getting this, won't the for_each loop just end naturally when all the items are gone?
There was a problem hiding this comment.
Wait I get it, because we add back the default 😁
There was a problem hiding this comment.
Yeah it could still be fine but I couldn't really wrap my head around the implementation too well to confirm it.
68d9b0b to
edb2092
Compare
|
Thanks! |
|
Thank you both as well for your time |
This PR implements the commands "pl-delete" and "pl-delete-all" that remove playlists for use with cmus-remote.
Other playlist management functionality needs further design discussion but these commands should be sufficient if all playlists are managed externally (which is my use case).
Partially addresses #1066