Smart collection filter for ratings / duration

Server Version#: 1.32.8.7639
Player Version#: 4.116.1

Is there a way (through PlexWeb or one of the APIs such as python-plexapi) to create a smart collection contained of videos who dont have a Studio value set yet. I wasn’t originally tracking that, but started doing so around the time I moved my PMS from my Windows desktop onto a TrueNAS Scale rig. I’m sure a good percentage of the videos won’t have it, and a Smart Collection would help cleaning them up over a longer period of time as it’d be easy to do it in multiple sessions,

I could do this with a python-plexapi script, but takes a long time (like 6-8m) to iterate over every video in a section to collect the dat and id then have to actually clean it up. It feels like there has to be a better and more efficient way to do so.

Similarly, can I create a smart collection that filters on the length/duration of the video? I have a bunch of videos under 1 min long, and I want to review them to confirm if they’re basically just teasers for the whole video release. Having a smart collection identifying all videos under 90 seconds would be really handy to prine those as appropriate.

There’s currently no “is empty” filter for Studio. So you can only work with an excessive filter like

Match all of the following
  Studio > does not contain > a
  Studio > does not contain > b
  Studio > does not contain > c
  Studio > does not contain > e
  ...
  Studio > does not contain > y
  Studio > does not contain > z
  Studio > does not contain > 0
  Studio > does not contain > 1
  ...
  Studio > does not contain > 9

That’s rather ugly but it does the job, filtering for any movie that got no studio assigned to it.

Filtering by duration is not currently available via the UI of Plex Web (neither as a regular or advanced filter). However, the filter option exists for music libraries when using Plexamp… and can therefore also be used doing a little URL magic in Plex Web.

You should be able to add the following pattern to the URL query string while displaying your music library by tracks:

  • %26track.duration%3E%3E%3D<duration in milliseconds> (e.g. %26track.duration%3E%3E%3D600000 will filter for songs > 10 minutes).
  • %26track.duration%3C%3C%3D<duration in milliseconds> (e.g. %26track.duration%3C%3C%3D30000 will filter for songs < 30 seconds).

That being said… this option is only available for music libraries – not movie or tv-show libraries!

I cannot comment on if/how the options can be used via an API.

Studio

# studio is blank (using PlexAPI filters)
movies.search(studio__exact="")

Ratings

# rating greater than 5.0
movies.search(filters={"audienceRating>>": 5.0})

Duration

# duration less than 1 minute 30 seconds
movies.search(filters={"duration<<": 90000})

Reference: Library plexapi.library — Python PlexAPI documentation

2 Likes

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.