public PersonVm SearchPerson(string name) { var person = new PersonVm(name); var movieRef = new ItemsSourceReference() { Type = ItemsSourceType.Movie, Filter = ItemsSourceFilter.Cast, Param = name }; person.Movies = GetMovieSource(movieRef); movieRef = new ItemsSourceReference() { Type = ItemsSourceType.Episode, Filter = ItemsSourceFilter.Cast, Param = name }; person.Episodes = GetMovieSource(movieRef); movieRef = new ItemsSourceReference() { Type = ItemsSourceType.TVShow, Filter = ItemsSourceFilter.Cast, Param = name }; person.TVShows = GetMovieSource(movieRef); movieRef = new ItemsSourceReference() { Type = ItemsSourceType.Extern, Filter = ItemsSourceFilter.Cast, Param = name }; person.External = GetMovieSource(movieRef); return(person); }
public IItemsSource SearchShow(string query) { var movieRef = new ItemsSourceReference() { Type = ItemsSourceType.TVShow, Filter = ItemsSourceFilter.Title, Param = query }; return(GetMovieSource(movieRef)); }
public void GotoWatchList() { var movieRef = new ItemsSourceReference() { Type = ItemsSourceType.WatchList, Filter = ItemsSourceFilter.All }; _appContext.View.GotoMovies(movieRef); }
public IItemsSource SearchFullText(string query) { var movieRef = new ItemsSourceReference() { Type = ItemsSourceType.Movie, Filter = ItemsSourceFilter.FullText, Param = query }; return(GetMovieSource(movieRef)); }
public void GoTo(MovieVm clickedItem) { var movieRef = new ItemsSourceReference() { Type = ItemsSourceType.Movie, Filter = ItemsSourceFilter.Id, Param = clickedItem.Id.ToString() }; _appContext.View.GotoMovie(movieRef); }
public bool TryGetLibraryRef(out ItemsSourceReference reference) { if (Type != null && Id > 0) { reference = new ItemsSourceReference(Type.Value, Id); return(true); } reference = null; return(false); }
public override ItemsSourceReference GetStateRepresentationInternal() { var listRef = new ItemsSourceReference() { Type = ItemsSourceType.TVShow, Filter = ItemsSourceFilter.Title, Param = _query }; if (Selected != null) { listRef.Selection = Items.IndexOf(Selected); } return(listRef); }
public override ItemsSourceReference GetStateRepresentationInternal() { var listRef = new ItemsSourceReference() { Type = ItemsSourceType.Episode, Filter = ItemsSourceFilter.Cast, Param = _actor }; if (Selected != null) { listRef.Selection = Items.IndexOf(Selected); } return(listRef); }
public override void GotoDetails() { switch (_baseDetails.type) { case Base_type.movie: var movieRef = new ItemsSourceReference() { Type = ItemsSourceType.Movie, Filter = ItemsSourceFilter.Id, Param = _baseDetails.id.ToString() }; _appContext.View.GotoMovie(movieRef); break; case Base_type.episode: _appContext.View.GotoEpisode(EpisodeVm.GetRef(_baseDetails.tvshowid, _baseDetails.season, _baseDetails.episode) + "n"); break; } }
public async Task GoTo(ItemsSourceReference itemsSourceReference) { switch (itemsSourceReference.Type) { case ItemsSourceType.Episode: var episode = await _appContext.XBMC.VideoLibrary.GetEpisodeDetails(Convert.ToInt32(itemsSourceReference.Param), Episode.AllFields()); var vm = new EpisodeVm(episode.episodedetails, _appContext); vm.GoTo(); break; case ItemsSourceType.Movie: _appContext.View.GotoMovie(itemsSourceReference); break; } }
public IItemsSource GetMovieSource(ItemsSourceReference itemsSourceReference = null) { IItemsSource itemsSource = null; if (itemsSourceReference != null) { ItemsSourceReference current = null; if (_sourcesCache.TryGetValue(itemsSourceReference, out itemsSource)) { current = itemsSource.GetStateRepresentation(); } if (!itemsSourceReference.Equals(current)) { switch (itemsSourceReference.Type) { case ItemsSourceType.Movie: switch (itemsSourceReference.Filter) { case ItemsSourceFilter.All: itemsSource = new AllMovieSource(_appContext); break; case ItemsSourceFilter.Cast: itemsSource = new CastMovieSource(_appContext, itemsSourceReference.Param); break; case ItemsSourceFilter.Id: itemsSource = new IdMovieSource(_appContext, int.Parse(itemsSourceReference.Param)); break; case ItemsSourceFilter.Title: itemsSource = new TitleMovieSource(_appContext, itemsSourceReference.Param); break; case ItemsSourceFilter.FullText: itemsSource = new FullTextMovieSource(_appContext, itemsSourceReference.Param); break; } break; case ItemsSourceType.Episode: switch (itemsSourceReference.Filter) { case ItemsSourceFilter.Cast: itemsSource = new CastEpisodesSource(_appContext, itemsSourceReference.Param); break; } break; case ItemsSourceType.TVShow: switch (itemsSourceReference.Filter) { case ItemsSourceFilter.Title: itemsSource = new TitleTVShowSource(_appContext, itemsSourceReference.Param); break; case ItemsSourceFilter.Cast: itemsSource = new CastTTVShowSource(_appContext, itemsSourceReference.Param); break; case ItemsSourceFilter.All: itemsSource = new TvShowSource(_appContext); break; case ItemsSourceFilter.Id: itemsSource = new TvShowIdSource(_appContext, int.Parse(itemsSourceReference.Param)); break; } break; case ItemsSourceType.WatchList: switch (itemsSourceReference.Filter) { case ItemsSourceFilter.All: itemsSource = new WatchlistMovieSource(_appContext); break; } break; case ItemsSourceType.Season: switch (itemsSourceReference.Filter) { case ItemsSourceFilter.All: itemsSource = new WatchlistMovieSource(_appContext); break; } break; case ItemsSourceType.Extern: switch (itemsSourceReference.Filter) { case ItemsSourceFilter.Cast: itemsSource = new CastTmdbResult(itemsSourceReference.Param); break; case ItemsSourceFilter.Title: itemsSource = new TmdbResult(itemsSourceReference.Param); break; } break; } } _sourcesCache[itemsSourceReference] = itemsSource; current = itemsSource.GetStateRepresentation(); if ((itemsSource.Selected == null || itemsSourceReference.Selection != current.Selection) && itemsSourceReference.Selection >= 0) { itemsSource.RestoreSelection(itemsSourceReference.Selection); } } if (itemsSource == null) { itemsSource = new AllMovieSource(_appContext); } return(itemsSource); }
public void GoTo() { var iRef = new ItemsSourceReference(ItemsSourceType.Movie, Id); _appContext.View.GotoMovie(iRef); }