Moving pictures doesn't remember position. (1 Viewer)

ltfearme

Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,698
    7,083
    Sydney
    Australia Australia
    Country flag
    Started Playback
    Code:
    [2015-07-03 19:37:32,094] [Log  ] [MPMain  ] [INFO ] - g_Player.OnStarted() D:\Film\Faster (2010) [1080p]\Faster.2010.1080p.BrRip.x264.YIFY.mp4 media:Video
    Send To Trakt (Start Watching):
    Code:
    2015-07-03 19:37:32.685 [INFO] [Scrobble][46]: Sending start scrobble of movie to trakt.tv. Title = 'Faster', Year = '2010', IMDb ID = 'tt1433108', TMDb ID = '41283'
    2015-07-03 19:37:33.225 [INFO] [Scrobble][46]: Scrobble Response: {"action":"start","episode":null,"movie":{"ids":{"slug":"faster-2010","trakt":27285,"imdb":"tt1433108","tmdb":41283},"title":"Faster","year":2010},"progress":0,"sharing":{"facebook":false,"tumblr":false,"twitter":false},"show":null}
    Ended Playback
    Code:
    [2015-07-03 20:10:43,410] [Log  ] [MPMain  ] [INFO ] - VideoPlayer:ended D:\Film\Faster (2010) [1080p]\Faster.2010.1080p.BrRip.x264.YIFY.mp4
    Send To Trakt (Paused Watching):
    Code:
    2015-07-03 20:10:43.411 [INFO] [Scrobble][24]: Sending 'pause' scrobble of movie to trakt.tv. Progress = '0%', Title = 'Faster', Year = '2010', IMDb ID = 'tt1433108', TMDb ID = '41283'
    2015-07-03 20:10:44.063 [INFO] [Scrobble][24]: Scrobble Response: {"action":"pause","episode":null,"movie":{"ids":{"slug":"faster-2010","trakt":27285,"imdb":"tt1433108","tmdb":41283},"title":"Faster","year":2010},"progress":0,"sharing":{"facebook":false,"tumblr":false,"twitter":false},"show":null}
    It looks like it sent the pause with 0% progress watched, so when you restarted mediaportal, the trakt paused sync reset your resume time to 0%.

    The big question is why the trakt plugin didn't know how much you actually watched. This could of happen for a number of reasons.

    We first get the players current position:
    Code:
    // MovingPictures stores duration in milliseconds, g_Player reports in seconds
    double currentPosition = g_Player.CurrentPosition;
    Then we get the total duration of the video:
    Code:
    double duration = GetMovieDuration(movie, IsDVDPlaying);
    
    private double GetMovieDuration(DBMovieInfo movie, bool isDVD)
    {
       double duration = 0.0;
    
       // first try to get from MediaInfo
       if (movie.ActualRuntime != 0)
       {
         // MovingPictures stores duration in milliseconds
         duration = movie.ActualRuntime / 1000.0;
       }
       else if (g_Player.Duration != 0.0)
       {
         // g_Player reports in seconds
         duration = g_Player.Duration;
       }
       else
       {
         // MovingPictures stores scraped runtime in minutes
         duration = movie.Runtime * 60.0;
       }
     
       // MediaInfo runtime from MovingPictures is wrong
       // it sums up all videos on the DVD structure!
       // check if more than 4hrs will suffice
       if (isDVD && duration > (4 * 60 * 60)) duration = movie.Runtime * 60.0;
    
       // sometimes we could be finishing a DVD in an featurette
       // come up with an arbitrary runtime to avoid scrobbling as a trailer,
       // and be rejected, only do this on DVDs
       if (isDVD && duration < 900.0) duration = 120 * 60;
    
       return duration;
    }
    Finially the progress is calculated:
    Code:
    // g_Player reports in seconds
    double progress = duration != 0.0 ? (currentPosition / duration * 100.0) : 0.0;
    I suspect that either the duration of the video as reported in movingpics = 0 or MediaPortal is giving me a current position of 0.

    Can you check your MovingPictures configuration for that movie and see what the Runtime is set to? Check the Movie Details 'Runtime' and the File Details 'Duration'.

    You might need to update MediaInfo for that file or re-scrape the movie. Maybe you have disabled MediaInfo scan?
     
    Last edited:

    Freethefire

    Portal Member
    May 18, 2006
    45
    5
    MediaPortal needs quite a lot of time to shut everything down correctly and close the databases properly with all the data written, is your PC restarting before that is all done? There are OS settings to adjust the time it waits for processes to complete, and will do a hard-kill if time expires.
    Did quite a few trial runs yesterday. I only shut down MP, not the pc, with either the drop down menu X or the "exit mediaportal" command in basic menu. Also tried with and without your backup script. It does remember the timestamp sometimes, but to me it's random. I shut down MP more often in a day than Windows, since my son watches kids stuff on Netflix. So I don't think It has anything to do with the shut down of the actual pc.

    Can you check your MovingPictures configuration for that movie and see what the Runtime is set to? Check the Movie Details 'Runtime' and the File Details 'Duration'.
    The movie I chose, reported runtime as 136 in "Movie details", but in "File details" it shows as 8177168. That seems wierd right? The same is true after a forced MediaInfo update.

    You might need to update MediaInfo for that file or re-scrape the movie. Maybe you have disabled MediaInfo scan?
    I don't think I've disabled it. I add movies quite frequently, and it finds them without interaction almost every time.

    Thanks again for your explanation and reply! Both of you!

    Edit: just saw that all the movies I've started watching have the same "Resume title bd" 1000.
    Edit2: tried starting from scratch again, deleting the db and reimporting all movies. On first MP restart it remembered, then it didin't yet again.
     
    Last edited:

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,698
    7,083
    Sydney
    Australia Australia
    Country flag
    The movie I chose, reported runtime as 136 in "Movie details", but in "File details" it shows as 8177168. That seems wierd right? The same is true after a forced MediaInfo update.
    That's okay, File details reports MediaInfo in milliseconds which is 8177168/1000/60 = 136.

    The issue still remains the same though, we need to figure out why the progress is reported as 0 after partially watching a video (that is the root cause). There could be a race condition after watching the video and g_Player.CurrentPosition; reports 0 to trakt. I will give you a test build of trakt with extra logging to figure out why that calculation is incorrect.

    If you want a temp work-around you can disable resume sync in trakt, that way it will not revert your resume time after restart. You can uncheck 'Sync Playback (resume) data on Startup/Resume' from trakt configuration.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,698
    7,083
    Sydney
    Australia Australia
    Country flag
    @Freethefire , can you please repeat your test after installing the trakt package attached to this thread. It's not a fix but just some extra logging to capture the duration and currentposition of the title you watch before sending to trakt. I suspect one of these is 0. I only need the TraktPlugin.log.
     

    Attachments

    Freethefire

    Portal Member
    May 18, 2006
    45
    5
    This is really strange. I'm actually having a hard time reproducing the error after I installed the new Trakt version. I haven't changed anything since yesterday. I'll upload the log as soon as I get the problem again, which should be during today.

    Thanks again for your assistance!

    Edit: here we go. I hope that this is the log you need!
     
    Last edited:

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

    OP Similar threads Forum Replies Date
    M.Hulot Moving Pictures lässt sich nach Windows-Update nicht mehr öffnen Plugins & Erweiterungen 1
    cerberus Moving Pictures zeigt Film Spezifikationen nicht richtig Plugins & Erweiterungen 12
    P Configuration Moving Pictures Support d'installation et de configuration 0
    R [solved] Moving pictures importer wont add files from a removable drive. Is there a work around ? Moving Pictures 8
    badboyxx [solved] Moving Pictures and MediaPortal 1.23 Regeszter Edition Moving Pictures 93
    caveman [solved] Moving Picture 97% CPU Moving Pictures 9
    T Moving Pictures...seem to have 'lost' ability to display Movie info. (eg Resolution/Audio) Moving Pictures 2
    raffe [solved] Export tool and import support from MP-TVSeries & Moving Pictures to MP2 General 22
    M.Hulot Moving pictures startet nur im hintergrund und falscher version Allgemeines Supportforum 5
    T Neuinstalation - Moving Pictures probleme Installationsprobleme? 19
    S Problem wit .ISO files in Moving Pictures Moving Pictures 3
    olli14 Inhalt der Moving Pictures Datenbank in die Plex Datenbank kopieren MediaPortal Café 69
    T Moving Pictures Icon disappeared...and the program....??? Watch / Listen Media 1
    T Moving Pictures error after update to 1.19 Final...logs included! Watch / Listen Media 6
    J [solved] Moving Pictures vs. родной граббер, кинопоиск Помощь по MediaPortal 21
    R [solved] Files moved to new location - Easy way to update database? My TVSeries 7
    R Files moved to different location - Easy way to update database? Moving Pictures 2
    ge2301 [Finished] [MP2-782] Show mouse cursor only if it was moved more than 10 pixels MediaPortal 2 13
    O Want to move 21:9 video down to the screen bottom Watch / Listen Media 1
    horned_reaper [solved] Mixed artist pictures Fanart Handler 397
    F Picture on folder Feature Requests 9
    emphatic Pictures in the cloud - would a plugin be possible for services like Google Photos MediaPortal 1 Plugins 1
    A Video clips do not work in the Pictures folder General Support 10
    N [Finished] [MP2-789] MCE remote control Recorded TV and My Pictures buttons do not work MediaPortal 2 17
    Cowboy Playback Problem with CTD or sometimes BSOD watch/edit Videos 0
    Similar threads

























    Top Bottom