Is it possible to add two time values? (1 Viewer)

123vak123

Portal Pro
December 13, 2010
194
148
Minsk
Belarus Belarus
Country flag
In most skins in 'videoFullScreen.xml' and 'videoOSD.xml' #duration tag displays information about the duration of the video. But I would like to display information about the end time of the video. For this it is necessary to add two time values: the current time (#time) and the remaining playback time (#currentremaining). Can I do this in MediaPortal?

I read the page in WiKi (Skin Logic Expressions) about the function date.add. But there are no specific examples and my knowledge is not enough to realize what I want.
 

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    11,828
    6,679
    Kyiv
    Ukraine Ukraine
    Country flag
    Hmmmm... try:
    #(date.add('h',date.extract('h',cdate(#currentremaining)),cdate(#time)))
    if work jast add minutes an seconds :)
    Like:
    #(date.add('m',date.extract('m',cdate(#currentremaining)),date.add('s',date.extract('s',cdate(#currentremaining)),date.add('h',date.extract('h',cdate(#currentremaining)),cdate(#time)))))
    Check brackets and wiki for minutes and seconds
    --
    WBR, ajs
     
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    11,828
    6,679
    Kyiv
    Ukraine Ukraine
    Country flag
    If not work, then need add new Skin function like:
    ctimestamp() - convert string time to timestamp

    And usage like: #(string.format('HH:mm:ss',date.add(cdate(#time), ctimestamp(#currentremaining))))


    --
    WBR, ajs
     

    123vak123

    Portal Pro
    December 13, 2010
    194
    148
    Minsk
    Belarus Belarus
    Country flag
    "#(date.add('n',date.extract('n',cdate(#currentremaining)),date.add('s',date.extract('s',cdate(#currentremaining)),date.add('h',date.extract('h',cdate(#currentremaining)),cdate(#time)))))" - works only if the number of hours is more than 1. If hours is less than 1, then "date.extract('h',cdate(#currentremaining))" returns minutes, "date.extract('n',cdate(#currentremaining))" - seconds, "date.extract('s',cdate(#currentremaining))" - 0 (error ?) :)

    If hours is less than 1:
    #(date.add('n',date.extract('h',cdate(#currentremaining)), date.add('h',date.extract('s',cdate(#currentremaining)),cdate(#time))))) - work fine
     

    Attachments

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    11,828
    6,679
    Kyiv
    Ukraine Ukraine
    Country flag
    otherwise I do not know how to do this with the current functions. Is it possible to analyze the hour or not with #iif or #switch
    See wiki for logic Function and date function... ;)

    --
    WBR, ajs
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    11,828
    6,679
    Kyiv
    Ukraine Ukraine
    Country flag
    Added:
    Code:
    ctimespan(value)
    Convert value to ctimespan. If value is not a valid ctimespan, reutrns an error.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    RoChess Weird GPU crash -- possible cause: resizing media MediaPortal 1 Talk 8
    P Recordings not showing up unless re-imported and not possible to delete General 0
    emphatic Pictures in the cloud - would a plugin be possible for services like Google Photos MediaPortal 1 Plugins 1
    SpudR IS this even possible? My TVSeries 9
    Lehmden [Videos] More filename possibility for MyVideos local fanart. Improvement Suggestions 26
    S Upmixing/upconverting to Dolby Atmos possible ? General Support 1
    T [solved] "Unable To Play" (Videos) rears it's head again. Logs not possible... WatchDog error attached!! :( General Support 1
    Lehmden Manual schedule: Possibility to enter a show name Feature Requests 1
    N [Proposal] Make text input possible with remote control in SMS style MediaPortal 2 1
    N [Finished] It is possible to map the same key to the same action twice MediaPortal 2 2
    Lehmden MP2 client for Windows 10 ARM, possible? Maybe an UWP version could do the trick... MediaPortal 2 11
    porky996t DVB Sat card possibly failed General Support 1
    D MP2.2: Possible bugs 2.2 Archive 20
    T Pause a recording possible? MediaPortal 1 Talk 0
    mp2-ulrich [solved] MP2 W10 watching tv not possible General 3
    C Is it possible to search or filter non-movie videos in Videos plug-in? General Support 4
    G Mediaportal > dreambox dm900 4k > amazon primevideo.com plugin it is possible?? General Support 0
    ajs [WiP] 5030: Add UHD Thumb size to TV Server MediaPortal 1 0
    ajs [fixed] 5029: Add the ability to choose the type of pause for designers in the slideshow MediaPortal 1 4
    P MP 2 - Request to add an additional TV series Filename protocal Feature Requests 0
    raffe How to add 500+ streams? OnlineVideos 1
    T How to add missing buttons IR Server Suite (IRSS) 0
    R [solved] Moving pictures importer wont add files from a removable drive. Is there a work around ? Moving Pictures 8
    cbr954rr Possibillity to add more Movie Folders in Menu General 5
    ajs [solved] 4935: Add string.replace function to Skin engine MediaPortal 1 10
    Similar threads

























    Top Bottom