Inheritance: Document
        public static string GetLastFmSearchQuery(Cd cd)
        {
            if ((cd.ArtistOrComposer != null || cd.MusicGroup != null) && cd.Title != null)
            {
                var trimmedTitle = cd.Title.Split(';').ToList()[0].Trim();

                var searchString = "autocorrect=1&artist=" + cd.ArtistOrGroupName + "&album=" + trimmedTitle;

                return searchString;
            }
            return string.Empty;
        }
Exemple #2
0
        private static string GetExternalCdImageUri(Cd cd, bool isThumbnail)
        {
            // --------------------------- LAST.FM -------------------------
            var searchQuery = LastFmRepository.GetLastFmSearchQuery(cd);

            var lastFmAlbum = LastFmRepository.GetLastFmAlbumFromSeachQuery(searchQuery);

            if (lastFmAlbum != null){
                if (isThumbnail) return lastFmAlbum.SmallImageUrl;
                return lastFmAlbum.LargeImageUrl;
            }
            // --------------------------- END LAST.FM ---------------------

            // Here we can try other sources if available

            return string.Empty;
        }
Exemple #3
0
        public static new Cd GetObjectFromFindDocXmlBsMarcLight(string xml)
        {
            var document = new Cd();

            document.FillPropertiesLight(xml);

            return document;
        }