internal static WebTVEpisodeDetailed EpisodeDetailed(MediaItem item, Guid?showId = null, Guid?seasonId = null) { WebTVEpisodeBasic episodeBasic = EpisodeBasic(item, showId, seasonId); MediaItemAspect episodeAspect = MediaItemAspect.GetAspect(item.Aspects, EpisodeAspect.Metadata); MediaItemAspect videoAspect = MediaItemAspect.GetAspect(item.Aspects, VideoAspect.Metadata); var writers = videoAspect.GetCollectionAttribute <string>(VideoAspect.ATTR_WRITERS)?.Distinct().ToList() ?? new List <string>(); var directors = videoAspect.GetCollectionAttribute <string>(VideoAspect.ATTR_DIRECTORS)?.Distinct().ToList() ?? new List <string>(); WebTVEpisodeDetailed webTvEpisodeDetailed = new WebTVEpisodeDetailed { EpisodeNumber = episodeBasic.EpisodeNumber, ExternalId = episodeBasic.ExternalId, FirstAired = episodeBasic.FirstAired, IsProtected = episodeBasic.IsProtected, Rating = episodeBasic.Rating, SeasonNumber = episodeBasic.SeasonNumber, ShowId = episodeBasic.ShowId, SeasonId = episodeBasic.SeasonId, Type = episodeBasic.Type, Watched = episodeBasic.Watched, Path = episodeBasic.Path, DateAdded = episodeBasic.DateAdded, Id = episodeBasic.Id, PID = episodeBasic.PID, Title = episodeBasic.Title, Artwork = episodeBasic.Artwork, Show = episodeAspect.GetAttributeValue <string>(EpisodeAspect.ATTR_SERIES_NAME), Summary = videoAspect.GetAttributeValue <string>(VideoAspect.ATTR_STORYPLOT), Writers = writers, Directors = directors }; return(webTvEpisodeDetailed); }
private bool CallFollwitEpisode(WebTVEpisodeDetailed episode, FollwitWatchStatus state) { try { if (episode.ExternalId.Count(x => x.Site == "TVDB") == 0) { Log.Info("Follwit: TVDB id of episode {0} unknown, not sending", episode.Title); return(false); } var fm = new FollwitEpisode() { Username = Configuration["username"], Password = Configuration["passwordHash"], TVDBId = episode.ExternalId.First(x => x.Site == "TVDB").Id }; var ret = FollwitAPI.UpdateEpisodeState(fm, state); if (ret.Response != "success") { Log.Warn("Follwit: failed to update watch status of episode '{0}' ({1})", episode.Title, episode.Id); return(false); } } catch (Exception ex) { Log.Warn("Follwit: failed to update episode watch status", ex); return(false); } return(true); }
public static Task <WebTVEpisodeDetailed> ProcessAsync(IOwinContext context, string id) { MediaItem item = MediaLibraryAccess.GetMediaItemById(context, Guid.Parse(id), DetailedNecessaryMIATypeIds, DetailedOptionalMIATypeIds); if (item == null) { throw new NotFoundException(String.Format("GetTvEpisodeBasicById: No MediaItem found with id: {0}", id)); } WebTVEpisodeDetailed webTvEpisodeDetailed = EpisodeDetailed(item); return(Task.FromResult(webTvEpisodeDetailed)); }
public bool FinishEpisode(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode) { return(CallShowAPI(show, season, episode, TraktWatchStatus.Scrobble, 100)); }
public bool WatchingEpisode(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode, int progress) { return(CallShowAPI(show, season, episode, TraktWatchStatus.Watching, progress)); }
public bool CancelWatchingEpisode(WebTVEpisodeDetailed episode) { Log.Debug("WSD: Canceled episode {0}", episode.Title); return(true); }
public bool FinishEpisode(WebTVEpisodeDetailed episode) { Log.Debug("WSD: Finished episode {0}", episode.Title); return(true); }
public bool CancelWatchingEpisode(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode) { return(CallFollwitEpisode(episode, FollwitWatchStatus.CancelWatching)); }
public bool WatchingEpisode(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode, int progress) { // Follw.it doesn't require to send a status each X minutes or something return(true); }
public bool FinishEpisode(WebTVEpisodeDetailed episode) { return(CallFollwitEpisode(episode, FollwitWatchStatus.Watched)); }
public TVEpisodeViewModel(WebTVEpisodeDetailed episode) { Episode = episode; }
public bool CancelWatchingEpisode(WebTVEpisodeDetailed episode) { return(CallShowAPI(episode, TraktWatchStatus.CancelWatching, null)); }
public bool FinishEpisode(WebTVEpisodeDetailed episode) { return(CallShowAPI(episode, TraktWatchStatus.Scrobble, 100)); }
public bool WatchingEpisode(WebTVEpisodeDetailed episode, int progress) { return(CallShowAPI(episode, TraktWatchStatus.Watching, progress)); }
public bool StartWatchingEpisode(WebTVEpisodeDetailed episode) { return(CallShowAPI(episode, TraktWatchStatus.Watching, 0)); }
public bool CancelWatchingEpisode(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode) { return(CallShowAPI(show, season, episode, TraktWatchStatus.CancelWatching, null)); }
public TVEpisodeViewModel(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode) { Show = show; Season = season; Episode = episode; }
public bool CancelWatchingEpisode(WebTVEpisodeDetailed episode) { return(CallFollwitEpisode(episode, FollwitWatchStatus.CancelWatching)); }
public bool FinishEpisode(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode) { return(CallFollwitEpisode(episode, FollwitWatchStatus.Watched)); }
public bool StartWatchingEpisode(WebTVEpisodeDetailed episode) { Log.Debug("WSD: Start watching episode {0}, season {1}, show {2}", episode.Title, episode.SeasonId, episode.ShowId); return(true); }
public bool WatchingEpisode(WebTVEpisodeDetailed episode, int progress) { Log.Debug("WSD: Watching episode {0} ({1}%)", episode.Title, progress); return(true); }
public bool FinishEpisode(WebTVShowDetailed show, WebTVSeasonDetailed season, WebTVEpisodeDetailed episode) { Log.Debug("WSD: Finished episode {0}", episode.Title); return(true); }