# Limit # Items in Playlist

**URL:** <https://discourse.beets.io/t/limit-items-in-playlist/1147>\
**Category:** Help\
**Created:** [March 9, 2020, 10:23am UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147 "2020-03-09T10:23:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TottiT](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TottiT](https://discourse.beets.io/u/TottiT)\
**Post date:** [March 9, 2020, 10:23am UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147/1 "2020-03-09T10:23:57Z")

</div>

Hey Community!

I’m setting up a small self-hosted music service thingy, where beets is running in the background carrying out tasks for the Mopidy/MPD based playback service.

I wanted to make a little automated “Daily Playlists” service of sorts, where a portion of my collection would be added into automated playlists based on some smart-ish queries I’d come up with. The playlists would be created via the Smart Playlists plugin and queries developed as time passes.

But to start off, I haven’t been able to found a way to limit the number of items in the generated playlists, and opening up a random playlist with thousands of items seems to easily crash the music service.

Is there a clear way to achieve a limit on the playlists items count? Or maybe a good work-around?

Thank you for any input!

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [March 9, 2020, 11:52am UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147/2 "2020-03-09T11:52:57Z")

</div>

Hi! Unfortunately there’s not such a feature in the plugin. I also don’t have any _great_ ideas for a workaround… maybe a post-processing script could do something like `head -n100` on the m3u file to truncate it?

FWIW, the “right way” to do this would be for beets to support limiting in queries, which hopefully we’ll do someday…

> <https://github.com/beetbox/beets/issues/750>
>
> The creation of this issue has been discussed in #736.
> To implement pagination properly in the HTTP API, we need to add...

---

<div class="post-metadata">

**Author:** ![TottiT](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TottiT](https://discourse.beets.io/u/TottiT)\
**Post date:** [March 10, 2020, 11:02am UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147/3 "2020-03-10T11:02:27Z")

</div>

Hey @adrian!

Thanks for getting back on the topic!

re: post-processing - Yes, this is what I was also thinking as a backup option / work-around.

But good to know there’s been a related initiative that touches the issues! And seems someone even mentioned the possibility of better Smart Playlist exactly as I had planned!  
But I guess since it’s been opened since 2014 there’s no reason to hold my breath ^\_\_^.

Anyways, thanks for now! I’ll see what I come up with!

---

<div class="post-metadata">

**Author:** ![jakabadambalazs](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jakabadambalazs/32/360_2.png) [@jakabadambalazs](https://discourse.beets.io/u/jakabadambalazs)\
**Post date:** [March 19, 2020, 2:14pm UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147/4 "2020-03-19T14:14:07Z")

</div>

+1 for @TottiT for putting this into words. I have also on many occasions found myself needing to limit the results of a query. I think the way to go is a special query element like `limit:100` or similar so that it can work both for the core application and for all plugins.

@TottiT - have you checked if there is any open suggestion for this already?

---

<div class="post-metadata">

**Author:** ![TottiT](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TottiT](https://discourse.beets.io/u/TottiT)\
**Post date:** [March 19, 2020, 8:46pm UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147/5 "2020-03-19T20:46:16Z")

</div>

Hey @jakabadambalazs!  
Thanks for chipping in! Like @adrian mentioned in his post, there’s an issue open on a more general topic regarding “pagination support” that would, as far as I’m concerned, add the option to limit queries as well. Bad news - the feature has been “on demand” since 2014 so hard to say when, if ever, it will be implemented :P. But the more people join with similar needs, the more chances we have!

---

<div class="post-metadata">

**Author:** ![jakabadambalazs](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jakabadambalazs/32/360_2.png) [@jakabadambalazs](https://discourse.beets.io/u/jakabadambalazs)\
**Post date:** [March 19, 2020, 9:05pm UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147/6 "2020-03-19T21:05:12Z")

</div>

> [@TottiT](#):
>
> Bad news - the feature has been “on demand” since 2014

🤣 Never lose faith! Who knows? This might be the good year.  
I did not pick up on the pagination part. Do you mean like displaying a long list of items split up into screens that don’t scroll away but wait for user input? Something like `more` on a linux terminal?

---

<div class="post-metadata">

**Author:** ![TottiT](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@TottiT](https://discourse.beets.io/u/TottiT)\
**Post date:** [March 28, 2020, 11:11am UTC](https://discourse.beets.io/t/limit-items-in-playlist/1147/7 "2020-03-28T11:11:45Z")

</div>

> I did not pick up on the pagination part. Do you mean like displaying a long list of items split up into screens that don’t scroll away but wait for user input? Something like `more` on a linux terminal?

I also don’t know exactly what pagination means, but after skimming through the thread a little, I have the FEELING that it somehow means splitting the query results into some sort of indexed lists that can be further processed during queries to allow for, say, limiting the results, only giving out last items in the queries, and so on. But again, this is only my feeling and someone with more knowledge might be able to shed some more light into this!
