コード例 #1
0
 public SongQueryParams()
 {
     Common = new CommonSearchParams();
     IgnoredIds = new int[] {};
     Paging = new PagingProperties(0, 30, true);
     SongTypes = new SongType[] {};
 }
コード例 #2
0
		public ArtistQueryParams() {

			Common = new CommonSearchParams();
			Paging = new PagingProperties(0, 30, true);
			ArtistTypes = new ArtistType[] { };

		}
コード例 #3
0
		public AlbumQueryParams() {

			AlbumType = DiscType.Unknown;
			ArtistParticipationStatus = ArtistAlbumParticipationStatus.Everything;
			Common = new CommonSearchParams();
			Paging = new PagingProperties(0, 30, true);

		}
コード例 #4
0
        public AlbumQueryParams(string query, DiscType discType, int start, int maxResults, bool draftsOnly, bool getTotalCount,
            NameMatchMode nameMatchMode = NameMatchMode.Auto, AlbumSortRule sortRule = AlbumSortRule.Name, bool moveExactToTop = false)
        {
            Common = new CommonSearchParams(query, draftsOnly, nameMatchMode, false, moveExactToTop);
            Paging = new PagingProperties(start, maxResults, getTotalCount);

            AlbumType = discType;
            SortRule = sortRule;
        }
コード例 #5
0
        /// <param name="query">Query search string. Can be null or empty, in which case no filtering by name is done.</param>
        /// <param name="songTypes">Allowed song types. Can be null or empy, in which case no filtering by song type is done.</param>
        /// <param name="start">0-based order number of the first item to be returned.</param>
        /// <param name="maxResults">Maximum number of results to be returned.</param>
        /// <param name="draftsOnly">Whether to return only entries with a draft status.</param>
        /// <param name="getTotalCount">Whether to return the total number of entries matching the criteria.</param>
        /// <param name="nameMatchMode">Mode for name maching. Ignored when query string is null or empty.</param>
        /// <param name="sortRule">Sort rule for results.</param>
        /// <param name="moveExactToTop">Whether to move exact match to the top of search results.</param>
        public ArtistQueryParams(string query, ArtistType[] songTypes, int start, int maxResults,
            bool draftsOnly, bool getTotalCount, NameMatchMode nameMatchMode, ArtistSortRule sortRule, bool moveExactToTop)
        {
            Common = new CommonSearchParams(query, draftsOnly, nameMatchMode, true, moveExactToTop);
            Paging = new PagingProperties(start, maxResults, getTotalCount);

            ArtistTypes = songTypes ?? new ArtistType[] { };
            SortRule = sortRule;
        }
コード例 #6
0
		public SongQueryParams() {

			ArtistParticipationStatus = ArtistAlbumParticipationStatus.Everything;
			Common = new CommonSearchParams();
			IgnoredIds = new int[] {};
			Paging = new PagingProperties(0, 30, true);
			SongTypes = new SongType[] {};

		}
コード例 #7
0
        public AlbumCollectionQueryParams(int userId, PagingProperties paging)
        {
            ParamIs.NotNull(() => paging);

            Paging = paging;
            UserId = userId;

            FilterByStatus = PurchaseStatus.Nothing;
        }
コード例 #8
0
        public RatedSongQueryParams(int userId, PagingProperties paging)
        {
            ParamIs.NotNull(() => paging);

            Paging = paging;
            UserId = userId;

            FilterByRating = SongVoteRating.Nothing;
            GroupByRating = true;
            SortRule = SongSortRule.Name;
        }
コード例 #9
0
		public AlbumCollectionQueryParams(int userId, PagingProperties paging) {

			ParamIs.NotNull(() => paging);

			Paging = paging;
			UserId = userId;

			FilterByStatus = null;
			NameMatchMode = NameMatchMode.Auto;
			Query = string.Empty;
			Sort = AlbumSortRule.Name;

		}
コード例 #10
0
        /// <param name="query">Query search string. Can be null or empty, in which case no filtering by name is done.</param>
        /// <param name="songTypes">Allowed song types. Can be null or empy, in which case no filtering by song type is done.</param>
        /// <param name="start">0-based order number of the first item to be returned.</param>
        /// <param name="maxResults">Maximum number of results to be returned.</param>
        /// <param name="draftsOnly">Whether to return only entries with a draft status.</param>
        /// <param name="getTotalCount">Whether to return the total number of entries matching the criteria.</param>
        /// <param name="nameMatchMode">Mode for name maching. Ignored when query string is null or empty.</param>
        /// <param name="sortRule">Sort rule for results.</param>
        /// <param name="onlyByName">Whether to search items only by name, and not for example NicoId. Ignored when query string is null or empty.</param>
        /// <param name="moveExactToTop">Whether to move exact match to the top of search results.</param>
        /// <param name="ignoredIds">List of entries to be ignored. Can be null in which case no filtering is done.</param>
        public SongQueryParams(string query, SongType[] songTypes, int start, int maxResults,
            bool draftsOnly, bool getTotalCount, NameMatchMode nameMatchMode, SongSortRule sortRule,
            bool onlyByName, bool moveExactToTop, int[] ignoredIds)
        {
            Common = new CommonSearchParams(query, draftsOnly, nameMatchMode, onlyByName, moveExactToTop);
            Paging = new PagingProperties(start, maxResults, getTotalCount);

            SongTypes = songTypes;
            SortRule = sortRule;
            IgnoredIds = ignoredIds;
            TimeFilter = TimeSpan.Zero;
            OnlyWithPVs = false;
        }
コード例 #11
0
        public PartialFindResult<TagForApiContract> GetList(
            string query = "",
            bool allowAliases = false,
            string categoryName = "",
            int start = 0, int maxResults = defaultMax, bool getTotalCount = false,
            NameMatchMode nameMatchMode = NameMatchMode.Exact,
            TagOptionalFields fields = TagOptionalFields.None)
        {
            maxResults = Math.Min(maxResults, absoluteMax);
            var ssl = WebHelper.IsSSL(Request);
            var queryParams = new CommonSearchParams(query, false, nameMatchMode, false, false);
            var paging = new PagingProperties(start, maxResults, getTotalCount);

            var tags = queries.Find(t => new TagForApiContract(t, thumbPersister, ssl, fields),
                queryParams, paging,
                allowAliases, categoryName);

            return tags;
        }
コード例 #12
0
        public PartialFindResult<ActivityEntryContract> GetActivityEntries(PagingProperties paging)
        {
            ParamIs.NotNull(() => paging);

            return HandleQuery(session => {

                var entries = session.Query<ActivityEntry>()
                    .OrderByDescending(a => a.CreateDate)
                    .Skip(paging.Start)
                    .Take(paging.MaxEntries)
                    .ToArray();

                var contracts = entries
                    .Where(e => !e.EntryBase.Deleted)
                    .Select(e => new ActivityEntryContract(e, PermissionContext.LanguagePreference))
                    .ToArray();

                var count = (paging.GetTotalCount ? session.Query<ActivityEntry>().Count() : 0);

                return new PartialFindResult<ActivityEntryContract>(contracts, count);

            });
        }
コード例 #13
0
        public PartialFindResult<CommentForApiContract> GetProfileComments(
            int userId,
            int start = 0, int maxResults = defaultMax, bool getTotalCount = false
            )
        {
            var paging = new PagingProperties(start, maxResults, getTotalCount);
            var result = queries.GetProfileComments(userId, paging);

            return result;
        }
コード例 #14
0
 public AlbumQueryParams()
 {
     AlbumType = DiscType.Unknown;
     Common = new CommonSearchParams();
     Paging = new PagingProperties(0, 30, true);
 }
コード例 #15
0
		public MikuDbAlbumContract[] GetAlbums(string title, AlbumStatus status, PagingProperties paging) {

			return HandleQuery(session => session
				.Query<MikuDbAlbum>()
				.Where(a => (string.IsNullOrEmpty(title) || a.Title.Contains(title)) && a.Status == status)
				.OrderByDescending(a => a.Created)
				.Skip(paging.Start)
				.Take(paging.MaxEntries)
				.ToArray()
				.Select(a => new MikuDbAlbumContract(a))
				.ToArray());

		}
コード例 #16
0
		private PartialFindResult<UserContract> CallGetUsers(UserGroupId groupId = UserGroupId.Nothing, string name = null, bool disabled = false, bool verifiedArtists = false, UserSortRule sortRule = UserSortRule.Name, PagingProperties paging = null) {
			return data.GetUsers(groupId, name, disabled, verifiedArtists, sortRule, paging ?? new PagingProperties(0, 10, true));
		}