POE::C...lection(3pm)

πŸ“¦
version 2.001 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, gather round: POE::Component::Client::MPD::Collection β€” it's the module that handles all the collection commands for you. yes, the whole collection. the vibes are immaculate. ✨


🌸 VERSION 🌸

this is version 2.001. iconic behavior, no notes. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, POE::Component::Client::MPD::Collection is the one in charge of handling general purpose commands. they live in their own dedicated module because that makes code maintenance so much easier β€” separating your faves into their own little group chat, yk? πŸŽ€

to actually make those commands happen, you send the corresponding event to the POE::Component::Client::MPD session you created: that session is the main character and it's responsible for dispatching the event where it needs to go. and this part is serious, bestie: under no circumstance should you call subs or methods from this module directly. like, do not. it's giving chaos. 😭

go read POE::Component::Client::MPD's pod to learn how to deal with answers from those commands. that's your homework. 🫢

coming up next is the full list of collection-related events accepted by POCOCM. let's get into it. 🌈


🎡 RETRIEVING SONGS & DIRECTORIES 🎡

coll.all_items( [$path] )

returns all Audio::MPD::Common::Items (both songs and directories, the whole squad) currently known by mpd. πŸ’–

if $path is supplied (relative to mpd root, bestie β€” relative!), it restricts the retrieval to just the songs and dirs chilling in that directory.

coll.all_items_simple( [$path] )

returns all Audio::MPD::Common::Items (both songs and directories) currently known by mpd. same energy as above. ✨

if $path is supplied (relative to mpd root), it restricts the retrieval to songs and dirs in this directory.

/!\ ⚠️ warning, bestie, pay attention: the Audio::MPD::Common::Item::Song objects will only have their attribute file filled. any other attribute will be empty. so do not use this sub for anything other than a quick scan! it's giving bare minimum and we respect that but we do not trust it. πŸ’€

coll.items_in_dir( [$path] )

returns the items in the given $path. if no $path supplied, it does the thing on mpd's root directory instead, nbd. 🌸

heads up tho: this sub does not work recusrively on all directories. (recusrively β€” yes that's the original spelling, i'm not fixing it, i'm not a monster, i'm just the messenger 🧚)


πŸ‘‘ RETRIEVING THE WHOLE COLLECTION πŸ‘‘

coll.all_albums( )

returns the list of all albums (strings) currently known by mpd. the whole discography, served fresh. πŸ“

coll.all_artists( )

returns the list of all artists (strings) currently known by mpd. everyone. the entire lineup. πŸ’œ

coll.all_titles( )

returns the list of all titles (strings) currently known by mpd. all the names, all of them. ⭐

coll.all_files( )

returns a mpd_result event with the list of all filenames (strings) currently known by mpd. note the whole event situation β€” it's not just a return, it's a whole moment. πŸ”₯


πŸ’… PICKING A SONG πŸ’…

coll.song( $path )

returns the Audio::MPD::Common::Item::Song which corresponds to $path. one song. the one. main character energy. πŸ‘‘

coll.songs_with_filename_partial( $string )

returns the Audio::MPD::Common::Item::Songs that contain $string somewhere in their path. partial matching, so like, it's giving "close enough, we'll find it". πŸ¦‹


🌈 SONGS, ALBUMS & ARTISTS RELATIONS 🌈

coll.albums_by_artist( $artist )

returns all albums (strings) performed by $artist, or where $artist participated. so even a feature counts. we love a collaborative queen. ✨

coll.songs_by_artist( $artist )

returns all Audio::MPD::Common::Item::Songs performed by $artist. πŸŽ€

coll.songs_by_artist_partial( $artist )

returns all Audio::MPD::Common::Item::Songs performed by $artist. (same as the one up there, just with _partial energy β€” i report, you decide πŸ’–)

coll.songs_from_album( $album )

returns all Audio::MPD::Common::Item::Songs appearing in $album. the full tracklist, periodt. πŸ’œ

coll.songs_from_album_partial( $string )

returns all Audio::MPD::Common::Item::Songs appearing in an album containing $string. fuzzy match but make it cute. 🌸

coll.songs_with_title( $title )

returns all Audio::MPD::Common::Item::Songs which title is exactly $title. exactly. no approximations. we're being precise today. ⭐

coll.songs_with_title_partial( $string )

returns all Audio::MPD::Common::Item::Songs where $string is part of the title. now this one is the chill fuzzy one. 🧚


🫢 AUTHOR 🫢

Jerome Quelin β€” the legend, the moment, the whole reason. πŸ‘‘


this software is copyright (c) 2007 by Jerome Quelin. πŸ“

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, honestly. πŸ’…


okay that's the whole page bestie, we ate and left no crumbs ✨ β€” this was POE::C...lection(3pm) from the User Contributed Perl Documentation, built from perl v5.40.1, dated 2025-04-11. go forth and query your mpd collection, you're gonna be so good at it, i just know it πŸ¦‹πŸ’–πŸŒˆ

πŸ“¦ where this page comes from