INTERACT FORUM

Please login or register.

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

Author Topic: How do I add extra info to the Standard View?  (Read 1065 times)

corbendallas

  • Recent member
  • *
  • Posts: 23
How do I add extra info to the Standard View?
« on: February 23, 2024, 04:30:20 am »

I have been able to add extra info to the Standard View and I'm super happy about it (see attachment for example, it's the part marked yellow that I'm interested in).

Problem is, I can't figure out how I did it  :P  I know I have some custom fields in the database with expressions, but where did I configure them to show up? I know I followed some really nice tips in the forum somewhere, I just can't seem to find the thread again. Can someone help me jog my memory please?

Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #1 on: February 23, 2024, 05:26:12 am »

Here you go Mr. Dallas.
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #2 on: February 23, 2024, 05:31:50 am »

Here you go Mr. Dallas.

YES!! YES!! YES!! There it is! Thank you SOO much. I would never have found it.

I'm glad to see you have one of the coolest movies ever made in your collection  ;D and I wish you a great weekend! Again, big thanks!
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #3 on: February 23, 2024, 05:37:38 am »

Indeed, two of my favorite movies of all time right there :)
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #4 on: February 23, 2024, 05:48:04 am »

Indeed, two of my favorite movies of all time right there :)

Indeed! For me it's time to revisit Leon again. It was too long ago now.

Since I have you here and you have done the same thing, I'll ask another question. Have you done the same thing for TV-series? I just started to look into it and are testing with "Year" and "Resolution", and it's all nice and fine until you have a series with more than one season. Then I get avg on year and I have a few where Resolution becomes [varies].
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #5 on: February 23, 2024, 06:08:22 am »

I don't think that's possible in any direct way. One solution is to create a field [SeriesYears] and populate it with the year range like "2003-2008" for all files, then just display that field in the Thumbnail. It's not ideal and you'd need to update it each time you add a new season, but other than that I don't think MC can do it.

Same for Resolution. You may as well create a field called [SeriesThumbnail] with both pieces of info and just display that :/

It's possible to write an expression to update that field on all files in bulk.
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #6 on: February 23, 2024, 06:18:53 am »

I don't think that's possible in any direct way. One solution is to create a field [SeriesYears] and populate it with the year range like "2003-2008" for all files, then just display that field in the Thumbnail. It's not ideal and you'd need to update it each time you add a new season, but other than that I don't think MC can do it.

Same for Resolution. You may as well create a field called [SeriesThumbnail] with both pieces of info and just display that :/

I agree, knowing me, having to change it manually, the value would be longer time wrong than right  ;D Resolution I can live without, it's not that important. Year would be nice though. Could I create a field where it lists the lowest value of [year]? Lets say season 1 = Year: 2019, Season 2 = year: 2020, Season 3 = Year: 2021. I would be happy if I could get it to list 2019.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #7 on: February 23, 2024, 06:39:54 am »

I don't think that's possible in any direct way.

This guy doesn't know what he's talking about. Just try this on the Thumbnail expression (set "Thumbnail Text Lines" to 2):
Code: [Select]
if(load(_year_[Series]),,save(fieldquery(Series,[Series], Date /(Year/), 1, 0),_year_[Series]))/
if(load(_res_[Series]),,save(fieldquery(Series,[Series], Resolution, 1, 0),_res_[Series]))/
<b>[Series]<//b>
replace(listClean(listmath(load(_year_[Series]), 0);listmath(load(_year_[Series]), 1),1),;,-) ● replace(load(_res_[Series]),;,//)

Here's my [Resolution] calculated field:
Code: [Select]
FirstNotEmpty(ifcase([width, 1],2,3840,4K,2560,QHD,1920,FHD,1280,HD,720,480p),
ifcase([height, 1],2,2160,4K,1440,QHD,1080,FHD,720,HD,576,576p,480,480p),
ifcase([height, 1],6,1500,~4K,1200,~QHD,750,~FHD,600,~HD,550,~576p,460,~480p,0,SD))
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #8 on: February 23, 2024, 07:08:15 am »

Slight tweak to fix single-year seasons:
Code: [Select]
if(load(_year_[Series]),,save(fieldquery(Series,[Series], Date /(Year/), 1, 0),_year_[Series]))/
if(load(_res_[Series]),,save(fieldquery(Series,[Series], Resolution, 1, 0),_res_[Series]))/
<b>[Series]<//b> ● replace(listClean(listmath(load(_year_[Series]), 0);listmath(load(_year_[Series]), 1),1),;,-) ● replace(load(_res_[Series]),;,//)

Here's my [Resolution] field:
Code: [Select]
FirstNotEmpty(ifcase([width, 1],2,3840,4K,2560,QHD,1920,FHD,1280,HD,720,480p),
ifcase([height, 1],2,2160,4K,1440,QHD,1080,FHD,720,HD,576,576p,480,480p),
ifcase([height, 1],6,1500,~4K,1200,~QHD,750,~FHD,600,~HD,550,~576p,460,~480p,0,SD))

Holy macaroni, this is some serious wizardry right here!! Very impressive.

Had to try it twice to get it to work 100%. First time I tried the second tweaked code, I didn't get a "pagebreak" after the name. Weird. Anyway, this looks absolutely awesome! Thanks a lot!!

Sorry to say I don't understand one penny of that code, so I need to do some reading to figure it out  :)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #9 on: February 23, 2024, 07:13:24 am »

I edited to add the line break while you were testing, I guess.
Looks like we have similar tastes in content 8)
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How do I add extra info to the Standard View?
« Reply #10 on: February 23, 2024, 07:24:45 am »

I edited to add the line break while you were testing, I guess.
Looks like we have similar tastes in content 8)

It looks like we do! A friendly tip would be to stay at 2022 when it comes to For all Mankind. Mankind should not have had to endure season 4 of this otherwise absolutely fantastic series  ;)

Again, big thanks! My series view looks absolutely awesome now!
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How did I add extra info to the Standard View? (please help my bad memory)
« Reply #11 on: February 23, 2024, 08:35:50 am »

I edited to add the line break while you were testing, I guess.
Looks like we have similar tastes in content 8)

So, I poured a fresh cup of coffee and tried to make sense of your "code".

I get some of it.
You do ListMath to get Min and Max from the variable "_year_[Series]".
You do ListClean to get rid of duplicates, if any.
You do replace to get the characters you want, "-" between years and "/" between resolutions.
So far so good.

What you do with the IF's though, that I can't wrap my head around.
You do a FieldQuery where you want an exact match out of Currect View. You are looking in the field "Series" and you search for the value [series]. What we're looking for is Year.
You then save this FieldQuery into a variable "_year_[Series]".
But what on earth do the IF actually do?

I need more brain  :D
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How do I add extra info to the Standard View?
« Reply #12 on: February 23, 2024, 09:00:06 am »

Excellent progress, you're almost there! :)

- The FieldQuery() gets the different Year/Resolution values for all files that share the same selected [Series] value (as you gathered) - find all files in current view which have the Series field = [Series] value, and for those files return the list of different [Year]/[Resolution] values
- This function is "expensive" and can really slow down the View, so to try to minimize the number of times it runs, we save() the result to a variable named after the current series ("_year_[Series]").
- How do we check if we have already calculated it? We use that if() function:
   if( variable_has_value , do_nothing, else:run the query to calculate and save the variable)

The "variable_has_value" is simply the name of the variable - if it's empty, the if() is FALSE, if it has any text the if() is TRUE.
The "do nothing" is the empty part of the if().
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How do I add extra info to the Standard View?
« Reply #13 on: February 23, 2024, 09:14:20 am »

Excellent progress, you're almost there! :)

- The FieldQuery() gets the different Year/Resolution values for all files that share the same selected [Series] value (as you gathered) - find all files in current view which have the Series field = [Series] value, and for those files return the list of different [Year]/[Resolution] values
- This function is "expensive" and can really slow down the View, so to try to minimize the number of times it runs, we save() it to a variable named after the current series ("_year_[Series]").
- How do we check if we have already calculated it? We use that if() function:
   if( variable_has_value , do_nothing, else:run the query to calculate and save the variable)

The "variable_has_value" is simply the name of the variable - if it's empty, the if() is FALSE, if it has any text the if() is TRUE.
The "do nothing" is the empty part of the if().

Very interesting! Thank your for taking the time to explain it.
If I add a season to a series, would I need to trigger "it" to a "re-evaluation" of the variable somehow?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How do I add extra info to the Standard View?
« Reply #14 on: February 23, 2024, 09:17:36 am »

No, though you may not see the change immediately. Just scrolling or changing the View will cause MC to re-execute the expression; the saved variables are supposed to last 1 minute in memory, but I'm not sure about that, they seem to last longer sometimes; MC also caches the result of FieldQuery() calls for 1 minute to improve performance... so theoretically, after 1 minute the new info should show up. In practice I'm not sure that works well. Worst case, just restart MC and the new info will be there.
Logged

corbendallas

  • Recent member
  • *
  • Posts: 23
Re: How do I add extra info to the Standard View?
« Reply #15 on: February 23, 2024, 09:27:50 am »

No, though you may not see the change immediately. Just scrolling or changing the View will cause MC to re-execute the expression; the saved variables are supposed to last 1 minute in memory, but I'm not sure about that, they seem to last longer sometimes; MC also caches the result of FieldQuery() calls for 1 minute to improve performance... so theoretically, after 1 minute the new info should show up. In practice I'm not sure that works well. Worst case, just restart MC and the new info will be there.

Yes, you seem to be right (again). I made a change and I had to restart MC to get it to show. I had a show with no entries at all for year. When I added a value for Year on S1E1, it showed up straight away, but when I added values for season 2, it took a restart for them to show. Or I wasn't patient enough with my waiting  :)

Again, big thanks. Love the way it looks now!
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2379
Re: How do I add extra info to the Standard View?
« Reply #16 on: February 23, 2024, 09:46:50 am »

You can try without the if() to have it always do the Fieldquery - it should be OK as long as your collection is not huge, and it should update once per minute:

Code: [Select]
save(fieldquery(Series,[Series], Date /(Year/), 1, 0),_year_[Series])/
save(fieldquery(Series,[Series], Resolution, 1, 0),_res_[Series])/
<b>[Series]<//b>
replace(listClean(listmath(load(_year_[Series]), 0);listmath(load(_year_[Series]), 1),1),;,-) ● replace(load(_res_[Series]),;,//)

Or you can try adding a TTL to the variables to force them to expire every minute  ::)

Code: [Select]
save(formatdate(now(),%m),_TTL)/
if(load(_year_[Series][_TTL]),,save(fieldquery(Series,[Series], Date /(Year/), 1, 0),_year_[Series][_TTL]))/
if(load(_res_[Series][_TTL]),,save(fieldquery(Series,[Series], Resolution, 1, 0),_res_[Series][_TTL]))/
<b>[Series]<//b>
replace(listClean(listmath(load(_year_[Series][_TTL]), 0);listmath(load(_year_[Series][_TTL]), 1),1),;,-) ● replace(load(_res_[Series][_TTL]),;,//)
Logged
Pages: [1]   Go Up