#delete_below_minimum not behaving as expected

1 messages Β· Page 1 of 1 (latest)

unique lichen
#

I have my Music.yml set up to create collections with a limit and minimum items, and to delete collections below the minimum. The collections are created, I can see in the log that the "delete_below_minimum" is true, however the collections are then not being deleted. I think I am missing something obvious, but am unable to figure it out.

scenic anchorBOT
#

Welcome @unique lichen!

It looks like you have not yet completed #938455615741775902, this will allow us to help you quicker.

Someone from <@&938443185347244033> will assist when they're available.

Including the meta.log from the beginning is a huge help, type !logs for more information.

#

You can press the "Close Post" button above or type /close at any time to close this post.

unique lichen
wraith crown
#

I think that this is because "smart collections" don't have item counts like standard collections do. In Plex they are implemented as live filtered views, so the item count is variable.

unique lichen
#

Oh that makes sense. So if I use plex_search in place of smart_filter it might solve the issue?

I created an overwhelming number of collections by mistake 🫨

unique lichen
#

I changed smart_filter to plex_search and I am now getting a new error: Collection Error: template attribute is not a dictionary
I've googled but haven't had any luck with figuring this out - any chance you could point me in the right direction?

wraith crown
#

you can't just change "smart_filter" to "plex_search"; the attributes valid for each are different.

unique lichen
#

Oh darn. I'll fiddle with it and see if I can figure out which bit I need to fix up

wraith crown
#

What's the goal here? Just a one-time cleanup of collections?

unique lichen
#

Essentially trying to automate collections of mood or style of music, when there is the minimum amount of tracks/artists/albums met. Easy to do with the upper limit, but the minimum amount is really confusing me.

#

Like in the screenshot but if it also had a "minimum items = 100" for this example

#

For tracks ideally I'd love to make them playlists but that's probably a different pmm help thread

wraith crown
#

This isn't going to delete the "overwhelming number of collections", though.

unique lichen
#

And this wouldn't create a collection because it doesn't meet the minimum

#

Oh yes, the collection clean up is easy enough - I've done it manually. The issue was whithout a minimum item amount, PMM created collections for EVERY mood and that was a lot. I want to limit it a bit so that it is only creating collections when I have the specified amount.

Sorry the inclusion of that confused the issue a bit haha

wraith crown
#

Something like this?

collections:
  Acerbic Tracks:
    builder_level: track
    minimum_items: 100
    delete_below_minimum: 100
    plex_search:
      limit: 100
      sort_by: plays.desc
      all:
        track_mood: acerbic
#

Or as a tempalte:

  track mood collection:
    builder_level: track
    minimum_items: 100
    delete_below_minimum: 100
    plex_search:
      limit: 100
      sort_by: plays.desc
      all:
        track_mood: <<value>>
unique lichen
#

that's perfect, thank you! I'll try it out and see how it runs

unique lichen
#

Hmm I seem to be having the same error appear - any ideas? I'll attach the log and the Music.yml (which maybe I just edited wrong)

#

I have a feeling it is trying to make the collection "Album Moods" etc as opposed to using the template to build the collections (if that made sense), based on what I seeing in the screenshot

#

I think maybe it's not able to call the templates properly in the newest iteration

unique lichen
wraith crown
#

This file is not correctly formatted:

[2023-09-05 13:49:35,816] [config.py:643]             [INFO]     | Playlist File Failed To Load                                                                       |
[2023-09-05 13:49:35,817] [config.py:644]             [ERROR]    | YAML Error: while constructing a mapping                                                           |
                                                                 |         in "C:\Users\laura\Plex-Meta-Manager\config\music_playlists.yml", line 1, column 1         |
                                                                 |       found duplicate key "playlists" with value "ordereddict([('Mood Playlist', ordereddict([('libraries', 'Music'), ('sync_to_users', None), ('summary', 'Songs'), ('plex_search', ordereddict([('type', 'track'), ('any', ordereddict([('all', ordereddict([('track mood', '<<mood>>')]))]))]))])), ('πŸ’œ Australia', ordereddict([('template', ordereddict([('name', 'Hearted Country Playlist'), ('country', ['australia'])]))]))])" (original value: "ordereddict([('Unplayed Songs', ordereddict([('libraries', 'Music'), ('sync_mode', 'sync'), ('summary', 'Stop Downloading new songs until you check these out'), ('plex_search', ordereddict([('type', 'track'), ('all', ordereddict([('track_plays.lte', 0)]))]))])), ('Mood Playlist', ordereddict([('libraries', 'Music'), ('sync_mode', 'sync'), ('plex_search', ordereddict([('type', 'track'), ('all', ordereddict([('track mood', '<<mood>>')]))]))]))])") |
                                                                 |         in "C:\Users\laura\Plex-Meta-Manager\config\music_playlists.yml", line 54, column 1        |
#

https://metamanager.wiki/en/latest/metadata/templates.html

You have this:

collections:
  Track Moods:
    type: track_mood
    title_format: Top 100 <<key_name>> Tracks
    template: track mood collection

Which should be:

collections:
  Track Moods:
    title: Top 100 Acerbic Tracks
    template:
      name: track mood collection
      value: acerbic

OR:

collections:
  Track Moods:
    title_format: Top 100 Acerbic Tracks
    template: {name: track mood collection, value: acerbic}
#

track_mood and key_name are used in dynamic collections, which these aren't anymore

wraith crown
#

Or all together:

templates:
  track mood collection:
    builder_level: track
    title_format: Top 100 <<mood>> Tracks
    minimum_items: 100
    delete_below_minimum: 100
    plex_search:
      limit: 100
      sort_by: plays.desc
      all:
        track_mood: <<mood>>

collections:
  Acerbic Tracks:
    template:
      name: track mood collection
      mood: acerbic
unique lichen
#

I tried the above and I'm getting the error Collection Error: minimum_items attribute not allowed with Collection Level: Track

#

I may be destined to never automate my music collection

wraith crown
winged zephyr
#

Any other progress here?

unique lichen
#

I'm going to close this post for now while I contemplate what I want PMM to do, and how I want it to do it. I've gone back to the original config and it's sort of fine for what I want it to do.

scenic anchorBOT
#

YAML attachment checked and is valid.

Note that valid YAML does not guarantee that it is formatted in a way that Plex Meta Manager expects.