Latest Media Handler - facade properties - itemcount (1 Viewer)

Rob Hexenmeister

MP Donator
  • Premium Supporter
  • May 12, 2011
    164
    38
    Slaithwaite
    United Kingdom United Kingdom
    Country flag
    Good evening all,

    I am customising my BasicHome screen (some of you may remember). Thanks to the excellent help and support this is coming along quite well.. but I have come across a hurdle. I can't find a property that reports back the number of items in facadeview of Latest Media Handler.

    I can use selected item for the name, selected index for the enumerator of the current item, but I can't find anything to tell me how many items there are - I was expecting to use #itemcount but that doesn't work.

    Am I missing something?

    Many thanks
    RH
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,183
    1,338
    Southampton
    United Kingdom United Kingdom
    Country flag
    I can use selected item for the name, selected index for the enumerator of the current item, but I can't find anything to tell me how many items there are - I was expecting to use #itemcount but that doesn't work.
    I have not tried using "Latest Media Handler" in my skin, so there may be some specific restrictions that apply. However, #itemcount is notorious for being unset in various circumstances (so you may have found another one).

    Below is the xml that I use to generate the item count string (top left corner in my skin); the comments explain why this logic is necessary:

    <!-- ====================================================================
    The built-in variables "#selectedindex" and "#itemcount" have incorrect
    values on some panels. To avoid bad labelling appearing on the panel, we
    use the following algorithm, where "(null)" represents the zero-length
    string, and "n" and "m" are integers:
    Code:
    #selectedindex  #itemcount  label_shown
       (null)         (null)      (none)
       (null)           0         0 items
       (null)           n         n items
         0            (null)      (none)
         0              0         0 items
         0              n         n items
         n            (null)      Item n
         n              0         Item n
         n              m         Item n/m
    In addition, when the context menu is on the screen, "#selectedindex"
    is the index of the highlighted item in the context menu, and not the
    index of the item in the list. So when the context menu is visible, we
    display the null string or "n items", as appropriate.
    ===================================================================== -->
    <label>#(switch(
    and(eq(#currentmodule,L(102012)),eq(#itemcount,'')),'',
    eq(#currentmodule,L(102012)),'#itemcount items',
    and(eq(#selectedindex,''),eq(#itemcount,'')),'',
    and(eq(#selectedindex,'0'),eq(#itemcount,'')),'',
    or(eq(#selectedindex,''),eq(#selectedindex,'0')),'#itemcount items',
    or(eq(#itemcount,''),eq(#itemcount,'0')),'Item #selectedindex',
    eq(1,1),'Item #selectedindex/#itemcount'))</label>

    So there you have it. Simples! :D

    -- from CyberSimian in the UK
     

    Rob Hexenmeister

    MP Donator
  • Premium Supporter
  • May 12, 2011
    164
    38
    Slaithwaite
    United Kingdom United Kingdom
    Country flag
    Good heavens! Thank you very much

    So that label code is what I want then? My intention was to use #itemcount in a visibility condition for a forward arrow graphic - i.e. if #selectedindex = #itemcount then forward arrow graphic visibility = false.

    RH
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,183
    1,338
    Southampton
    United Kingdom United Kingdom
    Country flag
    My intention was to use #itemcount in a visibility condition for a forward arrow graphic - i.e. if #selectedindex = #itemcount then forward arrow graphic visibility = false.
    Hmm, I don't think that the <label> code that I showed is quite what you want. The <label> code is what is needed to generate a sensible item count in the top left corner of the panel. Because "#itemcount" and "#selectedindex" are unreliable, I don't think that you will be able to achieve what you want. :(

    -- from CyberSimian in the UK
     

    Users who are viewing this thread

    Similar threads
    OP Title Forum Replies Date
    Rob Hexenmeister [solved] Latest Media Handler - skinning buttons Fanart Handler 19
    Rob Hexenmeister [solved] Latest media handler - time reported as date Fanart Handler 18
    Lichloathe [solved] Latest Media Handler - Default view for TVSeries on startup Fanart Handler 2
    ajs [solved] Latest Media Handler - Skin settings - Custom latests items number Fanart Handler 27
    Rob Hexenmeister [solved] Latests Media Handler - Skinning an updating window or control Fanart Handler 26
    Rob Hexenmeister Video Buttons / Latest Media MediaPortal 1 Skins 7
    1gkar Latest Intel HD4600 Drivers Issue General Support 1
    T No TV after updating Windows 10 to latest Version 1903 / OS build 18362.175 (logs attached) General Support 2
    G How best to get cover art for tracks to show up on the Audio Menu (Latest Added, Unplayed)? General 9
    uxDesign [Question] Where are the latest sources of mpextended? MPExtended 3
    J Copying Old VHS tapes Newcomers Forum 8
    C Media Portal 1.22 hängt neuerdings beim Start Allgemeines Supportforum 3
    toricred MP2 - V2.3 MP 2.3 Media Library Duplicates General 20
    O No Video playback on Media Portal 2.2.3 Newcomers Forum 2
    F Remote goes tos Media Center after Media Portal Remotes 2
    S Kommerzielle HTPC´s mit "selbst entwickelter Media center Distribution auf Basis von Media Portal" MediaPortal Café 9
    F Media Port 1.16 to 1.25 Installation, configuration support 1
    RoChess Weird GPU crash -- possible cause: resizing media MediaPortal 1 Talk 8
    J Navigating media drive General 4
    J Will Media Portal meet my requirements? General Support 4
    C Imported media doesn't show up immediately? General 1
    J Show media item location Feature Requests 4
    HTPCSourcer Media Accessor is flooding logs with files from attached monitor MediaPortal 2 9
    N [fixed] [MP2-822] Folder View is not displaying individual media share elements Submit: Bug Reports 4
    A MP2.2.2, understanding movies/videos/tv and WTV recordings. General 16

    Similar threads

    Top Bottom