Exemplo n.º 1
0
        /// <summary>
        ///     Freedb
        /// </summary>
        /// <param name="query">The Searchstring</param>
        /// <param name="artist">artist name</param>
        /// <param name="title">Release name</param>
        /// <param name="discid">FreeDb disc id</param>
        /// <param name="cat">FreeDb category</param>
        /// <param name="year">year</param>
        /// <param name="tracks">number of tracks in the Release</param>
        /// <param name="limit">
        ///     An integer value defining how many entries should be returned. <br />
        ///     Only values between 1 and 100 (both inclusive) are allowed. <br />
        ///     If not given, this defaults to 25.
        /// </param>
        /// <param name="offset">
        ///     Return search results starting at a given offset. <br />
        ///     Used for paging through more than one page of results.
        /// </param>
        /// <returns>List of Freedb</returns>
        public static Freedb Freedb(string query = null, string artist = null, string title = null, string discid = null,
                                    string cat   = null,
                                    string year  = null, string tracks = null, int limit = 25, int offset = 0)
        {
            Logging.Clear();
            var ret = new Freedb();

            var le = new LogEntry("Sites.MusicBrainz", "Search", "");

            le.Parameters.Add(new Para("query", query));
            le.Parameters.Add(new Para("artist", artist));
            le.Parameters.Add(new Para("Title", title));
            le.Parameters.Add(new Para("discid", discid));
            le.Parameters.Add(new Para("cat", cat));
            le.Parameters.Add(new Para("year", year));
            le.Parameters.Add(new Para("tracks", tracks));
            Logging.NewLogEntry(le);

            try
            {
                var search = Help.SearchToString(le.Parameters);

                ret.Data = Help.Find <FreedbMetadata>(search, limit, offset, "freedb").Freedbdisclist ??
                           new FreedbResult();
            }
            catch (Exception ex)
            {
                Exceptions.NewException(ex);
            }

            return(new Freedb(ret.Data));
        }
Exemplo n.º 2
0
		public void FillFromFreedb(Freedb.CDEntry cdEntry, int firstAudio)
		{
			Year = cdEntry.Year;
			Genre = cdEntry.Genre;
			Artist = cdEntry.Artist;
			Title = cdEntry.Title;
            Comment = cdEntry.ExtendedData;
			for (int i = 0; i < Tracks.Count; i++)
			{
				Tracks[i].Title = cdEntry.Tracks[i + firstAudio].Title;
				Tracks[i].Artist = cdEntry.Artist;
				Tracks[i].Comment = cdEntry.ExtendedData;
			}
		}