Expressions/Rules exchange (2 Viewers)

Inker

Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Please use this thread to share your generated logo rules and parsing expressions that you think might be useful for other users. Please do not reply with requests and any other small talk ;-) Stay on topic. Questions/discussussions pls into the request thread.

    To copy a Parsing expression, select it in configuration and hit Ctrl+C. Then paste it between the
    Code:
     tag in the template.
    To copy a Logo Rule, bring up its configuration and click "Copy". All nesessary info is now in your clipboard. Paste it between the [CODE] tag in the template. This only works for versions dated 2007-04-13 and up.
    
    To paste a Parsing Expression Copy it (Ctrl+C) and paste it into a new entry field in your configuration (Ctrl+V) and make sure you select the correct type (Simple/Regex).
    To paste a Logo Rule, copy everything between the Code tags in the template (Ctrl+C), Click Add Rule and click Paste. You might want to/have to change the path to the filename. Then save the result. This only works for versions dated 2007-04-13 and up.
    
    For everyones convinience I suggest everybody use this template:
    
    Template for Parsing expressions:
    
    [B]Type:[/B] Parsing - simple/Regex
    [B]<TITLE>[/B]
    [B]Description:[/B]
    <describe in a few words what the goal is/was and maybe its limitations>
    [B]Expression:[/B]
    [CODE]<add the parsing expression here>

    Template for Parsing expressions:

    Type: Logo Rule
    <TITLE>
    Description:
    <describe in a few words what the goal is/was and maybe its limitations>
    Expected Filename: static/dynamic
    <give an example filename if dynamic, or the static filename expected>
    Rule:
    Code:
    <add the copied rule here>

    Let's help each other out :)
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    OK, to get us started, and maybe to show you some real life examples (I know it isn't documented very well) let me start off.

    Type: Logo Rule
    Episode Images
    Description:
    Display a manually downloaded/created episode image. The Image should be in the banners/Seriesname folder (where your banners reside) and in the format SeasonxEpisode.jpg.
    Expected Filename: dynamic
    plugins\windows\banners\Lost/3x1.jpg
    Rule:
    Code:
    plugins\windows\banners\<Series.Pretty_Name>\<Episode.SeasonIndex>x<Episode.EpisodeIndex>.jpg;-;;-;=;-;;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;

    *************************************************

    Type: Logo Rule
    Network (Channel) Logo
    Description:
    Display an Network (Channel) Logo.
    Expected Filename: dynamic
    Plugins\Windows\Logos\Networks\abc.png
    Rule:
    Code:
    Plugins\Windows\Logos\Networks\<Series.Network>.png;-;;-;=;-;;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;

    *************************************************

    Type: Logo Rule
    HD 720p
    Description:
    Display a Logo for files with a dimension of 1280x720 (HD 720p)
    Expected Filename: static
    Plugins\Windows\Logos\hd_720p_logo.png
    Rule:
    Code:
    Plugins\Windows\Logos\hd_720p_logo.png;-;<Episode.videoWidth>;-;=;-;1280;-;AND;-;<Episode.videoHeight>;-;=;-;720;-;AND;-;;-;=;-;;-;

    *************************************************


    Type: Logo Rule
    Surround Sound Logo
    Description:
    Display a surround sound logo for files with more than (or equal) 5 Audio channels (surround).
    Expected Filename: static
    Plugins\Windows\Logos\dolby_logo.png
    Rule:
    Code:
    Plugins\Windows\Logos\dolby_logo.png;-;<Episode.AudioChannels>;-;>=;-;5;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;

    *************************************************

    Type: Logo Rule
    Video Codec
    Description:
    Display a logo depending on the Video Codec for a given file.
    Note that some codecs are parsed not in their "friendly" name. Check the Episode Details in the Configuration to find out what a codec parses as.
    Examples:
    DivX: divx
    XVID: xvid
    H264: V_MPEG4_ISO_AVC
    Expected Filename: dynamic
    Plugins\Windows\Logos\logo_V_MPEG4_ISO_AVC.png
    Rule:
    Code:
    Plugins\Windows\Logos\logo_<Episode.VideoCodec>.png;-;;-;=;-;;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;

    *************************************************

    Type: Logo Rule
    Audio Codec
    Description:
    Display a logo depending on the Audio Codec for a given file.
    Note that some codecs are parsed not in their "friendly" name. Check the Episode Details in the Configuration to find out what a codec parses as.
    Examples:
    MP3: MPEG-1A L3
    AC3: A_AC3
    Expected Filename: dynamic
    Plugins\Windows\Logos\logo_MPEG-1A L3.png
    Rule:
    Code:
    Plugins\Windows\Logos\logo_<Episode.AudioCodec>.png;-;;-;=;-;;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;

    *************************************************

    Type: Logo Rule
    16:9 Logo
    Description:
    Display a logo for files in 16:9 (Widescreen) Aspect Ratio. Values from 1.7 - 1.85 are accepted.
    Expected Filename: static
    Plugins\Windows\Logos\logo_16-9.png
    Rule:
    Code:
    Plugins\Windows\Logos\logo_16-9.png;-;<Episode.VideoAspectRatio>;-;>;-;1.7;-;AND;-;<Episode.VideoAspectRatio>;-;<;-;1.85;-;AND;-;;-;=;-;;-;

    *************************************************

    Type: Logo Rule
    4:3 Logo
    Description:
    Display a logo for files in 4:3 (Fullscreen) Aspect Ratio. Values from 1.3 - 1.5 are accepted.
    Expected Filename: static
    Plugins\Windows\Logos\logo_16-9.png
    Rule:
    Code:
    Plugins\Windows\Logos\logo_4-3.png;-;<Episode.VideoAspectRatio>;-;>;-;1.3;-;AND;-;<Episode.VideoAspectRatio>;-;<;-;1.5;-;AND;-;;-;=;-;;-;
     

    Sh4nn0w

    MP Donator
  • Premium Supporter
  • September 14, 2006
    321
    23
    Home Country
    United Kingdom United Kingdom
    For anyone doing dynamic logos, i've come across the following so far:

    *************************************************
    Type: Logo Rule
    Video Codec


    Other Divx Variations:
    DIV3
    DX50

    *************************************************
    Type: Logo Rule
    Audio Codec


    AC3 is also sometimes just identified as AC3 not A_AC3

    *************************************************

    Just duplicate as instructed & change filename to alternative
     

    JonJon

    Portal Member
    April 30, 2007
    25
    9
    Home Country
    For anyone that needs to get double episodes

    Type: Parsing - Regex
    Description:
    Had a lot of downloaded files with their original file such as
    [DB]_Bleach_50_[23A18CB4].avi
    [DB]_Bleach_52-53_[069BE2EB].avi
    [DB]_Bleach_63_Special_[C70774F3].avi
    [DB]_Bleach_75-76_Special_[31E39A56].avi

    This expression will always return the series and episode and extension, if episode2 exists then it will also return it.

    Expression:
    Code:
    \[DB\]_(?<series>[^_]*?)_(?<episode>[0-9]{1,3})(-(?<episode2>[0-9]{1,3}))?[\w\[\]]*.(?<ext>[^\\]*)
     

    Anthrax

    Portal Pro
    February 15, 2007
    157
    48
    pretty much in the center
    Home Country
    Germany Germany
    Just my two cents...

    You can find the logos used in these rules over at: this thread...

    Following rules will show the:
    - favorite logo
    - genre logo
    - runtime logs

    ************************************************************
    Type: Logo Rule
    Favorite Show
    Description:
    Display a favorite logo for shows you marked as favorites from within the tv-series plugin.
    Expected Filename: static
    Thumbs\MPTVSeriesBanners\!logos\Favorite.png
    Rule:
    Code:
    Thumbs\MPTVSeriesBanners\!logos\Favorite.png;-;<Series.isFavourite>;-;=;-;1;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;

    ************************************************************
    Type: Logo Rule
    Genre
    Description:
    Display a logo for a show according to it's genre on thetvdb.com.
    Expected Filename: static
    Thumbs\MPTVSeriesBanners\!logos\Adventure.png
    Rule:
    Code:
    Thumbs\MPTVSeriesBanners\!logos\Adventure.png;-;<Series.Genre>;-;contains;-;adventure;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;

    ************************************************************
    Type: Logo Rule
    Runtime (i.e.: approx. 20min playtime)
    Description:
    Display a 1/3 filled clock logo when the runtime for an episode is just below 25mins or 1500000millisecs (don't believe me? ask google :D ).
    Expected Filename: static
    Thumbs\MPTVSeriesBanners\!logos\20min.png
    Rule:
    Code:
    Thumbs\MPTVSeriesBanners\!logos\20min.png;-;<Episode.localPlaytime>;-;<;-;1500000;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;


    bye,
    Anthrax

    PS: the runtime stuff is object to heavy tweaking - this was just a glimpse hint on how it could be done ;)
     

    Vergo

    Portal Pro
    August 30, 2005
    162
    59
    Brugge
    Home Country
    Belgium Belgium
    WS

    Type: Logo Rule
    16:9 Logo
    Description:
    This is in my humble opinion the best way to get this right. Since every 4:3 has 1.33 as aspect ratio, all others are widescreen
    Expected Filename: static
    169 wide black
    Rule:
    Code:
    Plugins\Windows\Logos\169 wide black.png;-;<Episode.VideoAspectRatio>;-;!=;-;1.333;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;
     

    quanfer

    Portal Member
    December 13, 2007
    29
    1
    Template for Parsing expressions:

    Type: Parsing - Regex
    Band of Brothers
    Description:
    For files labeled as "Ep01", such as Band.of.Brothers.Ep05.2001.720p.HDDVD.DTS.x264-ESiR.mkv
    However, you will have to set a simple expression to replace "x264" with <empty> before matching. Also, make sure that the files are in a folder under "season 1"

    Expression:
    Code:
    (?<season>[0-9])[\\](?<series>[\w.]*)\.Ep(?<episode>[0-9]*)(?:[-.\w])*\.(?<ext>[^\\]{0,3})
     

    mascot4hire

    New Member
    February 2, 2008
    3
    0
    Home Country
    Type: Parsing - Regex

    Description:
    made for me by Karyudo for files named like this "Z:\TV Shows\Entourage\Season 1\104 - Date Night.avi"
    the 1 in the filename meaning season 1 and 04 the episode number.
    works great so long as your files are exactly like this.

    Expression:

    Code:
    (?<series>[\w .,'!&$]*)\\[\w\s0-9]*\\(?<season>[0-9]{1})(?<episode>[0-9]{2}).{3}(?<title>[\w .,'!&$]*)\.
     

    spuck

    Community Skin Designer
    April 6, 2007
    397
    59
    Home Country
    Sweden Sweden
    Here are a few of my formatting rules that I use in the Aeon skin port.

    Type: Formatting Rule
    VIDEOFILE INFORMATION
    Result: 1280x720 (1,78) 23,976fps

    Rule:
    Skin Variable: #TVSeries.Episode.InfoPanelLine1Value
    Code:
    <Enabled>1<Format><Episode.InfoPanelLine1Value><FormatAs><Episode.videoWidth>x<Episode.videoHeight> (Eval(Round(<Episode.VideoAspectRatio>*100)/100)) Eval(Round(<Episode.VideoFrameRate>*1000)/1000)fps



    Type: Formatting Rule
    CODEC/BITRATE INFORMATION
    Result: (H264) 5,9 Mbps, (AC3) 384 Kbps

    Rule:
    Skin Variable: #TVSeries.Episode.InfoPanelLine2Value
    Code:
    <Enabled>1<Format><Episode.InfoPanelLine2Value><FormatAs>(<Episode.VideoCodec>) Eval(Round(PrettyBytes1000(<Episode.VideoBitrate>)*10)/10-> | Kbps| Mbps| Gbps), (<Episode.AudioCodec>) Eval(Round(PrettyBytes1000(<Episode.AudioBitrate>)*10)/10-> | Kbps| Mbps| Gbps)



    Type: Formatting Rule
    VIDEO/CODEC/BITRATE CRAP CLEANUP
    Result: Result will be empty. Note: You can make it say whatever.
    Description:
    If the file that is highlighted doesn't exist some crap will still be displayed. These Rules will remove it completely. Or maybe write some text saying the file is not present.

    Rule:
    Code:
    <Enabled>1<Format>x () fps<FormatAs> 
    <Enabled>1<Format>() , ()<FormatAs>



    Type: Formatting Rule
    RATING STARS
    Result: "tvseries\star0.png" -> "tvseries\star10.png"
    Description: You can use full paths as well but this way the stars are always in "[your skin]\Media\tvseries\" folder. Be sure to put the star pngs in that folder. "tvseries\star.png" can be used to display 10 empty stars when it's not rated yet, looks a lot better IMO.

    Rule: (My Episode Rating)
    Skin Variable: #TVSeries.Episode.myRatingPath
    Code:
    <Enabled>1<Format><Episode.myRatingPath><FormatAs>tvseries\star<Episode.myRating>.png

    Rule: (My Series Rating)
    Skin Variable: #TVSeries.Series.myRatingPath
    Code:
    <Enabled>1<Format><Series.myRatingPath><FormatAs>tvseries\star<Series.myRating>.png

    Rule: (TVDB Episode Rating)
    Skin Variable: #TVSeries.Episode.RatingPath
    Code:
    <Enabled>1<Format><Episode.RatingPath><FormatAs>tvseries\starEval(Round(Abs(<Episode.Rating>))).png

    Rule: (TVDB Series Rating)
    Skin Variable: #TVSeries.Series.RatingPath
    Code:
    <Enabled>1<Format><Series.RatingPath><FormatAs>tvseries\starEval(Round(Abs(<Series.Rating>))).png
     

    z3us

    Portal Pro
    December 4, 2007
    1,047
    123
    44
    Home Country
    Spain Spain
    Type: Logo Rule
    EPISODE IN DVD
    Description:
    Shows a DVD logo if the episode file is stored in a DVD. You should have added it to the DB in the DVD and u should change "e:\" for the letter of your DVD unit
    Expected Filename: static/dynamic
    thumbs\TVseries\DVD.png
    Rule:
    Code:
    thumbs\TVseries\DVD.png;-;<Episode.EpisodeFilename>;-;contains;-;e:\;-;AND;-;;-;=;-;;-;AND;-;;-;=;-;;-;
     

    Users who are viewing this thread

    Top Bottom