More > JRiver Media Center 21 for Windows
MrC's Tip of the Week 2013.36: Links
MrC:
This week's tip shows how to get a little more leverage from Media Center's Links feature. Links are those click-able words to the right of your view tabs:
Links are also available by right-clicking one or more media files and selecting Links.
Links operate on the selected media, and when clicked, open an internal or external browser to the site specified in the Link's definition. The link is defined using the Media Center expression language, which of course has access to a media file's metadata, and this metadata can help guide the query for more advanced linking.
Let's take a look at a simple link - the stock AMG link:
The Search URL defines the rule used to construct a URL that should open a browser page at the correct location for the selected media. The Link for AMG uses the rule:
http:////www.allmusic.com//search//artist//Hexify([Search])
This is a basic AllMusic search URL, with a couple of expression language modifications:
- forward slashes must be escaped by doubling them (because they are special in expressions)
- part of the URL's path is constructed dynamically based on the expression Hexify([Search])
[Search] is a special, internal Media Center field whose value is generated dynamically for Links. It is filled with the appropriate field value needed for a particular Media Type query (e.g. Artist for Audio, Name for Video). And Hexify() ensures that stuff is safe to embed as part of a URL.
Alternatively, you might want to search using a different criteria, such as by Album name:
http:////www.allmusic.com//search//albums//Hexify([album])
For many Links, the defaults work acceptably. But there are some cases where simple artist or album searching will never produce reliable results (classical music, for example). I decided to handle such cases by helping Media Center a bit. I created a custom field, called AMG URL, and whenever necessary, I simply fill it with the correct AMG album URL:
By modifying the Search URL for AMG, this URL can now be used instead of the stock AMG search rule, but the stock rule is used as a fallback:
if(!isempty([AMG URL]), [AMG URL], http:////www.allmusic.com//search//artist//Hexify([Search]))
For those of you using MC19, the new FirstNotEmpty() function makes the expression trivially simple:
FirstNotEmpty([AMG URL], http:////www.allmusic.com//search//artist//Hexify([Search]))
Incidentally, the AMG URL is used for other purposes.
The Search URL expressions can be much richer, and use other fields such as Genre or Media Type, to dynamically construct a URL for your personal needs. You might, for example, want one multi-tasking Link which for audio goes to Allmusic for all but classical music, and goes to the IMSLP whenever the genre is classical and there is a value in the composer field, or for video goes to IMDB for movies and TheTVdb for TV shows. Or limit your Google Images searches to only cover art that is 500x500. Remember to configure the Edit Search... area in the Link:
The link is shown only when there are files in the view that match the search criteria defined here. This allows a link to be hidden when it isn't relevant.
Use your imagination and see what you can come up with, and share your results here.
Have a good week!
[ Go read last week's Tip ]
6233638:
Thanks for the tips. I should probably check over these again, but here are the custom searches I've been using for music; Discogs, Wikipedia, and for finding Album Art:
--- Code: (Discogs) ---<Link version="1.2">
<Item Name="Name">Discogs</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://www.discogs.com/search?</Item>
<Item Name="Search URL">http:////www.discogs.com//search?if(!isempty([Catalog #]),&catno=Hexify([Catalog #])&artist=Hexify([Album Artist (auto)]),if(isequal([Genre],soundtrack,8),q=Hexify([Album] Soundtrack),if(isequal([Album Artist (auto)],Artists,7),,&artist=Hexify([Album Artist (auto)]))&title=Hexify(removecharacters([Album],/)/(‒ʼ!,0))))</Item>
<Item Name="Filter">[Media Type]=[Audio]</Item>
</Link>
--- End code ---
This is a search which uses my custom [Catalog #] tag. If an album has this, it gets used in the lookup, and should take you directly to the correct version of that album. Otherwise, it should do a decent job of taking you to the right search results to find which version of an album it is that you have. (if you don't have the disc handy, or if it's still ambiguous)
--- Code: (Wikipedia) ---<Link version="1.2">
<Item Name="Name">Wikipedia</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">https://en.wikipedia.org/w/index.php?search=</Item>
<Item Name="Search URL">https:////en.wikipedia.org//w//index.php?search=Hexify(removecharacters([Album],/)/(‒ʼ,0)if(isequal([Genre],soundtrack,8),/ /(soundtrack/),))</Item>
<Item Name="Filter">[Media Type]=[Audio]</Item>
</Link>
--- End code ---
I found that the default Wikipedia search didn't always give me the best results for soundtracks, so this search did a better job of working on everything.
--- Code: (Album Art) ---<Link version="1.2">
<Item Name="Name">Cover Art</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">https://www.google.com</Item>
<Item Name="Search URL">https:////www.google.com//search?as_st=y&tbm=isch&as_q=Hexify([Album Artist (auto)] [Album])&safe=images&tbs=isz:lt,islt:2mp,iar:s,imgo:1&biw=1920&bih=984</Item>
<Item Name="Filter">[Media Type]=[Audio]</Item>
</Link>
--- End code ---
I like to grab the highest quality artwork I can, rather than the compressed artwork that the built in tool findsthis usually works well.
I don't suppose you know if it's possible to have one "link" open multiple pages in your browser? The album art one looks for the largest images first, but I often have to reduce the size option on the page to find suitable art. (at the larger sizes, sometimes it's pulling in photographs) It would be nice if I could click one link and have it open two or three sizes at once.
And for films:
--- Code: (IMDB) ---http:////www.imdb.com//find?s=tt&q=Hexify([Search])
--- End code ---
--- Code: (Rotten Tomatoes) ---http:////www.rottentomatoes.com//search//full_search.php?search=Hexify([Search])
--- End code ---
--- Code: (Poster Art) ---<Link version="1.2">
<Item Name="Name">Poster Art</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">https://www.google.com</Item>
<Item Name="Search URL">https:////www.google.com//search?as_st=y&tbm=isch&as_q=Hexify([Name])&safe=images&tbs=isz:lt,islt:2mp,iar:t,imgo:1&biw=1920&bih=984</Item>
<Item Name="Filter">[Media Sub Type]=[Movie]</Item>
</Link>
--- End code ---
Apologies if any of those were the defaults - I think I added or changed them all, but it was months ago that I last looked at this.
Edit: I suspect the IMDB and RT ones might be. If anyone can confirm, I will remove them.
MrC:
Nice contributions.
As far as opening multiple links, I don't know how that might be done with the Links manager, since it dispatches internally, and only passes a single URL string. I imagine you'd need a proxy to demux this mux'ed URL and open the individual components.
However, you can do this with Send To > Send (to external) by added a new External Program definition, such as:
Name: Open in Firefox
Program Path: C:\Program Files (x86)\Mozilla Firefox\firefox.exe
Parameters: "www.google.com" "www.jriver.com" "www.imdb.com"
Simple expressions there seem to work, but I haven't thoroughly tested out support in this area.
marko:
One of the things that always seems to get overlooked when talking about links is the ease of sharing via the 'copy to clipboard' button. You hit that. then come here and paste inside code tags...
Search music video on uTube...
--- Code: ---<Link version="1.2">
<Item Name="Name">Music Video</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://www.youtube.com</Item>
<Item Name="Search URL">http:////www.youtube.com//results?search_type=&search_query=Hexify([Artist]+[Name])</Item>
<Item Name="Filter">[Media Type]=[Audio]</Item>
</Link>
--- End code ---
Then everyone else copies the stuff inside the code post, goes to their link managers, and hits the 'paste' button. Job done.
Often, when people are looking to learn a little, or perhaps looking for some inspiration, there is frustration at the lack of 'smartlist sharing threads' and such like. They've been tried before and there are many good reasons why they don't really work. Link sharing on the other hand, has, imvho, a lot more potential.
Here's some more to try out...
Artist lookup on AMG...
--- Code: ---<Link version="1.2">
<Item Name="Name">Artist on AMG</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://www.allmusic.com</Item>
<Item Name="Search URL">http:////www.allmusic.com//search//artist//Replace([artist],/ ,+)</Item>
<Item Name="Filter">[media type]=[audio]</Item>
</Link>
--- End code ---
Album lookup on AMG...
--- Code: ---<Link version="1.2">
<Item Name="Name">Album on AMG</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://www.allmusic.com</Item>
<Item Name="Search URL">http:////www.allmusic.com//search//album//Replace([album],/ ,+)</Item>
<Item Name="Filter">[media type]=[audio]</Item>
</Link>
--- End code ---
Track lookup on AMG...
--- Code: ---<Link version="1.2">
<Item Name="Name">Track on AMG</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://www.allmusic.com</Item>
<Item Name="Search URL">http:////www.allmusic.com//search//song//Replace([name],/ ,+)</Item>
<Item Name="Filter">[media type]=[audio]</Item>
</Link>
--- End code ---
Lyrics lookup on Absolute Lyrics...
--- Code: ---<Link version="1.2">
<Item Name="Name">Lyrics</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://www.absolutelyrics.com</Item>
<Item Name="Search URL">http:////www.absolutelyrics.com//lyrics//view//replace([artist],/ ,_)//replace([name],/ ,_)</Item>
<Item Name="Filter">[Media Type]=[Audio],[Video]</Item>
</Link>
--- End code ---
-marko
InflatableMouse:
Cool! Thanks guys.
Here's another one.
--- Code: ---<Link version="1,2">
<Item Name="Name">DR Database</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://dr.loudness-war.info/index.php?</Item>
<Item Name="Search URL">http:////dr.loudness-war.info//index.php?search_artist=[artist]&search_album=[album]</Item>
<Item Name="Filter"/>
</Link>
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version