Creating Advanced Media Views Using the Expand Search Modifier

From wiki.jriver.com
Jump to navigation Jump to search
This article is a incomplete. It is missing detail about critical functions, or contains a number of red links. You can help the JRiver Wiki by expanding it.

Media Center 20 includes a new Search Language modifier, ~expand, which can be used to create some clever Media Views that filter your media in ways that were previously difficult or impossible to accomplish. This tutorial will show how to use this new feature to craft a few Media Views that are useful, and which demonstrate how to use it to expand what you can do with Media Center.

Please Note: The ~expand modifier was added in MC 20.0.106 and you must have this version or later to use this tutorial.

Background

Media Center's Library and Search Language operates on a per-file basis. When you issue a search, it evaluates every file in your Library individually, and deciding whether to include or exclude the file from the search results. You cannot evaluate, however, a Library Fields as a unit (so you can't check an entire [Series], [Album], or [Genre] and do something based on how many files it contains, or similar tasks). This makes it difficult to do things like: include all files from a [Series] if any one of those files meets X criteria.

There are ways to work around these issues using complex logic including Global Variables, but these can be fragile and complex to implement. The Expand modifier can be used to work around many of these limits without resorting to Global Variables and their associated pitfalls.

Basics

Examples

Finding duplicates (via [Name]) of files just imported (date imported)? (This example is based on JRiver Media Center 24.)

First, locate smartlist "Audio -- Recently Imported -- Imported this week".
Right-click on it, and select "Edit Smartlist..."
Click on "Import / Export" button, and copy the Smarlist rules data to your clipboard: [Media Type]=[audio] [Date Imported]=<7d ~sort=[Date Imported]-d
Continue clicking cancel until you exit the Smartlist

Now, create a new Smartlist (I'll call this "AAA - Import Dupes").
Click on "Import / Export" button.
Replace the Smartlist rules data with what was obtained above: [Media Type]=[audio] [Date Imported]=<7d ~sort=[Date Imported]-d
Modify the Smartlist rule to the following (so that it sorts by name, not date imported): [Media Type]=[audio] [Date Imported]=<7d ~sort=[Name]
Click on OK until you view the results.
I suggest adding a column for "Date Imported" in the view (right-click on the column headers in the view to update view)

Now, for the "magic" of "~expand"!
Update the Smartlist, and (via "Import / Export"), change the rules data to this: [Media Type]=[audio] [Date Imported]=<7d ~expand=Name ~sort=[Name]
Click on OK until you view the results.
You should now see all tracks in your library with names matching your recently imported tracks. Awesome, right!

From: https://yabb.jriver.com/interact/index.php/topic,117998.msg816338.html#msg816338