public NowPlayingSheet() { InitializeComponent(); _lyrcis = new LyricsService(); CurrentQueueView.Loaded += CurrentQueueViewOnLoaded; App.Locator.AudioPlayerHelper.TrackChanged += AudioPlayerHelperOnTrackChanged; }
public async Task GetDoubanLyricsTest() { var lyricsService = new LyricsService(); var song = new Song { SID = "1675427", SSID = "63fe" }; var lyrics = await lyricsService.GetLyrics(song.SID, song.SSID); Assert.IsNotNull(lyrics); }
public static Media ChangeLyrics(Media media) { _lastUsedService = _lastUsedService ?? OptionsViewModel.Instance.Services.FirstOrDefault(s => s.IsEnabled); if (_lastUsedService == null) { return(media); } var lastIdx = OptionsViewModel.Instance.Services.IndexOf(_lastUsedService); var ouroborosList = OptionsViewModel.Instance.Services.Cycle(lastIdx + 1); return(LoadLyrics(media, ouroborosList)); }
public void OrderDown(LyricsService service) { if (!service.CanOrderDown) { return; } var swapWith = Services.First(s => s.Order == (service.Order + 1)); service.Order++; swapWith.Order--; Services = Services.OrderBy(s => s.Order).ToList(); }
public async Task LyricsGetAsync(string artist, string title, params string[] keywords) { using (var service = new LyricsService(new LyricsOptions())) { var lyrics = await service.GetLyricsAsync(artist, title); foreach (var keyword in keywords) { Assert.Contains(keyword, lyrics, StringComparison.InvariantCultureIgnoreCase); } } }
public async Task LyricServiceTest() { var artistName = "Queen"; var songTitle = "Radio Gaga"; var client = new RestClient("https://api.lyrics.ovh"); var musicBrainzService = new LyricsService(client, new NullLogger <LyricsService>()); string lyrics = await musicBrainzService.GetLyricsAsync(artistName, songTitle); Assert.True(!string.IsNullOrEmpty(lyrics)); Assert.StartsWith("I'd sit alone and watch your light", lyrics); }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { LyricsService obj = item as LyricsService; if (obj is GeniusService) { return(Application.Current.FindResource("OptionsGeniusDataTemplate") as DataTemplate); } else if (obj is MusixMatchService) { return(Application.Current.FindResource("OptionsMusixMatchTemplate") as DataTemplate); } return(Application.Current.FindResource("OptionsDefaultDataTemplate") as DataTemplate); }
private static Media LoadLyrics(Media media, IEnumerable <LyricsService> services) { foreach (var service in services) { _lastUsedService = service; try { media = service.GetLyrics(media); break; } catch (LyricsNotFoundException ex) { Log.Error(ex); continue; } catch (ServiceNotAvailableException ex) { Log.Error(ex); continue; } catch (Exception ex) when(LogEx(ex)) { } } return(media); }
public LyricsController(LyricsService LyricsService, AccountService accountService) { this.lyricsService = LyricsService; this.accountService = accountService; title = "Say What?! - The worlds weirdest lyrics ranked"; }
public LyricsController(LyricsService lyricsService) { _lyricsService = lyricsService; }