Beispiel #1
0
        public Setlists VenueSetlists(string venueId, int page = 1)
        {
            string   url           = string.Format("/venue/{0}/setlists?p={1}", venueId, page);
            Setlists venueSetlists = Load <Setlists>(url);

            return(venueSetlists);
        }
Beispiel #2
0
        /// <summary>
        /// Get a list of setlists of concerts edited by a user.
        /// <para>The list contains the current version, not the version edited.</para>
        /// </summary>
        /// <param name="userId">The user's userId.</param>
        /// <param name="page">Page number to fetch.</param>
        /// <returns>A list of setlists.</returns>
        public Setlists UserEdited(string userId, int page = 1)
        {
            string   url    = string.Format("/user/{0}/edited?p={1}", userId, page);
            Setlists edited = Load <Setlists>(url);

            return(edited);
        }
Beispiel #3
0
        /// <summary>
        /// Get a list of setlists of concerts attended by a user.
        /// </summary>
        /// <param name="userId">A user's userId.</param>
        /// <param name="page">Page number to fetch.</param>
        /// <returns>A list of setlists.</returns>
        public Setlists UserAttended(string userId, int page = 1)
        {
            string   url      = string.Format("/user/{0}/attended?p={1}", userId, page);
            Setlists attended = Load <Setlists>(url);

            return(attended);
        }
Beispiel #4
0
        public Setlists ArtistSetlists(string mbid, int page = 1)
        {
            string   url            = string.Format("/artist/{0}/setlists?p={1}", mbid, page);
            Setlists artistSetlists = Load <Setlists>(url);

            return(artistSetlists);
        }
Beispiel #5
0
        public Setlists Search(Setlist s)
        {
            Setlists result = sa.SearchSetlists(s);
            Setlists newResult;

            for (int i = 1; i < result.TotalPages; i++)
            {
                newResult = sa.SearchSetlists(s, i);
                foreach (Setlist j in newResult)
                {
                    result.Add(j);
                }
            }

            return(result);
        }
Beispiel #6
0
        /// <summary>
        /// Search for setlists.
        /// </summary>
        /// <param name="searchFields">
        /// You must provide a value for at least one of the following properties:
        /// <para>Tour, LastUpdated, EventDate (you could set only a year, e.g. <code>00-00-2007</code>),</para>
        /// <para>Artist.Name, Artist.MBID, Artist.TMID (set <code>TMIDSpecified = true</code>)</para>
        /// <para>Venue.Id, Venue.Name, Venue.City.Id, Venue.City.Name. Venue.City.State, Venue.City.State.Code, Venue.City.Country.Code</para>
        /// </param>
        /// <param name="page">Page number to fetch.</param>
        /// <returns>A list of matching setlists.</returns>
        public Setlists SearchSetlists(Setlist searchFields, int page = 1)
        {
            StringBuilder query = new StringBuilder();

            if (searchFields != null)
            {
                if (!string.IsNullOrEmpty(searchFields.TourName))
                {
                    query.AppendFormat("tour={0}&", searchFields.Tour);
                }
                if (!string.IsNullOrEmpty(searchFields.LastUpdated))
                {
                    query.AppendFormat("lastUpdate={0}&", searchFields.LastUpdated);
                }
                if (!string.IsNullOrEmpty(searchFields.EventDate))
                {
                    if (searchFields.GetEventDateTime() != null)
                    {
                        query.AppendFormat("date={0}&", searchFields.EventDate);
                    }
                    else
                    if (searchFields.GetYear() != 0)
                    {
                        query.AppendFormat("year={0}&", searchFields.GetYear());
                    }
                }

                if (searchFields.Artist != null)
                {
                    if (!string.IsNullOrEmpty(searchFields.Artist.MBID))
                    {
                        query.AppendFormat("artistMbid={0}&", searchFields.Artist.MBID);
                    }
                    if (searchFields.Artist.TMIDSpecified)
                    {
                        query.AppendFormat("artistTmid={0}&", searchFields.Artist.TMID);
                    }
                    if (!string.IsNullOrEmpty(searchFields.Artist.Name))
                    {
                        query.AppendFormat("artistName={0}&", searchFields.Artist.Name);
                    }
                }
                if (searchFields.Venue != null)
                {
                    if (!string.IsNullOrEmpty(searchFields.Venue.Id))
                    {
                        query.AppendFormat("venueId={0}&", searchFields.Venue.Id);
                    }
                    if (!string.IsNullOrEmpty(searchFields.Venue.Name))
                    {
                        query.AppendFormat("venueName={0}&", searchFields.Venue.Name);
                    }

                    if (searchFields.Venue.City != null)
                    {
                        if (searchFields.Venue.City.Id != "0" && searchFields.Venue.City.Id != "")
                        {
                            query.AppendFormat("cityId={0}&", searchFields.Venue.City.Id);
                        }
                        if (!string.IsNullOrEmpty(searchFields.Venue.City.Name))
                        {
                            query.AppendFormat("cityName={0}&", searchFields.Venue.City.Name);
                        }
                        if (!string.IsNullOrEmpty(searchFields.Venue.City.State))
                        {
                            query.AppendFormat("state={0}&", searchFields.Venue.City.State);
                        }
                        if (!string.IsNullOrEmpty(searchFields.Venue.City.StateCode))
                        {
                            query.AppendFormat("stateCode={0}&", searchFields.Venue.City.StateCode);
                        }

                        if (searchFields.Venue.City.Country != null)
                        {
                            if (!string.IsNullOrEmpty(searchFields.Venue.City.Country.Code))
                            {
                                query.AppendFormat("countryCode={0}&", searchFields.Venue.City.Country.Code);
                            }
                        }
                    }
                }
            }

            string   url      = string.Format("/search/setlists?{0}p={1}", query.ToString(), page.ToString());
            Setlists setlists = Load <Setlists>(url);

            return(setlists);
        }