kingargyle 19 Posted September 27, 2018 Share Posted September 27, 2018 I've managed to get Emby 3.3 server (yeah I know its old but that is the max version of my main media server pc that can support right now), to server up Movie information to my app. However in trying to display the duration of a movie, I don't know what time format the value RunTimeTicks is stored.. It definitely doesn't appear to be milliseconds. So what time unit is it? Dave Link to comment Share on other sites More sharing options...
Luke 37113 Posted September 27, 2018 Share Posted September 27, 2018 microseconds Link to comment Share on other sites More sharing options...
kingargyle 19 Posted September 27, 2018 Author Share Posted September 27, 2018 microseconds Okay, this Kotlin function seems to do what I need: companion object { const val TICKS_PER_MILLISECOND: Long = 10000 } fun convertTicksToMilliseconds(ticks: Long): Long = ticks.div(TICKS_PER_MILLISECOND) I'll just have to make sure I use that and convert back and forth as needed, since the other server I access stores everything in milliseconds. Link to comment Share on other sites More sharing options...
Luke 37113 Posted September 27, 2018 Share Posted September 27, 2018 Yea in hindsight we should have done ms but it is what it is. Link to comment Share on other sites More sharing options...
mpg732 8 Posted April 25, 2020 Share Posted April 25, 2020 I could use some help here. I am queering the feed back from the server. I am currently have a song playing but paused. When I query the session the data shows "PositionTicks": 472702690, and "RunTimeTicks": 1830196830,. All other data seems to be correct. So if the "Ticks" are in micro seconds, according to the data the run time of this song comes out to 30.5 minutes and is paused at 7.88 minutes. The song actual time is 3.03 minutes long. What am i dong wrong? Thanks Mike Link to comment Share on other sites More sharing options...
Luke 37113 Posted April 25, 2020 Share Posted April 25, 2020 Sounds like your multiplication has an extra 0 on it. 1 tick = 10000ms. Link to comment Share on other sites More sharing options...
mpg732 8 Posted April 25, 2020 Share Posted April 25, 2020 That is what the server is returning. I am getting that info right from the Emby Server API page. If I drop the last zero it still does not convert properly. it converts to 3:05 minutes and the song is 3:03 minutes Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 25, 2020 Share Posted April 25, 2020 (edited) 1830196830 = 183.019683 second or 3.03 minutes and change Edited April 25, 2020 by PenkethBoy Link to comment Share on other sites More sharing options...
mpg732 8 Posted April 25, 2020 Share Posted April 25, 2020 Interesting I was using Google converter. I was putting the value in Microseconds and convert to minutes. that comes out at 3:05. if I change it from Microseconds to seconds it comes out to the 183.019683. Interesting that Google failed. But what about the last zero you mentioned earlier. It is there in the feedback, is that supposed to be there? Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 25, 2020 Share Posted April 25, 2020 Yes seconds = (divide runtimeticks by 10000000) then if you want minutes divide again by 60 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now