Suggested Fix - Count viewed if using external viewer (1 Viewer)

BakerQ

Portal Member
September 29, 2007
14
0
Home Country
United States of America United States of America
MyTVSeries has support for determining when a show is watched by if a certain percentage of it has been viewed, which I think is really clever.

Unfortunately, my installation of MP has issues with Windows Media Player, so I'm set up to use Media Player Classic for all videos. Using an external video player means that MyTVSeries has no idea how much of the episode I've seen. Seems like it'd be a small modification to set it so that if MP is set to use an External Video Player, then it should count the episode as watched if it is launched.

From a complete point of view, you might even want to take it so far as to say:

If an Episode is launched using the External Video Player
(and the Percentage Watched Option is more than 0%)
Count an episode as "Watched".


(the second step just appeals to the completionist in me... maybe someone would want to disable that option)
 

BakerQ

Portal Member
September 29, 2007
14
0
Home Country
United States of America United States of America
If necessary, I'd be happy to start sloshing through the source files myself - but where would I submit the changes?

(Yeah, I'd rather ask a question than just post *bump*.)
 

Inker

Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Well, the plugin just hands the file off to MP for playback, MP then selects wether or not to use an external player. I'm sure there is some way to figure out if it was played internally or not, but I haven't bothered figuring it out. If you have a patch for it then feel free to pm me and I'll let you know where you can send your changes.
     

    BakerQ

    Portal Member
    September 29, 2007
    14
    0
    Home Country
    United States of America United States of America
    I haven't been able to get a compilable setup of MP and TVSeries, so hacking around at the code, I think something like this will work in the VideoHandler.cs file:

    Code:
    using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
    {
        if (bool bExternalMoviePlayer = xmlreader.GetValueAsBool("movieplayer", "internal", true)) 
        {
            m_currentEpisode[DBOnlineEpisode.cWatched] = 1;
        }
    
    }

    That would need to be placed in both the OnPlayBackStopped() and OnPlayBackEnded() functions. Again, I have no idea if this would compile, I grabbed the "using" statement from the MP source to determine if the "movieplayer"->"internal" variable is set. It's quite likely that MP already has a method available to all plugins to determine the settings for MP itself.

    This code (rudimentary as it is) really only flags an episode as watched if it is viewed in an external player. Like I said, in a perfect world it would check to see what the cWatched user setting is and use that as a baseline. "If the cWatched is greater than 0%, autoflag the episode as watched". This way if someone didn't want it flagging it as watched autmagically (if they only opened it for a couple seconds, for example) they could set the value to 0 and disable this.

    Does your function actually measure the amount of time watched, or does it pull the result from MP? I was thinking that if a timer was set up to start counting the time that a movie is started compared to the time it ended, it could deduce for itself if the video had been played for five or twenty minutes. Of course, that doesn't take into account the possibility that someone started watching a video, paused it and came back three hours later. (The result of watching 180 minutes of a 24 minute episode is funny.)
     

    Users who are viewing this thread

    Top Bottom