INTERACT FORUM

Please login or register.

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

Author Topic: HOW TO: Create Custom Tooltips Per Media Type  (Read 806 times)

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
HOW TO: Create Custom Tooltips Per Media Type
« on: January 31, 2023, 11:25:03 am »

Continuing how to series. This one is discussed in many old threads already but those old discussions are sometimes hard to find as the title might be misleading topic burdened with old MC release or the actual discussion have lots of off topic messages to make it hard to follow. But anyway....

Custom Tooltips Per Media Type

1. Go to: Options -> Library & Folders -> ... Manage Library Fields...

2. Create library field: "Tooltip" and set it to Calculated Field
MC will use this field to display file's tooltip. Group tooltips are not customizable.

Note: Technically you can enter your rules for different categories right into Tooltip field but it is more convenient to maintain rules by splitting the rule sets to logical parts (fields) so insert following string as an expression for Tooltip
Code: [Select]
FirstNotEmpty([Tooltip - Audio], [Tooltip - Movie], [Tooltip - TV Show])This will select first tooltip rule (field) which is matching the file for which tooltip is shown. You can of course create more different rules (fields) but for this example I limited it to these three.

Now we can create actual rule/display fields for Tooltip.

3. Create Library Field: "Tooltip - Audio" and set it to Calculated data
Insert expression for it which limits the candidates for this templates to Media Type = Audio. If file is not Audio then this expression is skipped
Code: [Select]
If(IsEqual([Media Type],Audio,1),

<font color="#3399ff"><b>Artist<//b><//font>
    [Artist]
<font color="#3399ff"><b>Name<//b><//font>
    [Name] /([Duration]/)
<font color="#3399ff"><b>If(!IsEmpty(Composer),Composer<//b><//font>
    Replace([Composer],;,/ /// ),)
<font color="#3399ff"><b>Album<//b><//font>
    [Album] If(!IsEmpty([Date]),/([Date (Year)]/),)
<font color="#3399ff"><b>Last Played<//b><//font>  If([Last Played],<br>/    CompareDates([Last Played,0], Now()) ago, Never)

<font color="#3399ff"><b>Filename<//b><//font>
    [Filename]/

,)

4. Create Library Field: "Tooltip - Movie" and set it to be Calculated data
Insert expression for it which limits the candidates for this templates to Media Sub Type = Movie. (example tooltip template inside the rule)
Code: [Select]
If(IsEqual([Media Sub Type],Movie,1),

<font size="200"><b>[Name]<//b><//font>
<font size="130">[Date (Year)]/
/    FormatNumber(Math([Duration,0]/60)) min/
If([mpaa rating],/    [mpaa rating],)/
/    <font color="#CCEE11">★<//font> FirstNotEmpty([imdb rating],
                                                   [tmdb rating],
                                                   ListItem(RemoveLeft([critic rating],5),0,/ // ))/
If([Rotten Tomatoes],/    <font color="#AA2200">⬤<//font> [rotten tomatoes],)/
/    Ends at FormatDate(Math(Replace(Now(),/,,.) + (Replace([Duration,0],/,,.)/86400)),HH:mm)<//font>

<font valign="Top">Video      RemoveLeft(ListItem([Compression],0,/,),18)<//font>
<font valign="Bottom">Audio     RemoveRight(RemoveLeft(ListItem([Compression],1,/,),6),1)<//font>/

If([Tag line],<br><br>[Tag line],)

[Description]

If([Genre],Genre       <b>Replace([Genre],;,/,/ )<//b>,)
If([Director],Director    <b>[Director]<//b>,)
If([Screenwriter],Writers     <b>ListFormat([Screenwriter],2)<//b>,)
If([Actors],Stars        <b>ListFormat(ListLimit([Actors],6),2)<//b>,)


[Filename]/

,)

5. Create Library Field: "Tooltip - TV Show" and set it to be Calculated data
Insert expression for it which limits the candidates for this templates to Media Sub Type = TV Show. (example tooltip template inside the rule)
Code: [Select]
If(IsEqual([Media Sub Type],TV Show,1),

<font Size="200"><b>[Series]<//b><//font>
Season PadNumber([Season],2)/
/   Episode PadNumber([Episode],2)/
/   FormatNumber(Math([Duration,0]/60)) min/
/    <font color="#CCEE11">★<//font> FirstNotEmpty([imdb rating],
                                                   [tmdb rating],
                                                   ListItem(RemoveLeft([critic rating],5),0,/ // ))

<font size="120">[Name]<//font>
[Description]

Stars   ListFormat(ListLimit([Actors],6),2)

[Filename]/

,)

Now you should have different tooltips for Audio, Movies and TV Shows. Examples are just simple expressions to introduce the system. Now head e.g. to zybex's thread to see more comprehensive tooltip example(s) and perhaps also share your own creations.


LINKS:
zybex thread to collect tooltip examples. Use it to show case your custom tooltips templates

REF:
Old discussion about tooltip customization
Customize tooltips (mostly about theaterview customization)
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: HOW TO: Create Custom Tooltips Per Media Type
« Reply #1 on: January 31, 2023, 11:25:23 am »

reserved
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72396
  • Where did I put my teeth?
Re: HOW TO: Create Custom Tooltips Per Media Type
« Reply #2 on: January 31, 2023, 11:33:41 am »

Thanks, lepa!
Logged

Purecut

  • World Citizen
  • ***
  • Posts: 107
Re: HOW TO: Create Custom Tooltips Per Media Type
« Reply #3 on: February 01, 2023, 08:29:09 am »

You also should say that the fields for [Tooltip .....
should be hidden and also from type "without input". I have noticed that otherwise the script code is not executed correctly.
Logged
Pages: [1]   Go Up