private IList <MovieCollected> CachedCollectedMovies() { IEnumerable <ITraktCollectionMovie> collectedMovies = new List <ITraktCollectionMovie>(); string collectedMoviesPath = Path.Combine(_mediaPortalServices.GetTraktUserHomePath(), FileName.CollectedMovies.Value); if (_fileOperations.FileExists(collectedMoviesPath)) { string collectedMoviesJson = _fileOperations.FileReadAllText(collectedMoviesPath); collectedMovies = TraktSerializationService.DeserializeCollectionAsync <ITraktCollectionMovie>(collectedMoviesJson).Result; } return(ConvertCollectionMoviesToMovieCollections(collectedMovies)); }
private IEnumerable <EpisodeWatched> GetWatchedEpisodesFromCache() { IEnumerable <ITraktWatchedShow> traktWatchedShows = new List <ITraktWatchedShow>(); string watchedEpisodesPath = Path.Combine(_mediaPortalServices.GetTraktUserHomePath(), FileName.WatchedEpisodes.Value); if (_fileOperations.FileExists(watchedEpisodesPath)) { string watchedEpisodesJson = _fileOperations.FileReadAllText(watchedEpisodesPath); traktWatchedShows = TraktSerializationService.DeserializeCollectionAsync <ITraktWatchedShow>(watchedEpisodesJson).Result; } return(ConvertWatchedShowsToWatchedEpisodes(traktWatchedShows)); }