/// <summary>
        /// Gets the tv shows.
        /// </summary>
        /// <param name="sort">The sort.</param>
        /// <param name="userCallback">The user callback.</param>
        public void GetTvShows(SortParams sort, XDataReceived userCallback)
        {
            var args = new JObject {new JProperty(mPropType, Types.Video.Fields.TVShow.Get())};

            if (sort != null)
                args.Add(sort.ToJObject().Children());

            mClient.GetData(SetMethod(VideoLibrary.GetTVShows), args, VideoLibraryCallbackManager, userCallback);
        }
Beispiel #2
0
        private void listBoxAudioLibraryMain_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!isAudioLibraryUpdateOccuring)
            {
                try
                {
                    ListBox volatileSender = (ListBox)sender;

                    switch (audioLibraryMode)
                    {
                        case AudioLibraryMode.Albums:
                            Album selectedAlbum = (Album)volatileSender.SelectedItem;

                            if (selectedAlbum != null)
                            {
                                pictureBoxAudioThumbnail.Image = selectedAlbum.ThumbnailImage;
                                pictureBoxAudioFanart.Image = selectedAlbum.FanartImage;

                                connection.AudioLibrary.GetAlbumDetails(selectedAlbum.albumid, GetAlbumDetailsCallback);
                                connection.AudioLibrary.GetSongsByAlbum(selectedAlbum.albumid, null, GetAlbumCallback, null);
                            }
                            break;

                        case AudioLibraryMode.Artists:
                            Artist selectedArtist = (Artist)volatileSender.SelectedItem;
                            if (selectedArtist != null)
                            {
                                pictureBoxAudioThumbnail.Image = selectedArtist.ThumbnailImage;
                                pictureBoxAudioFanart.Image = selectedArtist.FanartImage;

                                connection.AudioLibrary.GetSongsByArtist(selectedArtist.artistid, null, GetArtistCallback);
                                connection.AudioLibrary.GetArtistDetails(selectedArtist.artistid, GetArtistDetailsCallback);

                            }
                            break;
                        case AudioLibraryMode.Genres:
                            Genre selectedGenre = (Genre)volatileSender.SelectedItem;
                            if (selectedGenre != null)
                            {
                                SortParams artistsSort = new SortParams("title", "ascending");
                                connection.AudioLibrary.GetSongsByGenre(selectedGenre.genreid, artistsSort, GetGenreCallback);
                            }
                            break;
                    }

                }
                catch (Exception) { }

            }
        }
        /// <summary>
        /// Gets the seasons.
        /// </summary>
        /// <param name="tvShowId">The tv show id.</param>
        /// <param name="sort">The sort.</param>
        /// <param name="userCallback">The user callback.</param>
        public void GetSeasons(int tvShowId, SortParams sort, XDataReceived userCallback)
        {
            var args = new JObject { new JProperty("tvshowid", tvShowId), new JProperty(mPropType, Types.Video.Fields.Season.Get()) };

            if (sort != null)
                args.Add(sort.ToJObject().Children());

            mClient.GetData(SetMethod(VideoLibrary.GetSeasons), args, VideoLibraryCallbackManager, userCallback);
        }
Beispiel #4
0
        private void getArtistsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            audioLibraryMode = AudioLibraryMode.Artists;

            SortParams artistsSort = new SortParams("artist", "ascending");
            connection.AudioLibrary.GetArtists(artistsSort, GetArtistsCallback);
        }
        /// <summary>
        /// Gets the songs by genre.
        /// </summary>
        /// <param name="genreId">The genre id.</param>
        /// <param name="sort">The sort.</param>
        /// <param name="userCallback">The user callback.</param>
        public void GetSongsByGenre(int genreId, SortParams sort, XDataReceived userCallback)
        {
            var args = new JObject { new JProperty("genreid",genreId), new JProperty(_propType, Types.Audio.Fields.Song.Get()) };

            if (sort != null)
                args.Add(sort.ToJObject().Children());

            mClient.GetData("AudioLibrary.GetSongs", args, GetSongsCallback, userCallback);
        }
        /// <summary>
        /// Gets the songs by album.
        /// </summary>
        /// <param name="albumId">The album id.</param>
        /// <param name="sort">The sort.</param>
        /// <param name="userCallback">The user callback.</param>
        /// <param name="actionCallback">The action callback.</param>
        public void GetSongsByAlbum(int albumId, SortParams sort, XDataReceived userCallback, Action<List<Song>> actionCallback)
        {
            var args = new JObject { new JProperty("albumid", albumId), new JProperty(_propType, Types.Audio.Fields.Song.Get()) };

            if (sort != null)
                args.Add(sort.ToJObject().Children());

            mClient.GetData("AudioLibrary.GetSongs", args, GetSongsCallback, userCallback);
        }
        /// <summary>
        /// Gets the recently added albums.
        /// </summary>
        /// <param name="sort">The sort.</param>
        /// <param name="userCallback">The user callback.</param>
        public void GetRecentlyAddedAlbums(SortParams sort, XDataReceived userCallback)
        {
            var args = new JObject { new JProperty(_propType, Types.Audio.Fields.Album.Get()) };

            if (sort != null)
                args.Add(sort.ToJObject().Children());

            mClient.GetData("AudioLibrary.GetRecentlyAddedAlbums", args, GetAlbumsCallback, userCallback);
        }
        /// <summary>
        /// Gets the artists.
        /// </summary>
        /// <param name="sort">The sort.</param>
        /// <param name="userCallback">The user callback.</param>
        public void GetArtists(SortParams sort, XDataReceived userCallback)
        {
            var args = new JObject();

            args.Add(new JProperty(_propType, Types.Audio.Fields.Artist.Get()));

            if (sort != null)
                args.Add(sort.ToJObject().Children());

            mClient.GetData("AudioLibrary.GetArtists", args, GetArtistsCallback, userCallback);
        }