Пример #1
0
    private void CreateScrobbleData(IPlayerSlotController psc)
    {
      IPlayerContext pc = PlayerContext.GetPlayerContext(psc);
      if (pc == null || pc.CurrentMediaItem == null)
        return;
      IMediaPlaybackControl pmc = pc.CurrentPlayer as IMediaPlaybackControl;
      if (pmc == null)
        return;

      var mediaItem = pc.CurrentMediaItem;

      _duration = pmc.Duration;
      bool isMovie = mediaItem.Aspects.ContainsKey(MovieAspect.ASPECT_ID);
      bool isSeries = mediaItem.Aspects.ContainsKey(SeriesAspect.ASPECT_ID);

      if (isMovie)
        _dataMovie = CreateMovieData(mediaItem);

      if (isSeries)
        _dataEpisode = CreateEpisodeData(mediaItem);
    }
Пример #2
0
 private TraktScrobbleMovie CreateMovieData(MediaItem mediaItem)
 {
   var movieScrobbleData = new TraktScrobbleMovie
   {
     Movie = new TraktMovie
     {
       Ids = new TraktMovieId { Imdb = GetMovieImdb(mediaItem), Tmdb = GetMovieTmdb(mediaItem) },
       Title = GetMovieTitle(mediaItem),
       Year = GetVideoYear(mediaItem)
     },
     AppDate = DateTime.Now.ToString(CultureInfo.InvariantCulture),
     AppVersion = APP_VERSION
   };
   return movieScrobbleData;
 }
Пример #3
0
 public static TraktScrobbleResponse StopMovieScrobble(TraktScrobbleMovie movie)
 {
   var response = TraktWeb.PostToTrakt(TraktURIs.ScrobbleStop, movie.ToJSON());
   return response.FromJSON<TraktScrobbleResponse>();
 }