public void GetSongsInList_ByName() { var list = _repository.Save(new SongList("Mikulist", _userWithSongList)); _repository.Save(list.AddSong(_song1)); _repository.Save(list.AddSong(_song2)); var result = _queries.GetSongsInList(new SongInListQueryParams { ListId = list.Id, TextQuery = SearchTextQuery.Create("Diva") }); result.Items.Length.Should().Be(1); result.Items[0].Song.Name.Should().Be(_song1.DefaultName); }
public void GetSongsInList_ByName() { var list = repository.Save(new SongList("Mikulist", userWithSongList)); repository.Save(list.AddSong(song1)); repository.Save(list.AddSong(song2)); var result = queries.GetSongsInList(new SongInListQueryParams { ListId = list.Id, TextQuery = SearchTextQuery.Create("Diva") }); Assert.AreEqual(1, result.Items.Length); Assert.AreEqual(song1.DefaultName, result.Items[0].Song.Name); }
public PartialFindResult <SongInListForApiContract> GetSongs(int listId, string query = "", string songTypes = null, PVServices?pvServices = null, [FromQuery(Name = "tagId[]")] int[] tagId = null, [FromQuery(Name = "artistId[]")] int[] artistId = null, bool childVoicebanks = false, [FromQuery(Name = "advancedFilters")] AdvancedSearchFilterParams[] advancedFilters = null, int start = 0, int maxResults = DefaultMax, bool getTotalCount = false, SongSortRule?sort = null, NameMatchMode nameMatchMode = NameMatchMode.Auto, SongOptionalFields fields = SongOptionalFields.None, ContentLanguagePreference lang = ContentLanguagePreference.Default) { maxResults = Math.Min(maxResults, AbsoluteMax); var types = EnumVal <SongType> .ParseMultiple(songTypes); return(_queries.GetSongsInList( new SongInListQueryParams { TextQuery = SearchTextQuery.Create(query, nameMatchMode), ListId = listId, Paging = new PagingProperties(start, maxResults, getTotalCount), PVServices = pvServices, ArtistIds = artistId, ChildVoicebanks = childVoicebanks, TagIds = tagId, SortRule = sort, AdvancedFilters = advancedFilters?.Select(advancedFilter => advancedFilter.ToAdvancedSearchFilter()).ToArray(), SongTypes = types, }, songInList => new SongInListForApiContract(songInList, lang, fields))); }
public PartialFindResult <SongInListForApiContract> GetSongs(int listId, [FromUri] PVServices?pvServices = null, int start = 0, int maxResults = defaultMax, bool getTotalCount = false, SongOptionalFields fields = SongOptionalFields.None, ContentLanguagePreference lang = ContentLanguagePreference.Default ) { maxResults = Math.Min(maxResults, absoluteMax); return(queries.GetSongsInList( new SongListQueryParams { ListId = listId, Paging = new PagingProperties(start, maxResults, getTotalCount), PVServices = pvServices }, songInList => new SongInListForApiContract(songInList, lang, fields))); }