Ejemplo n.º 1
0
        public async Task GetTrackInformationSearch(string title, string artist, string extraData, int page, ITrackCallback callback)
        {
            PluginTrackSearchResult release = new PluginTrackSearchResult();

            release.Details     = string.Format("{0} v{1}", Name, Version);
            release.Format      = "charts";
            release.Id          = "1";
            release.IsCompleted = false;
            release.Title       = string.Format("Generic: {0} - {1}", artist, title);
            callback.TrackUpdateCallback(release);

            // send a complete message...
            callback.TrackUpdateCallback(new PluginTrackSearchResult()
            {
                IsCompleted = true
            });
        }
Ejemplo n.º 2
0
        private async Task <List <PluginTrackSearchResult> > GetReleases(string album, string artist, string url, int id, SMChartsSettings s)
        {
            int id2 = 0;
            List <PluginTrackSearchResult> results = new List <PluginTrackSearchResult>();
            string web = await LoadWebpage(string.Format("{0}{1}", GetMainUrl(s.CountryIndex), url));

            web = PrepareWebpage(web);
            Regex           AlbumRegex = new Regex(GetReleaseRegex(s.CountryIndex), RegexOptions.Compiled);
            MatchCollection matches    = AlbumRegex.Matches(web);

            foreach (Match match in matches)
            {
                id2++;
                PluginTrackSearchResult result = new PluginTrackSearchResult();
                result.CatalogNumber = GetCatalogNumber(match.Groups["details"].Value);
                result.Format        = GetFormat(match.Groups["details"].Value);
                result.Id            = string.Format("{0}-{1}", id.ToString(), id2.ToString());
                result.Label         = GetLabel(match.Groups["details"].Value);
                result.Title         = string.Format("{0} - {1}", artist, album);
                result.Year          = GetYear(match.Groups["details"].Value);
            }
            return(results);
        }