INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Youtube browsing style in MC?  (Read 1260 times)

Raimy

  • Recent member
  • *
  • Posts: 31
Youtube browsing style in MC?
« on: January 15, 2013, 11:18:25 am »

So for quite a while iv been looking for a way to emulate in MC the way i browse in Youtube. i.e

1. Enter a search term = 80's Soul
2. Click on a file i like
3. then browse the thumbnails at the right for something else i like. (Crucially these are related to the file last selected)

Whatever mechanics they use to deliver these related thumbnails it really makes for a great browsing experience for me.

The way i see it working in MC is

1. Click on a Smartlist of [Genre]="Soul" Vids
2. Play a file i like
3. Then the Smartlist updates (manually or auto) to show 20 random vids from the currently playing vids [Genre] field. (hopefully if i can nail 1 field variance i can add 4 or 5 fields i.e mix~ [Genre],[Artist],[Decade] e.t.c so the browsing experience throws in some surprises)

I thought it was impossible because i couldn't see a way for a smartlist to know a value in any field from a currently playing vid,, until i saw the tag() function. Warnings about it's limited success and performance hit aside i am very close to getting my Youtube browsing experience in MC using:

if(IsPlaying() ,tag(artist),Not Playing) in a custom field.

The performance hit was immense in the expression column although when i transferred it to a custom field the 8 second hang reduced to something unnoticeable

So now i have a field which displays the current playing tracks Genre value, i only need to tell the Smartlist to deliver files which have "Soul" as a value in [Genre] or to put it more correctly [Genre]=[Playing Now Tag] "playing Now Tag being the field name which holds the essential value.

Of course i can write [Genre]="Soul" or  [Genre]=[Soul] or [Genre]=[Soul" but for the whole thing to work it needs to be based on the "Playing Now Tag" field.

So how would i tell a smartlist to deliver files which have a value in field A that match field B? or is their another way of achieving my aim? Thx
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Youtube browsing style in MC?
« Reply #1 on: January 15, 2013, 12:23:57 pm »

You can use the entire expression language and form it as a search query using the syntax [=expr]=1:

   [=isequal([Field A], [Field B])]=1

Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Youtube browsing style in MC?
« Reply #2 on: January 15, 2013, 12:34:32 pm »


I thought it was impossible because i couldn't see a way for a smartlist to know a value in any field from a currently playing vid,, until i saw the tag() function. Warnings about it's limited success and performance hit aside i am very close to getting my Youtube browsing experience in MC using:

if(IsPlaying() ,tag(artist),Not Playing) in a custom field.


Given the above comment, you should now see it is possible to do:

  [=ifelse(IsPlaying(), save(g_somevar, [artist], 1)]=1

to set a global variable based on the file playing now, and then in a subsequent rule:

  [=ifelse(!isempty(load(g_somevar), do something else...]=1

The key to this form of query is that a) the query is formed as a expression that outputs a value so that MC can test the value against the right side of the comparison, and b) each query above when using a Set and (later) Test global variable is that the queries need to run in order and independently (the first one is run against all files, returning a list of files for which the query results in True, and the next one is run against the resulting set, further narrowing the result).
Logged
The opinions I express represent my own folly.

Raimy

  • Recent member
  • *
  • Posts: 31
Re: Youtube browsing style in MC?
« Reply #3 on: January 16, 2013, 01:40:00 pm »

Yep i can see it now. Not having to assign some kind of a reference to a file in save(value,var_name) made me wonder if variables in Mc were worth getting to know. Wasn't sure how save() would know which file the value referred to but of course i'd forgotten how MC iterates through each file. Duh!

I'll have a go at this tonight and see how i get on. Thanks

Quick question though, it's not clear to me if these two lines are destined for the same smartlist?

[=ifelse(IsPlaying(), save(g_somevar, [artist], 1)]=1

[=ifelse(!isempty(load(g_somevar), do something else...]=1
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Youtube browsing style in MC?
« Reply #4 on: January 16, 2013, 01:58:47 pm »

Yes, they are destined for the same smartlist.  The first sets the value on the first pass of file iteration, the second on the second pass interrogates the value just set in pass 1.

See also the links posted at the bottom of the Save() command:

    http://wiki.jriver.com/index.php/Media_Center_expression_language#Save.28....29:_Saves_a_value_to_a_global_variable
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up