Example #1
0
        private ISet <MediaInstance> GetFilteredMedia(SearchMediaData searchMedia, DbSet <MediaInstance> mediaInstances)
        {
            var timeRangeFilter = new TimeRangeFilter(searchMedia.TimeRangeStart, searchMedia.TimeRangeEnd);
            var filteredMedia   = timeRangeFilter.Filter(mediaInstances.ToList().AsReadOnly())
                                  .ToHashSet();

            return(filteredMedia);
        }
Example #2
0
        private IFilter <MediaInstance> ConstructFilter(SearchMediaData searchMediaData, IGraph <Tag> tagGraph)
        {
            var tagFilter          = new TagFilter(searchMediaData.IncludedTags, searchMediaData.ExcludedTags, tagGraph);
            var timeRangeFilter    = new TimeRangeFilter(searchMediaData.TimeRangeStart, searchMediaData.TimeRangeEnd);
            var privateMediaFilter = new PrivateMediaFilter(searchMediaData.UserId);
            var filterChain        = new FilterChain <MediaInstance>(tagFilter, timeRangeFilter, privateMediaFilter);

            return(filterChain);
        }
        public override int GetHashCode()
        {
            unchecked
            {
                int result = AnteFilter != null?AnteFilter.GetHashCode() : 0;

                result = (result * 397) ^ (BigBlindFilter != null ? BigBlindFilter.GetHashCode() : 0);
                result = (result * 397) ^ (MFilter != null ? MFilter.GetHashCode() : 0);
                result = (result * 397) ^ (PlayersInFlopFilter != null ? PlayersInFlopFilter.GetHashCode() : 0);
                result = (result * 397) ^ (StrategicPositionFilter != null ? StrategicPositionFilter.GetHashCode() : 0);
                result = (result * 397) ^ (TimeRangeFilter != null ? TimeRangeFilter.GetHashCode() : 0);
                result = (result * 397) ^ (TotalPlayersFilter != null ? TotalPlayersFilter.GetHashCode() : 0);
                return(result);
            }
        }