diff --git a/frontend/src/composables/use-external-sources.ts b/frontend/src/composables/use-external-sources.ts index 301a2e62854..ad29a7beafb 100644 --- a/frontend/src/composables/use-external-sources.ts +++ b/frontend/src/composables/use-external-sources.ts @@ -31,7 +31,7 @@ export const useExternalSources = () => { return IMAGE }) const externalSources = computed(() => { - const query = searchStore.searchQueryParams + const query = searchStore.apiSearchQueryParams const type = externalSourcesType.value return getAdditionalSources(type, query) }) diff --git a/frontend/src/constants/filters.ts b/frontend/src/constants/filters.ts index b413cd6feef..5e002593f2d 100644 --- a/frontend/src/constants/filters.ts +++ b/frontend/src/constants/filters.ts @@ -22,7 +22,6 @@ export interface Filters { sizes: FilterItem[] audioProviders: FilterItem[] imageProviders: FilterItem[] - searchBy: FilterItem[] } export type FilterCategory = keyof Filters @@ -40,7 +39,6 @@ export const mediaFilterKeys = deepFreeze>( "aspectRatios", "sizes", "imageProviders", - "searchBy", ], [AUDIO]: [ "licenseTypes", @@ -49,11 +47,10 @@ export const mediaFilterKeys = deepFreeze>( "audioExtensions", "lengths", "audioProviders", - "searchBy", ], [VIDEO]: [], [MODEL_3D]: [], - [ALL_MEDIA]: ["licenseTypes", "licenses", "searchBy"], + [ALL_MEDIA]: ["licenseTypes", "licenses"], } ) @@ -96,7 +93,6 @@ const filterCodesPerCategory = deepFreeze>({ sizes: ["small", "medium", "large"], audioProviders: [], imageProviders: [], - searchBy: ["creator"], }) /** * Converts the filterCodesPerCategory object into the format that's used by the filter store. diff --git a/frontend/src/data/media-service.ts b/frontend/src/data/media-service.ts index 0fb0b987a26..e6b7b99d740 100644 --- a/frontend/src/data/media-service.ts +++ b/frontend/src/data/media-service.ts @@ -1,5 +1,5 @@ import { decodeMediaData } from "~/utils/decode-media-data" -import type { ApiQueryParams } from "~/utils/search-query-transform" +import type { PaginatedSearchQuery } from "~/types/search" import type { ApiService } from "~/data/api-service" import type { DetailFromMediaType, Media } from "~/types/media" import { AUDIO, type SupportedMediaType } from "~/constants/media" @@ -47,7 +47,7 @@ class MediaService { * @param params - API search query parameters */ async search( - params: ApiQueryParams + params: PaginatedSearchQuery ): Promise>> { // Add the `peaks` param to all audio searches automatically if (this.mediaType === AUDIO) { @@ -88,14 +88,11 @@ class MediaService { `MediaService.getRelatedMedia() id parameter required to retrieve related media.` ) } - const params: ApiQueryParams = {} - if (this.mediaType === AUDIO) { - params.peaks = "true" - } + const params = this.mediaType === AUDIO ? { peaks: "true" } : undefined const res = (await this.apiService.get( this.mediaType, `${id}/related`, - params as unknown as Record + params )) as AxiosResponse[]>> return { ...res.data, diff --git a/frontend/src/pages/search.vue b/frontend/src/pages/search.vue index 7bbde449780..403e97bf7b1 100644 --- a/frontend/src/pages/search.vue +++ b/frontend/src/pages/search.vue @@ -101,7 +101,7 @@ export default defineComponent({ const { searchTerm, searchType, - searchQueryParams: query, + apiSearchQueryParams: query, searchTypeIsSupported: supported, } = storeToRefs(searchStore) diff --git a/frontend/src/stores/media/index.ts b/frontend/src/stores/media/index.ts index 8ae023eee0a..4b43350e5e6 100644 --- a/frontend/src/stores/media/index.ts +++ b/frontend/src/stores/media/index.ts @@ -3,7 +3,6 @@ import { defineStore } from "pinia" import { warn } from "~/utils/console" import { hash, rand as prng } from "~/utils/prng" import { isRetriable, parseFetchingError } from "~/utils/errors" -import prepareSearchQueryParams from "~/utils/prepare-search-query-params" import type { AudioDetail, DetailFromMediaType, @@ -25,6 +24,8 @@ import { isSearchTypeSupported, useSearchStore } from "~/stores/search" import { useRelatedMediaStore } from "~/stores/media/related-media" import { deepFreeze } from "~/utils/deep-freeze" +import { PaginatedSearchQuery } from "~/types/search" + export type MediaStoreResult = { count: number pageCount: number @@ -442,19 +443,13 @@ export const useMediaStore = defineStore("media", { mediaType: SupportedMediaType shouldPersistMedia: boolean }) { - const queryParams = prepareSearchQueryParams({ - ...useSearchStore().searchQueryParams, - }) - let page = 1 - if (shouldPersistMedia) { - /** - * If `shouldPersistMedia` is true, then we increment the page that was set by a previous - * fetch. Normally, if `shouldPersistMedia` is true, `page` should have been set to 1 by the - * previous fetch. - */ - page = this.results[mediaType].page + 1 - queryParams.page = `${page}` + let page = this.results[mediaType].page + 1 + const queryParams: PaginatedSearchQuery = { + ...useSearchStore().apiSearchQueryParams, + // Don't need to set `page` parameter for the first page. + page: shouldPersistMedia ? `${page}` : undefined, } + this._updateFetchState(mediaType, "start") try { const accessToken = this.$nuxt.$openverseApiToken @@ -467,7 +462,7 @@ export const useMediaStore = defineStore("media", { * In such cases, we show the "No results" client error page. */ if (!mediaCount) { - page = 0 + page = 1 errorData = { message: `No results found for ${queryParams.q}`, code: NO_RESULT, diff --git a/frontend/src/stores/search.ts b/frontend/src/stores/search.ts index a8ea14e30d9..b39011189f5 100644 --- a/frontend/src/stores/search.ts +++ b/frontend/src/stores/search.ts @@ -19,10 +19,9 @@ import { searchPath, } from "~/constants/media" import { - ApiQueryParams, filtersToQueryData, queryDictionaryToQueryParams, - queryStringToSearchType, + pathToSearchType, queryToFilterData, } from "~/utils/search-query-transform" import { @@ -39,6 +38,8 @@ import { useProviderStore } from "~/stores/provider" import { useFeatureFlagStore } from "~/stores/feature-flag" import { useMediaStore } from "~/stores/media" +import { SearchQuery, PaginatedSearchQuery } from "~/types/search" + import type { Ref } from "vue" import type { Dictionary } from "vue-router/types/router" @@ -62,45 +63,39 @@ export interface SearchState { /** * Builds the search query parameters for the given search type, filters, and search term. * `q` parameter is always included as the first query parameter. + * If the search type is not supported, only the `q` parameter is included. + * This is used, for instance, for content switcher links for `video`/`model_3d` search pages. * Only the filters that are relevant for the search type and have a value are included. * - * Some parameters are included in the query depending on the mode: - * - `INCLUDE_SENSITIVE_QUERY_PARAM` is added to the API search query if the setting is `on` - * in the featureFlagStore. + * `INCLUDE_SENSITIVE_QUERY_PARAM` is never added to the frontend search query. It is added + * to the API search query if the setting is `on` in the featureFlagStore. */ -function computeQueryParams( +export function computeQueryParams( searchType: SearchType, filters: Filters, searchTerm: string, mode: "frontend" | "API" ) { - // The filters object is converted to a Record object. - // e.g., { licenseTypes: [{ code: "commercial", checked: true }] } - // => { license_type: "commercial" } - const query = { ...filtersToQueryData(filters, searchType) } - + const q = searchTerm.trim() + if (!isSearchTypeSupported(searchType)) { + return { q } + } // Ensure that `q` always comes first in the frontend URL. - const search_query: ApiQueryParams = { q: searchTerm.trim() } - - // Parameters that are included in the query "as is". - const param_names = Object.keys(query).filter( - (key): key is Exclude => - !["q", INCLUDE_SENSITIVE_QUERY_PARAM].includes(key) - ) - - for (const api_param_name of param_names) { - if (query[api_param_name]?.length) { - search_query[api_param_name] = query[api_param_name] - } + const searchQuery: SearchQuery = { + q, + // The filters object is converted to a Record object. + // e.g., { licenseTypes: [{ code: "commercial", checked: true }] } + // => { license_type: "commercial" } + ...filtersToQueryData(filters, searchType), } // `INCLUDE_SENSITIVE_QUERY_PARAM` is used in the API params, but not shown on the frontend. const ffStore = useFeatureFlagStore() if (mode === "API" && ffStore.isOn("fetch_sensitive")) { - search_query[INCLUDE_SENSITIVE_QUERY_PARAM] = "true" + searchQuery[INCLUDE_SENSITIVE_QUERY_PARAM] = "true" } - return search_query + return searchQuery } export const useSearchStore = defineStore("search", { @@ -122,37 +117,17 @@ export const useSearchStore = defineStore("search", { }, /** - * Returns the search query parameters for API request: - * drops all parameters with blank values. + * Returns the search query parameters for API request. + * The main difference between api and frontend query parameters is that + * the API query parameters include the `include_sensitive_results` parameter. */ - searchQueryParams(state) { - if (isSearchTypeSupported(state.searchType)) { - return computeQueryParams( - state.searchType, - state.filters, - state.searchTerm, - "API" - ) - } else { - return { q: state.searchTerm } - } - }, - - /** - * Returns the search query parameters for API request: - * drops all parameters with blank values. - */ - frontendSearchUrlParams(state) { - if (isSearchTypeSupported(state.searchType)) { - return computeQueryParams( - state.searchType, - state.filters, - state.searchTerm, - "frontend" - ) - } else { - return { q: state.searchTerm } - } + apiSearchQueryParams(state) { + return computeQueryParams( + state.searchType, + state.filters, + state.searchTerm, + "API" + ) }, /** @@ -170,16 +145,12 @@ export const useSearchStore = defineStore("search", { /** * Returns the object with filters for selected search type, * with codes, names for i18n labels, and checked status. - * - * Excludes `searchBy` filters that we don't display. */ searchFilters(state) { - return mediaFilterKeys[state.searchType] - .filter((filterKey) => filterKey !== "searchBy") - .reduce((obj, filterKey) => { - obj[filterKey] = this.filters[filterKey] - return obj - }, {} as Filters) + return mediaFilterKeys[state.searchType].reduce((obj, filterKey) => { + obj[filterKey] = this.filters[filterKey] + return obj + }, {} as Filters) }, /** @@ -223,37 +194,32 @@ export const useSearchStore = defineStore("search", { return this.getSearchPath() }, /** - * Returns localized search path for the given search type. + * Returns localized frontend search path for the given search type. * * If search type is not provided, returns the path for the current search type. * If query is not provided, returns current query parameters. + * If only the search type is provided, the query is computed for this search type. */ getSearchPath({ type, query, - }: { type?: SearchType; query?: ApiQueryParams } = {}): string { - const searchType = type || this.searchType - let queryParams - if (!query) { - if (type && isSearchTypeSupported(type)) { - queryParams = computeQueryParams( - type, - this.filters, - this.searchTerm, - "frontend" - ) - } else { - queryParams = this.frontendSearchUrlParams - } - } else { - queryParams = query - } + }: { type?: SearchType; query?: PaginatedSearchQuery } = {}): string { + const searchType = type ?? this.searchType + const queryParams = + query ?? + computeQueryParams( + searchType, + this.filters, + this.searchTerm, + "frontend" + ) return this.$nuxt.localePath({ path: searchPath(searchType), - query: queryParams as Dictionary, + query: queryParams as unknown as Dictionary, }) }, + setSearchType(type: SearchType) { const featureFlagStore = useFeatureFlagStore() if ( @@ -486,7 +452,7 @@ export const useSearchStore = defineStore("search", { }) this.setSearchTerm(query.q) - this.searchType = queryStringToSearchType(path) + this.searchType = pathToSearchType(path) if (!isSearchTypeSupported(this.searchType)) return const newFilterData = queryToFilterData({ @@ -506,9 +472,9 @@ export const useSearchStore = defineStore("search", { isFilterDisabled( item: FilterItem, filterCategory: FilterCategory - ): boolean | undefined { + ): boolean { if (!["licenseTypes", "licenses"].includes(filterCategory)) { - return + return false } if (item.code === "commercial" || item.code === "modification") { const targetCode = { @@ -532,11 +498,5 @@ export const useSearchStore = defineStore("search", { ) } }, - - isFilterChecked(filterCategory: FilterCategory, code: string): boolean { - const filterItems = this.filters[filterCategory] - const idx = filterItems.findIndex((f) => f.code === code) - return idx >= 0 && filterItems[idx].checked - }, }, }) diff --git a/frontend/src/types/search.ts b/frontend/src/types/search.ts index 3a6a096e458..8dc7b92fb17 100644 --- a/frontend/src/types/search.ts +++ b/frontend/src/types/search.ts @@ -1 +1,41 @@ +import { INCLUDE_SENSITIVE_QUERY_PARAM } from "~/constants/content-safety" + export type Collection = "tag" | "creator" | "source" + +/** + * The filter query parameters. + */ +export interface SearchFilterQuery { + license?: string + license_type?: string + extension?: string + size?: string + aspect_ratio?: string + category?: string + source?: string + length?: string + [INCLUDE_SENSITIVE_QUERY_PARAM]?: string + /** + * A conditional to show audio waveform data. + * TODO: We'll need new types that accept a media type to allow media-specific params + */ + peaks?: string +} + +export type SearchFilterKeys = keyof SearchFilterQuery +export type SearchRequestQuery = { q: string } + +interface PaginatedParams { + page?: string +} + +/** + * Query parameters for the search request, includes filters and `q` param. + */ +export type SearchQuery = SearchFilterQuery & SearchRequestQuery +/** + * Query parameters for the search request, includes filters, `q` and `page` params. + */ +export type PaginatedSearchQuery = SearchRequestQuery & + PaginatedParams & + SearchFilterQuery diff --git a/frontend/src/utils/get-additional-sources.ts b/frontend/src/utils/get-additional-sources.ts index 475374ab881..d50bf124073 100644 --- a/frontend/src/utils/get-additional-sources.ts +++ b/frontend/src/utils/get-additional-sources.ts @@ -1,5 +1,5 @@ import type { MediaType } from "~/constants/media" -import type { ApiQueryParams } from "~/utils/search-query-transform" +import type { PaginatedSearchQuery } from "~/types/search" import { MODEL_3D } from "~/constants/media" @@ -19,7 +19,7 @@ interface AdditionalSearchQuery { * @returns the query and filters in the format used by the URL builders */ const transformSearchQuery = ( - query: ApiQueryParams + query: PaginatedSearchQuery ): AdditionalSearchQuery => ({ q: query.q ?? "", }) @@ -258,7 +258,7 @@ export const getAdditionalSourceBuilders = ( */ export const getAdditionalSources = ( mediaType: MediaType, - query: ApiQueryParams + query: PaginatedSearchQuery ): AdditionalSource[] => getAdditionalSourceBuilders(mediaType).map((source) => { const urlFunc = source[mediaType] diff --git a/frontend/src/utils/prepare-search-query-params.ts b/frontend/src/utils/prepare-search-query-params.ts deleted file mode 100644 index 5ea44b8b743..00000000000 --- a/frontend/src/utils/prepare-search-query-params.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { ApiQueryParams } from "~/utils/search-query-transform" - -const NON_API_PARAMS = ["shouldPersistMedia"] - -export default function prepareSearchQueryParams( - searchParams: Record -): ApiQueryParams { - const params = { - ...searchParams, - } - NON_API_PARAMS.forEach((key) => delete params[key]) - - if (params.q && params.q.length > 0) { - params.q = params.q.trim() - } - - // used in search by creator - // in that case, the creator name will be in `params.q` - // and params.searchBy will equal "creator" - // params value after this if block: - // { q: undefined, creator: "John", searchBy: "creator" } - if (params.searchBy && params.searchBy.length > 0) { - params[params.searchBy] = params.q - delete params.q - } - Object.keys(params).forEach((key) => { - if (params[key] === "") { - delete params[key] - } - }) - return params -} diff --git a/frontend/src/utils/search-query-transform.ts b/frontend/src/utils/search-query-transform.ts index 53ed46cf5e4..fe85258433e 100644 --- a/frontend/src/utils/search-query-transform.ts +++ b/frontend/src/utils/search-query-transform.ts @@ -12,41 +12,23 @@ import { supportedSearchTypes, } from "~/constants/media" import { INCLUDE_SENSITIVE_QUERY_PARAM } from "~/constants/content-safety" -import { getParameterByName } from "~/utils/url-params" import { deepClone } from "~/utils/clone" +import { + SearchFilterKeys, + PaginatedSearchQuery, + SearchFilterQuery, +} from "~/types/search" + import type { Context } from "@nuxt/types" import type { Dictionary } from "vue-router/types/router" -export interface ApiQueryParams { - q?: string - license?: string - license_type?: string - extension?: string - size?: string - aspect_ratio?: string - searchBy?: string - category?: string - source?: string - length?: string - [INCLUDE_SENSITIVE_QUERY_PARAM]?: string - page?: string - /** - * A conditional to show audio waveform data. - * TODO: We'll need new ApiQueryParams types that accept a media type to allow media-specific params - */ - peaks?: string -} - -export type ApiQueryFilters = Omit -export type ApiQueryKeys = keyof ApiQueryFilters - /** * This maps properties in the search store state to the corresponding API query * parameters. The convention is that filter property names are plural, and API query * parameters are singular. */ -const filterPropertyMappings: Record = { +const filterPropertyMappings: Record = { licenses: "license", licenseTypes: "license_type", audioCategories: "category", @@ -58,7 +40,6 @@ const filterPropertyMappings: Record = { sizes: "size", audioProviders: "source", imageProviders: "source", - searchBy: "searchBy", } const getMediaFilterTypes = (searchType: SearchType) => { @@ -92,7 +73,7 @@ export const filtersToQueryData = ( filters: Filters, searchType: Parameters[0] = ALL_MEDIA, hideEmpty = true -): ApiQueryFilters => { +) => { const mediaFilterTypes = getMediaFilterTypes(searchType) return mediaFilterTypes.reduce((query, filterCategory) => { @@ -102,7 +83,7 @@ export const filtersToQueryData = ( query[queryKey] = queryValue } return query - }, {} as ApiQueryFilters) + }, {} as SearchFilterQuery) } /** @@ -110,11 +91,11 @@ export const filtersToQueryData = ( * of the path after `/search/`, or `all` by default. * `/search/`: all * `/search/image`: image - * @param queryString - the query path string from the url + * @param path - the path string from the url */ -export const queryStringToSearchType = (queryString: string): SearchType => { +export const pathToSearchType = (path: string): SearchType => { const searchTypePattern = new RegExp(`/search/(${mediaTypes.join("|")})`) - const matchedType = queryString.match(searchTypePattern) + const matchedType = path.match(searchTypePattern) return matchedType === null ? ALL_MEDIA : (matchedType[1] as SearchType) } @@ -220,41 +201,17 @@ export const queryToFilterData = ({ return filters } -/** - * converts the url query string to the data format accepted by the API. - * - * this is slightly different from filtersToQueryData as this converts the - * query string and that converts the filter data. - * - * TODO: we might be able to refactor to eliminate the need for these two - * separate functions. - */ -export const queryStringToQueryData = (queryString: string) => { - const queryDataObject = {} as ApiQueryParams - const searchType = queryStringToSearchType(queryString) - const filterTypes = getMediaFilterTypes(searchType) - filterTypes.forEach((filterDataKey) => { - const queryDataKey = filterPropertyMappings[filterDataKey] - queryDataObject[queryDataKey] = getParameterByName( - queryDataKey, - queryString - ) - }) - - queryDataObject.q = getParameterByName("q", queryString) - - return queryDataObject -} - /** * Compares two API queries, excluding the search term (`q`) parameter. */ export const areQueriesEqual = ( - newQuery: ApiQueryParams, - oldQuery: ApiQueryParams + newQuery: PaginatedSearchQuery, + oldQuery: PaginatedSearchQuery ): boolean => { - const queryKeys = (query: ApiQueryParams) => - Object.keys(query).filter((k) => k !== "q") as (keyof ApiQueryParams)[] + const queryKeys = (query: PaginatedSearchQuery) => + Object.keys(query).filter( + (k) => k !== "q" + ) as (keyof PaginatedSearchQuery)[] const oldQueryKeys = queryKeys(oldQuery) const newQueryKeys = queryKeys(newQuery) if (oldQueryKeys.length !== newQueryKeys.length) return false @@ -268,8 +225,8 @@ export const areQueriesEqual = ( } /** - * The URL query string can contain multiple values for the same parameter. - * This function converts the query string to a dictionary where the values + * The vue-router's query can have values of a string or an array of strings. + * This function converts the query to a dictionary where the values * are always strings. If the parameter has multiple values, the first value * is used. * * @param queryDictionary - the query param dictionary provided by Vue router diff --git a/frontend/test/playwright/e2e/filters-sidebar-keyboard.spec.ts b/frontend/test/playwright/e2e/filters-sidebar-keyboard.spec.ts index 7220a837650..bb203c64d5c 100644 --- a/frontend/test/playwright/e2e/filters-sidebar-keyboard.spec.ts +++ b/frontend/test/playwright/e2e/filters-sidebar-keyboard.spec.ts @@ -35,9 +35,8 @@ for (const dir of languageDirections) { await setBreakpointCookie(page, "lg") /** * To simplify finding the last focusable element in the filters sidebar, - * we use the image search page. After the removal of the "searchBy" filter, - * the last element on the all media search page is the "license explanation" - * button, not a checkbox. + * we use the image search page. The last element on the all media search + * page is the "license explanation" button, not a checkbox. */ await page.goto(pathWithDir("/search/image?q=birds", dir)) }) diff --git a/frontend/test/playwright/e2e/filters.spec.ts b/frontend/test/playwright/e2e/filters.spec.ts index 90a1c50800e..e5c781d32ee 100644 --- a/frontend/test/playwright/e2e/filters.spec.ts +++ b/frontend/test/playwright/e2e/filters.spec.ts @@ -64,9 +64,7 @@ breakpoints.describeMobileAndDesktop(() => { } test("initial filters are applied based on the url", async ({ page }) => { - await page.goto( - "/search/?q=cat&license_type=commercial&license=cc0&searchBy=creator" - ) + await page.goto("/search/?q=cat&license_type=commercial&license=cc0") await filters.open(page) // Creator filter was removed from the UI const expectedFilters = ["Zero", "Use commercially"] @@ -79,9 +77,7 @@ breakpoints.describeMobileAndDesktop(() => { test("common filters are retained when media type changes from all media to single type", async ({ page, }) => { - await page.goto( - "/search/?q=cat&license_type=commercial&license=cc0&searchBy=creator" - ) + await page.goto("/search/?q=cat&license_type=commercial&license=cc0") await filters.open(page) // Creator filter was removed from the UI const expectedFilters = ["Zero", "Use commercially"] @@ -92,7 +88,7 @@ breakpoints.describeMobileAndDesktop(() => { await changeSearchType(page, IMAGE) await expect(page).toHaveURL( - "/search/image?q=cat&license_type=commercial&license=cc0&searchBy=creator" + "/search/image?q=cat&license_type=commercial&license=cc0" ) await filters.open(page) for (const checkbox of expectedFilters) { @@ -103,9 +99,7 @@ breakpoints.describeMobileAndDesktop(() => { test("common filters are retained when media type changes from single type to all media", async ({ page, }) => { - await page.goto( - "/search/image?q=cat&license_type=commercial&license=cc0&searchBy=creator" - ) + await page.goto("/search/image?q=cat&license_type=commercial&license=cc0") await filters.open(page) // Creator filter was removed from the UI @@ -119,7 +113,7 @@ breakpoints.describeMobileAndDesktop(() => { await expect(page.locator('input[type="checkbox"]:checked')).toHaveCount(3) await expect(page).toHaveURL( - "/search/?q=cat&license_type=commercial&license=cc0&searchBy=creator" + "/search/?q=cat&license_type=commercial&license=cc0" ) }) diff --git a/frontend/test/playwright/e2e/search-query-server.spec.ts b/frontend/test/playwright/e2e/search-query-server.spec.ts index 81f3ccf24e1..b60e5de21ae 100644 --- a/frontend/test/playwright/e2e/search-query-server.spec.ts +++ b/frontend/test/playwright/e2e/search-query-server.spec.ts @@ -34,7 +34,7 @@ test.describe("search query on SSR", () => { test("q query parameter is set as the search term", async ({ page }) => { await goToSearchTerm(page, "cat", { - query: "license=cc0&license_type=commercial&searchBy=creator", + query: "license=cc0&license_type=commercial", }) const searchInput = page.locator('input[type="search"]') @@ -66,7 +66,7 @@ test.describe("search query on SSR", () => { page, }) => { await goToSearchTerm(page, "cat", { - query: "license=cc0&license_type=commercial&searchBy=creator", + query: "license=cc0&license_type=commercial", }) await filters.open(page) @@ -83,7 +83,7 @@ test.describe("search query on SSR", () => { }) => { await goToSearchTerm(page, "cat", { searchType: IMAGE, - query: "searchBy=creator&extension=jpg,png,gif,svg", + query: "extension=jpg,png,gif,svg", }) await filters.open(page) const checkboxes = ["JPEG", "PNG", "GIF", "SVG"] diff --git a/frontend/test/tapes/search/audio/license_type=commercial&license=cc0&searchBy=creator&creator=cat_close.json5 b/frontend/test/tapes/search/audio/license_type=commercial&license=cc0&searchBy=creator&creator=cat_close.json5 deleted file mode 100644 index 2d3c1479855..00000000000 --- a/frontend/test/tapes/search/audio/license_type=commercial&license=cc0&searchBy=creator&creator=cat_close.json5 +++ /dev/null @@ -1,88 +0,0 @@ -{ - meta: { - createdAt: '2022-03-28T16:10:30.427Z', - host: 'https://api.openverse.engineering', - resHumanReadable: true, - }, - req: { - headers: { - accept: 'application/json, text/plain, */*', - connection: 'close', - }, - url: '/v1/audio/?license_type=commercial&license=cc0&searchBy=creator&creator=cat&peaks=true', - method: 'GET', - body: '', - }, - res: { - status: 200, - headers: { - date: [ - 'Mon, 28 Mar 2022 16:10:41 GMT', - ], - 'content-type': [ - 'application/json', - ], - 'content-length': [ - '70', - ], - connection: [ - 'close', - ], - vary: [ - 'Accept, Authorization, Origin', - ], - allow: [ - 'GET, HEAD, OPTIONS', - ], - 'x-frame-options': [ - 'DENY', - ], - 'x-content-type-options': [ - 'nosniff', - ], - 'referrer-policy': [ - 'same-origin', - ], - 'cross-origin-opener-policy': [ - 'same-origin', - ], - 'cache-control': [ - 'max-age=14400', - ], - 'cf-cache-status': [ - 'HIT', - ], - age: [ - '106797', - ], - 'last-modified': [ - 'Sun, 27 Mar 2022 10:30:44 GMT', - ], - 'accept-ranges': [ - 'bytes', - ], - 'expect-ct': [ - 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', - ], - 'strict-transport-security': [ - 'max-age=15552000; includeSubDomains; preload', - ], - server: [ - 'cloudflare', - ], - 'cf-ray': [ - '6f31a32b2dc768c1-BUD', - ], - 'alt-svc': [ - 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', - ], - }, - body: { - result_count: 0, - page_count: 0, - page_size: 20, - page: 1, - results: [], - }, - }, -} diff --git a/frontend/test/tapes/search/audio/license_type=commercial&license=cc0&searchBy=creator&creator=cat_keep-alive.json5 b/frontend/test/tapes/search/audio/license_type=commercial&license=cc0&searchBy=creator&creator=cat_keep-alive.json5 deleted file mode 100644 index 9b9360b8e12..00000000000 --- a/frontend/test/tapes/search/audio/license_type=commercial&license=cc0&searchBy=creator&creator=cat_keep-alive.json5 +++ /dev/null @@ -1,102 +0,0 @@ -{ - meta: { - createdAt: '2022-03-28T16:10:47.665Z', - host: 'https://api.openverse.engineering', - resHumanReadable: true, - resUncompressed: true, - }, - req: { - headers: { - connection: 'keep-alive', - pragma: 'no-cache', - 'cache-control': 'no-cache', - 'sec-ch-ua': '', - accept: 'application/json, text/plain, */*', - 'sec-ch-ua-mobile': '?0', - 'sec-ch-ua-platform': '', - 'sec-fetch-site': 'same-site', - 'sec-fetch-mode': 'cors', - 'sec-fetch-dest': 'empty', - referer: 'http://localhost:8443/', - 'accept-encoding': 'gzip, deflate, br', - }, - url: '/v1/audio/?license_type=commercial&license=cc0&searchBy=creator&creator=cat&peaks=true', - method: 'GET', - body: '', - }, - res: { - status: 200, - headers: { - date: [ - 'Mon, 28 Mar 2022 16:10:47 GMT', - ], - 'content-type': [ - 'application/json', - ], - 'transfer-encoding': [ - 'chunked', - ], - connection: [ - 'keep-alive', - ], - vary: [ - 'Accept, Authorization, Origin, Accept-Encoding', - ], - allow: [ - 'GET, HEAD, OPTIONS', - ], - 'x-frame-options': [ - 'DENY', - ], - 'access-control-allow-origin': [ - '*', - ], - 'x-content-type-options': [ - 'nosniff', - ], - 'referrer-policy': [ - 'same-origin', - ], - 'cross-origin-opener-policy': [ - 'same-origin', - ], - 'cache-control': [ - 'max-age=14400', - ], - 'cf-cache-status': [ - 'HIT', - ], - age: [ - '104116', - ], - 'last-modified': [ - 'Sun, 27 Mar 2022 11:15:31 GMT', - ], - 'expect-ct': [ - 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', - ], - 'strict-transport-security': [ - 'max-age=15552000; includeSubDomains; preload', - ], - server: [ - 'cloudflare', - ], - 'cf-ray': [ - '6f31a351a8bf68c1-BUD', - ], - 'content-encoding': [ - 'br', - ], - 'alt-svc': [ - 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', - ], - }, - body: { - result_count: 0, - page_count: 0, - page_size: 20, - page: 1, - results: [], - }, - }, -} diff --git a/frontend/test/tapes/search/audio/q=cat&license_type=commercial&license=cc0&peaks=true_close.json5 b/frontend/test/tapes/search/audio/q=cat&license_type=commercial&license=cc0&peaks=true_close.json5 new file mode 100644 index 00000000000..e3edd804f85 --- /dev/null +++ b/frontend/test/tapes/search/audio/q=cat&license_type=commercial&license=cc0&peaks=true_close.json5 @@ -0,0 +1,1383 @@ +{ + meta: { + createdAt: '2023-10-05T02:58:56.632Z', + host: 'https://api.openverse.engineering', + resHumanReadable: true, + }, + req: { + headers: { + connection: 'close', + }, + url: '/v1/audio/?q=cat&license_type=commercial&license=cc0&peaks=true', + method: 'GET', + body: '', + }, + res: { + status: 200, + headers: { + date: [ + 'Thu, 05 Oct 2023 02:59:01 GMT', + ], + 'content-type': [ + 'application/json', + ], + 'transfer-encoding': [ + 'chunked', + ], + connection: [ + 'close', + ], + vary: [ + 'Accept-Encoding, Accept, Authorization, origin', + ], + allow: [ + 'GET, HEAD, OPTIONS', + ], + 'x-ratelimit-limit-anon_burst': [ + '5/hour', + ], + 'x-ratelimit-available-anon_burst': [ + '4', + ], + 'x-ratelimit-limit-anon_sustained': [ + '100/day', + ], + 'x-ratelimit-available-anon_sustained': [ + '99', + ], + 'x-ratelimit-limit-anon_thumbnail': [ + '150/minute', + ], + 'x-ratelimit-available-anon_thumbnail': [ + '149', + ], + 'x-frame-options': [ + 'DENY', + ], + 'x-content-type-options': [ + 'nosniff', + ], + 'referrer-policy': [ + 'same-origin', + ], + 'cross-origin-opener-policy': [ + 'same-origin', + ], + 'x-request-id': [ + 'e04dab6e73c5494a90f93a2c6758f76a', + ], + 'cache-control': [ + 'max-age=14400', + ], + 'cf-cache-status': [ + 'MISS', + ], + 'last-modified': [ + 'Thu, 05 Oct 2023 02:59:01 GMT', + ], + 'strict-transport-security': [ + 'max-age=15552000; includeSubDomains; preload', + ], + server: [ + 'cloudflare', + ], + 'cf-ray': [ + '811267e12fa66255-OTP', + ], + 'alt-svc': [ + 'h3=":443"; ma=86400', + ], + }, + body: { + result_count: 10000, + page_count: 20, + page_size: 20, + page: 1, + results: [ + { + id: 'd1f3fc1f-f7db-4117-8d6b-921c1f393520', + title: 'Cat meow', + indexed_on: '2023-03-10T13:20:18.216530Z', + foreign_landing_url: 'https://freesound.org/people/philsapphire/sounds/256452', + url: 'https://cdn.freesound.org/previews/256/256452_4754386-hq.mp3', + creator: 'philsapphire', + creator_url: 'https://freesound.org/people/philsapphire', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 36113, + filetype: 'mp3', + tags: [ + { + name: 'meow', + accuracy: null, + }, + { + name: 'meowing', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/256452/download/', + bit_rate: '0', + filesize: '136270', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"Cat meow" by philsapphire is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: null, + duration: 1544, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/d1f3fc1f-f7db-4117-8d6b-921c1f393520/', + related_url: 'http://localhost:49153/v1/audio/d1f3fc1f-f7db-4117-8d6b-921c1f393520/related/', + waveform: 'http://localhost:49153/v1/audio/d1f3fc1f-f7db-4117-8d6b-921c1f393520/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '8420183f-c703-425a-9e79-1f36d10cf249', + title: 'Cat purring .wav', + indexed_on: '2023-03-10T13:20:18.216530Z', + foreign_landing_url: 'https://freesound.org/people/pickleparade/sounds/262955', + url: 'https://cdn.freesound.org/previews/262/262955_128837-hq.mp3', + creator: 'pickleparade', + creator_url: 'https://freesound.org/people/pickleparade', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 6111655, + filetype: 'mp3', + tags: [ + { + name: 'Stereo', + accuracy: null, + }, + { + name: 'purring', + accuracy: null, + }, + { + name: 'Close-up', + accuracy: null, + }, + { + name: 'Cat', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/262955/download/', + bit_rate: '0', + filesize: '45611822', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"Cat purring .wav" by pickleparade is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'tags.name', + 'title', + ], + mature: false, + audio_set: { + title: 'Cat purring', + foreign_landing_url: 'https://freesound.org/apiv2/packs/16170/', + creator: 'pickleparade', + creator_url: 'https://freesound.org/people/pickleparade/', + url: null, + filesize: null, + filetype: null, + }, + duration: 258570, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/8420183f-c703-425a-9e79-1f36d10cf249/', + related_url: 'http://localhost:49153/v1/audio/8420183f-c703-425a-9e79-1f36d10cf249/related/', + waveform: 'http://localhost:49153/v1/audio/8420183f-c703-425a-9e79-1f36d10cf249/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '86c72e3c-baa3-4e69-8fc3-4b2b7bb0cabf', + title: 'cat meowing', + indexed_on: '2022-08-01T10:21:55.203678Z', + foreign_landing_url: 'https://freesound.org/people/nekoninja/sounds/414042', + url: 'https://cdn.freesound.org/previews/414/414042_4682356-hq.mp3', + creator: 'nekoninja', + creator_url: 'https://freesound.org/people/nekoninja', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 241724, + filetype: 'mp3', + tags: [ + { + name: 'meow', + accuracy: null, + }, + { + name: 'kitten', + accuracy: null, + }, + { + name: 'animal', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/414042/download/', + bit_rate: '0', + filesize: '1796250', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"cat meowing" by nekoninja is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: null, + duration: 10182, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/86c72e3c-baa3-4e69-8fc3-4b2b7bb0cabf/', + related_url: 'http://localhost:49153/v1/audio/86c72e3c-baa3-4e69-8fc3-4b2b7bb0cabf/related/', + waveform: 'http://localhost:49153/v1/audio/86c72e3c-baa3-4e69-8fc3-4b2b7bb0cabf/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: 'aac05fb1-75c7-42da-ad0d-3b57032ab752', + title: 'Cat wants something', + indexed_on: '2022-11-01T13:48:32.970278Z', + foreign_landing_url: 'https://freesound.org/people/Jeanine2012/sounds/149940', + url: 'https://cdn.freesound.org/previews/149/149940_2470754-hq.mp3', + creator: 'Jeanine2012', + creator_url: 'https://freesound.org/people/Jeanine2012', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 894618, + filetype: 'mp3', + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'talking', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/149940/download/', + bit_rate: '256000', + filesize: '1244681', + filetype: 'mp3', + sample_rate: '44100', + }, + ], + attribution: '"Cat wants something" by Jeanine2012 is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: null, + duration: 38839, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/aac05fb1-75c7-42da-ad0d-3b57032ab752/', + related_url: 'http://localhost:49153/v1/audio/aac05fb1-75c7-42da-ad0d-3b57032ab752/related/', + waveform: 'http://localhost:49153/v1/audio/aac05fb1-75c7-42da-ad0d-3b57032ab752/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: 'a3a75eda-8910-4179-8093-54d5c12a4e56', + title: 'cat meow II', + indexed_on: '2023-03-20T17:21:54.283284Z', + foreign_landing_url: 'https://freesound.org/people/tuberatanka/sounds/110010', + url: 'https://cdn.freesound.org/previews/110/110010_1537422-hq.mp3', + creator: 'tuberatanka', + creator_url: 'https://freesound.org/people/tuberatanka', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 21500, + filetype: 'mp3', + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'meow', + accuracy: null, + }, + { + name: 'meowing', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/110010/download/', + bit_rate: '0', + filesize: '149780', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"cat meow II" by tuberatanka is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: { + title: 'cat meowing', + foreign_landing_url: 'https://freesound.org/apiv2/packs/6970/', + creator: 'tuberatanka', + creator_url: 'https://freesound.org/people/tuberatanka/', + url: null, + filesize: null, + filetype: null, + }, + duration: 848, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/a3a75eda-8910-4179-8093-54d5c12a4e56/', + related_url: 'http://localhost:49153/v1/audio/a3a75eda-8910-4179-8093-54d5c12a4e56/related/', + waveform: 'http://localhost:49153/v1/audio/a3a75eda-8910-4179-8093-54d5c12a4e56/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '218dfa37-3013-4aab-8465-385f4db648b3', + title: 'cats kittens dogs.wav', + indexed_on: '2022-10-01T04:02:44.560321Z', + foreign_landing_url: 'https://freesound.org/people/cognito%20perceptu/sounds/22973', + url: 'https://cdn.freesound.org/previews/22/22973_57789-hq.mp3', + creator: 'cognito perceptu', + creator_url: 'https://freesound.org/people/cognito perceptu', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 206105, + filetype: 'mp3', + tags: [ + { + name: 'barking', + accuracy: null, + }, + { + name: 'cats', + accuracy: null, + }, + { + name: 'dogs', + accuracy: null, + }, + { + name: 'kittens', + accuracy: null, + }, + { + name: 'meow', + accuracy: null, + }, + { + name: 'meowing', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/22973/download/', + bit_rate: '0', + filesize: '1599376', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"cats kittens dogs.wav" by cognito perceptu is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: null, + duration: 9066, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/218dfa37-3013-4aab-8465-385f4db648b3/', + related_url: 'http://localhost:49153/v1/audio/218dfa37-3013-4aab-8465-385f4db648b3/related/', + waveform: 'http://localhost:49153/v1/audio/218dfa37-3013-4aab-8465-385f4db648b3/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '5ae7f586-112b-4aa4-9953-d78c2fd64ea8', + title: 'Cat purring & licking', + indexed_on: '2022-10-01T04:02:44.560321Z', + foreign_landing_url: 'https://freesound.org/people/peridactyloptrix/sounds/213347', + url: 'https://cdn.freesound.org/previews/213/213347_2737063-hq.mp3', + creator: 'peridactyloptrix', + creator_url: 'https://freesound.org/people/peridactyloptrix', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 330936, + filetype: 'mp3', + tags: [ + { + name: 'purr', + accuracy: null, + }, + { + name: 'lick', + accuracy: null, + }, + { + name: 'animals', + accuracy: null, + }, + { + name: 'animal', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'kitty', + accuracy: null, + }, + { + name: 'domestic', + accuracy: null, + }, + { + name: 'licking', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'purring', + accuracy: null, + }, + { + name: 'pets', + accuracy: null, + }, + { + name: 'kitten', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/213347/download/', + bit_rate: '0', + filesize: '5438950', + filetype: 'wav', + sample_rate: '48000', + }, + ], + attribution: '"Cat purring & licking" by peridactyloptrix is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: { + title: 'Animals', + foreign_landing_url: 'https://freesound.org/apiv2/packs/13555/', + creator: 'peridactyloptrix', + creator_url: 'https://freesound.org/people/peridactyloptrix/', + url: null, + filesize: null, + filetype: null, + }, + duration: 18871, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/5ae7f586-112b-4aa4-9953-d78c2fd64ea8/', + related_url: 'http://localhost:49153/v1/audio/5ae7f586-112b-4aa4-9953-d78c2fd64ea8/related/', + waveform: 'http://localhost:49153/v1/audio/5ae7f586-112b-4aa4-9953-d78c2fd64ea8/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '7cacc3f1-d07b-41a9-90fc-12ddb5659979', + title: 'Cat meow.wav', + indexed_on: '2023-03-10T13:20:18.216530Z', + foreign_landing_url: 'https://freesound.org/people/KaiAndersen/sounds/454805', + url: 'https://cdn.freesound.org/previews/454/454805_8327286-hq.mp3', + creator: 'KaiAndersen', + creator_url: 'https://freesound.org/people/KaiAndersen', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 56928, + filetype: 'mp3', + tags: [ + { + name: 'me', + accuracy: null, + }, + { + name: 'purr', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'kitty', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'meow', + accuracy: null, + }, + { + name: 'purring', + accuracy: null, + }, + { + name: 'animal', + accuracy: null, + }, + { + name: 'kitten', + accuracy: null, + }, + { + name: 'meowing', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/454805/download/', + bit_rate: '0', + filesize: '918524', + filetype: 'wav', + sample_rate: '96000', + }, + ], + attribution: '"Cat meow.wav" by KaiAndersen is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: null, + duration: 2300, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/7cacc3f1-d07b-41a9-90fc-12ddb5659979/', + related_url: 'http://localhost:49153/v1/audio/7cacc3f1-d07b-41a9-90fc-12ddb5659979/related/', + waveform: 'http://localhost:49153/v1/audio/7cacc3f1-d07b-41a9-90fc-12ddb5659979/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '1d1201ab-0a9b-49d4-8a76-201802116b95', + title: 'Cat purr meow.wav', + indexed_on: '2022-10-01T04:02:44.560321Z', + foreign_landing_url: 'https://freesound.org/people/mukuh/sounds/150099', + url: 'https://cdn.freesound.org/previews/150/150099_2718205-hq.mp3', + creator: 'mukuh', + creator_url: 'https://freesound.org/people/mukuh', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 5354784, + filetype: 'mp3', + tags: [ + { + name: 'purr', + accuracy: null, + }, + { + name: 'meow', + accuracy: null, + }, + { + name: 'kitty', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'tiger', + accuracy: null, + }, + { + name: 'purring', + accuracy: null, + }, + { + name: 'animal', + accuracy: null, + }, + { + name: 'meowing', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/150099/download/', + bit_rate: '0', + filesize: '63751118', + filetype: 'wav', + sample_rate: '48000', + }, + ], + attribution: '"Cat purr meow.wav" by mukuh is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: null, + duration: 221355, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/1d1201ab-0a9b-49d4-8a76-201802116b95/', + related_url: 'http://localhost:49153/v1/audio/1d1201ab-0a9b-49d4-8a76-201802116b95/related/', + waveform: 'http://localhost:49153/v1/audio/1d1201ab-0a9b-49d4-8a76-201802116b95/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '7b5b75b2-9e0b-4349-bdb0-e6f816d39fb9', + title: 'cat purr.wav', + indexed_on: '2022-08-01T10:21:55.203678Z', + foreign_landing_url: 'https://freesound.org/people/Walter_Odington/sounds/26769', + url: 'https://cdn.freesound.org/previews/26/26769_48671-hq.mp3', + creator: 'Walter_Odington', + creator_url: 'https://freesound.org/people/Walter_Odington', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 279970, + filetype: 'mp3', + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'mog', + accuracy: null, + }, + { + name: 'moggy', + accuracy: null, + }, + { + name: 'pur', + accuracy: null, + }, + { + name: 'purr', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/26769/download/', + bit_rate: '0', + filesize: '2105780', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"cat purr.wav" by Walter_Odington is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: { + title: 'Domestic', + foreign_landing_url: 'https://freesound.org/apiv2/packs/1647/', + creator: 'Walter_Odington', + creator_url: 'https://freesound.org/people/Walter_Odington/', + url: null, + filesize: null, + filetype: null, + }, + duration: 11904, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/7b5b75b2-9e0b-4349-bdb0-e6f816d39fb9/', + related_url: 'http://localhost:49153/v1/audio/7b5b75b2-9e0b-4349-bdb0-e6f816d39fb9/related/', + waveform: 'http://localhost:49153/v1/audio/7b5b75b2-9e0b-4349-bdb0-e6f816d39fb9/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: 'baeba717-122f-42db-b65e-9a898c566d30', + title: 'Cat Happy Purr/Twitter2.wav', + indexed_on: '2022-10-01T04:02:44.560321Z', + foreign_landing_url: 'https://freesound.org/people/steffcaffrey/sounds/262307', + url: 'https://cdn.freesound.org/previews/262/262307_1844073-hq.mp3', + creator: 'steffcaffrey', + creator_url: 'https://freesound.org/people/steffcaffrey', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 11426, + filetype: 'mp3', + tags: [ + { + name: 'purr', + accuracy: null, + }, + { + name: 'animals', + accuracy: null, + }, + { + name: 'pets', + accuracy: null, + }, + { + name: 'happy', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'domestic', + accuracy: null, + }, + { + name: 'tweet', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'kitty', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'meow', + accuracy: null, + }, + { + name: 'mew', + accuracy: null, + }, + { + name: 'cats', + accuracy: null, + }, + { + name: 'purring', + accuracy: null, + }, + { + name: 'animal', + accuracy: null, + }, + { + name: 'kitten', + accuracy: null, + }, + { + name: 'meowing', + accuracy: null, + }, + { + name: 'twitter', + accuracy: null, + }, + { + name: 'twit', + accuracy: null, + }, + { + name: 'field-recording', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/262307/download/', + bit_rate: '0', + filesize: '95380', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"Cat Happy Purr/Twitter2.wav" by steffcaffrey is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: { + title: 'Cats', + foreign_landing_url: 'https://freesound.org/apiv2/packs/16113/', + creator: 'steffcaffrey', + creator_url: 'https://freesound.org/people/steffcaffrey/', + url: null, + filesize: null, + filetype: null, + }, + duration: 535, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/baeba717-122f-42db-b65e-9a898c566d30/', + related_url: 'http://localhost:49153/v1/audio/baeba717-122f-42db-b65e-9a898c566d30/related/', + waveform: 'http://localhost:49153/v1/audio/baeba717-122f-42db-b65e-9a898c566d30/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '80dc9e44-4d98-492e-93b2-3e21029d9015', + title: 'LL-Q7026 (cat)-Viqtor29-dit', + indexed_on: '2023-07-23T09:42:55.809501Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=125325739', + url: 'https://upload.wikimedia.org/wikipedia/commons/3/37/LL-Q7026_%28cat%29-Viqtor29-dit.wav', + creator: 'Speaker: Viqtor29 Recorder: Viqtor29', + creator_url: 'https://lingualibre.org/wiki/Q818122', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', + provider: 'wikimedia_audio', + source: 'wikimedia_audio', + category: 'pronunciation', + genres: null, + filesize: 75028, + filetype: 'wav', + tags: [], + alt_files: null, + attribution: '"LL-Q7026 (cat)-Viqtor29-dit" by Speaker: Viqtor29 Recorder: Viqtor29 is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/deed.en.', + fields_matched: [ + 'title', + ], + mature: false, + audio_set: null, + duration: 850, + bit_rate: 705600, + sample_rate: 44100, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/80dc9e44-4d98-492e-93b2-3e21029d9015/', + related_url: 'http://localhost:49153/v1/audio/80dc9e44-4d98-492e-93b2-3e21029d9015/related/', + waveform: 'http://localhost:49153/v1/audio/80dc9e44-4d98-492e-93b2-3e21029d9015/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: 'a3c38524-b1c3-46fe-86f5-b1d3b793b1d6', + title: 'LL-Q7026 (cat)-Carme Oriol-dit', + indexed_on: '2023-07-23T09:42:55.809501Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=125327015', + url: 'https://upload.wikimedia.org/wikipedia/commons/3/36/LL-Q7026_%28cat%29-Carme_Oriol-dit.wav', + creator: 'Speaker: Carme Oriol Recorder: Carme Oriol', + creator_url: 'https://lingualibre.org/wiki/Q818255', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', + provider: 'wikimedia_audio', + source: 'wikimedia_audio', + category: 'pronunciation', + genres: null, + filesize: 99604, + filetype: 'wav', + tags: [], + alt_files: null, + attribution: '"LL-Q7026 (cat)-Carme Oriol-dit" by Speaker: Carme Oriol Recorder: Carme Oriol is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/deed.en.', + fields_matched: [ + 'title', + ], + mature: false, + audio_set: null, + duration: 1128, + bit_rate: 705600, + sample_rate: 44100, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/a3c38524-b1c3-46fe-86f5-b1d3b793b1d6/', + related_url: 'http://localhost:49153/v1/audio/a3c38524-b1c3-46fe-86f5-b1d3b793b1d6/related/', + waveform: 'http://localhost:49153/v1/audio/a3c38524-b1c3-46fe-86f5-b1d3b793b1d6/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '909716c0-0783-44db-9ca2-4e8e2677cb27', + title: 'LL-Q7026 (cat)-Marvives-proposar', + indexed_on: '2023-09-03T05:18:50.876227Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=128032017', + url: 'https://upload.wikimedia.org/wikipedia/commons/1/1c/LL-Q7026_%28cat%29-Marvives-proposar.wav', + creator: 'Speaker: Marvives Recorder: Marvives', + creator_url: 'https://lingualibre.org/wiki/Q842213', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', + provider: 'wikimedia_audio', + source: 'wikimedia_audio', + category: 'pronunciation', + genres: null, + filesize: 109356, + filetype: 'wav', + tags: [], + alt_files: null, + attribution: '"LL-Q7026 (cat)-Marvives-proposar" by Speaker: Marvives Recorder: Marvives is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/deed.en.', + fields_matched: [ + 'title', + ], + mature: false, + audio_set: null, + duration: 1138, + bit_rate: 768000, + sample_rate: 48000, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/909716c0-0783-44db-9ca2-4e8e2677cb27/', + related_url: 'http://localhost:49153/v1/audio/909716c0-0783-44db-9ca2-4e8e2677cb27/related/', + waveform: 'http://localhost:49153/v1/audio/909716c0-0783-44db-9ca2-4e8e2677cb27/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '68d5908b-950b-4ae5-8f67-c8066ad1fcf1', + title: 'Cat Purring.wav', + indexed_on: '2022-11-01T13:48:32.970278Z', + foreign_landing_url: 'https://freesound.org/people/esperri/sounds/118959', + url: 'https://cdn.freesound.org/previews/118/118959_1990695-hq.mp3', + creator: 'esperri', + creator_url: 'https://freesound.org/people/esperri', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 173952, + filetype: 'mp3', + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'purr', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/118959/download/', + bit_rate: '0', + filesize: '4111876', + filetype: 'wav', + sample_rate: '48000', + }, + ], + attribution: '"Cat Purring.wav" by esperri is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: { + title: 'Animal Noises', + foreign_landing_url: 'https://freesound.org/apiv2/packs/7469/', + creator: 'esperri', + creator_url: 'https://freesound.org/people/esperri/', + url: null, + filesize: null, + filetype: null, + }, + duration: 7131, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/68d5908b-950b-4ae5-8f67-c8066ad1fcf1/', + related_url: 'http://localhost:49153/v1/audio/68d5908b-950b-4ae5-8f67-c8066ad1fcf1/related/', + waveform: 'http://localhost:49153/v1/audio/68d5908b-950b-4ae5-8f67-c8066ad1fcf1/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: 'c320bbd3-b120-4316-a931-2c1c84b1f325', + title: 'Cat meow 5', + indexed_on: '2022-06-01T12:00:12.608809Z', + foreign_landing_url: 'https://freesound.org/people/fthgurdy/sounds/528192', + url: 'https://cdn.freesound.org/previews/528/528192_3302313-hq.mp3', + creator: 'fthgurdy', + creator_url: 'https://freesound.org/people/fthgurdy', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 48893, + filetype: 'mp3', + tags: [ + { + name: 'meow', + accuracy: null, + }, + { + name: 'miau', + accuracy: null, + }, + { + name: 'mew', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/528192/download/', + bit_rate: '0', + filesize: '380270', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"Cat meow 5" by fthgurdy is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + audio_set: { + title: 'Animal Sounds', + foreign_landing_url: 'https://freesound.org/apiv2/packs/29693/', + creator: 'fthgurdy', + creator_url: 'https://freesound.org/people/fthgurdy/', + url: null, + filesize: null, + filetype: null, + }, + duration: 1940, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/c320bbd3-b120-4316-a931-2c1c84b1f325/', + related_url: 'http://localhost:49153/v1/audio/c320bbd3-b120-4316-a931-2c1c84b1f325/related/', + waveform: 'http://localhost:49153/v1/audio/c320bbd3-b120-4316-a931-2c1c84b1f325/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: 'd468b275-ee31-4e80-98e1-fd00ea6d790f', + title: 'tom - Gretsch Cat Maple 8 - 1.wav', + indexed_on: '2023-03-20T17:21:54.283284Z', + foreign_landing_url: 'https://freesound.org/people/bigjoedrummer/sounds/111662', + url: 'https://cdn.freesound.org/previews/111/111662_1105584-hq.mp3', + creator: 'bigjoedrummer', + creator_url: 'https://freesound.org/people/bigjoedrummer', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'freesound', + source: 'freesound', + category: null, + genres: null, + filesize: 74250, + filetype: 'mp3', + tags: [ + { + name: '8', + accuracy: null, + }, + { + name: 'drums', + accuracy: null, + }, + { + name: 'gretsch', + accuracy: null, + }, + { + name: 'high', + accuracy: null, + }, + { + name: 'maple', + accuracy: null, + }, + { + name: 'tom', + accuracy: null, + }, + ], + alt_files: [ + { + url: 'https://freesound.org/apiv2/sounds/111662/download/', + bit_rate: '0', + filesize: '569558', + filetype: 'wav', + sample_rate: '44100', + }, + ], + attribution: '"tom - Gretsch Cat Maple 8 - 1.wav" by bigjoedrummer is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'title', + ], + mature: false, + audio_set: { + title: 'Gretsch drums', + foreign_landing_url: 'https://freesound.org/apiv2/packs/4724/', + creator: 'bigjoedrummer', + creator_url: 'https://freesound.org/people/bigjoedrummer/', + url: null, + filesize: null, + filetype: null, + }, + duration: 3228, + bit_rate: 128000, + sample_rate: null, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/d468b275-ee31-4e80-98e1-fd00ea6d790f/', + related_url: 'http://localhost:49153/v1/audio/d468b275-ee31-4e80-98e1-fd00ea6d790f/related/', + waveform: 'http://localhost:49153/v1/audio/d468b275-ee31-4e80-98e1-fd00ea6d790f/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: 'cd768fe2-c09a-4ee8-8b74-ba44edf43871', + title: 'LL-Q7026 (cat)-Marvives-fillastre', + indexed_on: '2023-09-17T06:25:53.198683Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=128450796', + url: 'https://upload.wikimedia.org/wikipedia/commons/5/53/LL-Q7026_%28cat%29-Marvives-fillastre.wav', + creator: 'Speaker: Marvives Recorder: Marvives', + creator_url: 'https://lingualibre.org/wiki/Q842213', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', + provider: 'wikimedia_audio', + source: 'wikimedia_audio', + category: 'pronunciation', + genres: null, + filesize: 125740, + filetype: 'wav', + tags: [], + alt_files: null, + attribution: '"LL-Q7026 (cat)-Marvives-fillastre" by Speaker: Marvives Recorder: Marvives is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/deed.en.', + fields_matched: [ + 'title', + ], + mature: false, + audio_set: null, + duration: 1309, + bit_rate: 768000, + sample_rate: 48000, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/cd768fe2-c09a-4ee8-8b74-ba44edf43871/', + related_url: 'http://localhost:49153/v1/audio/cd768fe2-c09a-4ee8-8b74-ba44edf43871/related/', + waveform: 'http://localhost:49153/v1/audio/cd768fe2-c09a-4ee8-8b74-ba44edf43871/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '07f07a64-ddc0-4571-b1d0-a02b87c7aec4', + title: 'LL-Q7026 (cat)-Marvives-empitjorar', + indexed_on: '2023-08-06T10:37:07.181794Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=128103645', + url: 'https://upload.wikimedia.org/wikipedia/commons/7/79/LL-Q7026_%28cat%29-Marvives-empitjorar.wav', + creator: 'Speaker: Marvives Recorder: Marvives', + creator_url: 'https://lingualibre.org/wiki/Q842213', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', + provider: 'wikimedia_audio', + source: 'wikimedia_audio', + category: 'pronunciation', + genres: null, + filesize: 125740, + filetype: 'wav', + tags: [], + alt_files: null, + attribution: '"LL-Q7026 (cat)-Marvives-empitjorar" by Speaker: Marvives Recorder: Marvives is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/deed.en.', + fields_matched: [ + 'title', + ], + mature: false, + audio_set: null, + duration: 1309, + bit_rate: 768000, + sample_rate: 48000, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/07f07a64-ddc0-4571-b1d0-a02b87c7aec4/', + related_url: 'http://localhost:49153/v1/audio/07f07a64-ddc0-4571-b1d0-a02b87c7aec4/related/', + waveform: 'http://localhost:49153/v1/audio/07f07a64-ddc0-4571-b1d0-a02b87c7aec4/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + { + id: '0cdf3ebc-c540-44df-92e1-9e1879711f97', + title: 'LL-Q7026 (cat)-Marvives-alternatiu', + indexed_on: '2023-08-06T10:37:07.181794Z', + foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=128098604', + url: 'https://upload.wikimedia.org/wikipedia/commons/9/9d/LL-Q7026_%28cat%29-Marvives-alternatiu.wav', + creator: 'Speaker: Marvives Recorder: Marvives', + creator_url: 'https://lingualibre.org/wiki/Q842213', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', + provider: 'wikimedia_audio', + source: 'wikimedia_audio', + category: 'pronunciation', + genres: null, + filesize: 133932, + filetype: 'wav', + tags: [], + alt_files: null, + attribution: '"LL-Q7026 (cat)-Marvives-alternatiu" by Speaker: Marvives Recorder: Marvives is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/deed.en.', + fields_matched: [ + 'title', + ], + mature: false, + audio_set: null, + duration: 1394, + bit_rate: 768000, + sample_rate: 48000, + thumbnail: null, + detail_url: 'http://localhost:49153/v1/audio/0cdf3ebc-c540-44df-92e1-9e1879711f97/', + related_url: 'http://localhost:49153/v1/audio/0cdf3ebc-c540-44df-92e1-9e1879711f97/related/', + waveform: 'http://localhost:49153/v1/audio/0cdf3ebc-c540-44df-92e1-9e1879711f97/waveform/', + peaks: [], + unstable__sensitivity: [], + }, + ], + }, + }, +} diff --git a/frontend/test/tapes/search/images/license_type=commercial&license=cc0&searchBy=creator&creator=cat_close.json5 b/frontend/test/tapes/search/images/license_type=commercial&license=cc0&searchBy=creator&creator=cat_close.json5 deleted file mode 100644 index 2d45c8675be..00000000000 --- a/frontend/test/tapes/search/images/license_type=commercial&license=cc0&searchBy=creator&creator=cat_close.json5 +++ /dev/null @@ -1,924 +0,0 @@ -{ - meta: { - createdAt: '2022-03-28T15:05:37.331Z', - host: 'https://api.openverse.engineering', - resHumanReadable: true, - }, - req: { - headers: { - accept: 'application/json, text/plain, */*', - connection: 'close', - }, - url: '/v1/images/?license_type=commercial&license=cc0&searchBy=creator&creator=cat', - method: 'GET', - body: '', - }, - res: { - status: 200, - headers: { - date: [ - 'Mon, 28 Mar 2022 15:05:37 GMT', - ], - 'content-type': [ - 'application/json', - ], - 'transfer-encoding': [ - 'chunked', - ], - connection: [ - 'close', - ], - vary: [ - 'Accept-Encoding, Accept, Authorization, Origin', - ], - allow: [ - 'GET, HEAD, OPTIONS', - ], - 'x-frame-options': [ - 'DENY', - ], - 'x-content-type-options': [ - 'nosniff', - ], - 'referrer-policy': [ - 'same-origin', - ], - 'cross-origin-opener-policy': [ - 'same-origin', - ], - 'cache-control': [ - 'max-age=14400', - ], - 'cf-cache-status': [ - 'HIT', - ], - age: [ - '102893', - ], - 'last-modified': [ - 'Sun, 27 Mar 2022 10:30:44 GMT', - ], - 'expect-ct': [ - 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', - ], - 'strict-transport-security': [ - 'max-age=15552000; includeSubDomains; preload', - ], - server: [ - 'cloudflare', - ], - 'cf-ray': [ - '6f3143d9bbc71cf2-BUD', - ], - 'alt-svc': [ - 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', - ], - }, - body: { - result_count: 95, - page_count: 5, - page_size: 20, - page: 1, - results: [ - { - id: '65fcbef2-09bf-43e9-9908-bac9fe4b0489', - title: 'File:1964 Corgi Aston Martin DB5.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=15895561', - creator: "Schrodinger's cat is alive", - creator_url: 'https://commons.wikimedia.org/w/index.php?title=User:Schrodinger%27s_cat_is_alive&action=edit&redlink=1', - url: 'https://upload.wikimedia.org/wikipedia/commons/9/98/1964_Corgi_Aston_Martin_DB5.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/65fcbef2-09bf-43e9-9908-bac9fe4b0489/thumb/', - detail_url: 'http://localhost:49153/v1/images/65fcbef2-09bf-43e9-9908-bac9fe4b0489/', - related_url: 'http://localhost:49153/v1/images/65fcbef2-09bf-43e9-9908-bac9fe4b0489/related/', - }, - { - id: '83dadd4c-155e-427e-841e-5314cc490196', - title: 'File:Aerial view of Kouhoku Interchange from south.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89158017', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/e/e6/Aerial_view_of_Kouhoku_Interchange_from_south.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/83dadd4c-155e-427e-841e-5314cc490196/thumb/', - detail_url: 'http://localhost:49153/v1/images/83dadd4c-155e-427e-841e-5314cc490196/', - related_url: 'http://localhost:49153/v1/images/83dadd4c-155e-427e-841e-5314cc490196/related/', - }, - { - id: '172447df-34f4-442f-8544-203ef4375eb1', - title: 'File:Adenium obesum seed.JPG', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=46674362', - creator: 'Sarr Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Sarr_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/4/48/Adenium_obesum_seed.JPG', - license: 'cc0', - license_version: '1.0', - license_url: 'http://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/172447df-34f4-442f-8544-203ef4375eb1/thumb/', - detail_url: 'http://localhost:49153/v1/images/172447df-34f4-442f-8544-203ef4375eb1/', - related_url: 'http://localhost:49153/v1/images/172447df-34f4-442f-8544-203ef4375eb1/related/', - }, - { - id: '52f0c835-7f40-495e-ad79-fe8ba6a55f70', - title: 'File:Aerial view of Diamond Princess with Yokohama City.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89848516', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/a/ae/Aerial_view_of_Diamond_Princess_with_Yokohama_City.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/52f0c835-7f40-495e-ad79-fe8ba6a55f70/thumb/', - detail_url: 'http://localhost:49153/v1/images/52f0c835-7f40-495e-ad79-fe8ba6a55f70/', - related_url: 'http://localhost:49153/v1/images/52f0c835-7f40-495e-ad79-fe8ba6a55f70/related/', - }, - { - id: '3e96e7d4-56c3-452e-abce-468bf9609b8c', - title: 'red heart', - foreign_landing_url: 'https://www.flickr.com/photos/34608298@N05/49518632747', - creator: 'Cat Girl 007', - creator_url: 'https://www.flickr.com/photos/34608298@N05', - url: 'https://live.staticflickr.com/65535/49518632747_1e48b32df6.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'concept', - }, - { - name: 'design', - }, - { - name: 'graphic', - }, - { - name: 'heart', - }, - { - name: 'love', - }, - { - name: 'passion', - }, - { - name: 'red', - }, - { - name: 'shape', - }, - { - name: 'symbol', - }, - { - name: 'valentine', - }, - { - name: 'vector', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/3e96e7d4-56c3-452e-abce-468bf9609b8c/thumb/', - detail_url: 'http://localhost:49153/v1/images/3e96e7d4-56c3-452e-abce-468bf9609b8c/', - related_url: 'http://localhost:49153/v1/images/3e96e7d4-56c3-452e-abce-468bf9609b8c/related/', - }, - { - id: '7152fd26-4a48-4996-b25c-1691fc7c31b1', - title: "Bearded Wrestler in Evangelist's Tableau", - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38375627862', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4552/38375627862_dc229bd669_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'bearded', - }, - { - name: 'ben', - }, - { - name: 'big', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'morgan', - }, - { - name: 'performer', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'tableau', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - { - name: 'wrestler', - }, - { - name: 'wrestling', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/7152fd26-4a48-4996-b25c-1691fc7c31b1/thumb/', - detail_url: 'http://localhost:49153/v1/images/7152fd26-4a48-4996-b25c-1691fc7c31b1/', - related_url: 'http://localhost:49153/v1/images/7152fd26-4a48-4996-b25c-1691fc7c31b1/related/', - }, - { - id: 'eb0e4e3f-863e-48e1-b655-556257435a5e', - title: 'File:Robinson Nature center (distant).jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=41783758', - creator: 'Sarr Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Sarr_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/1/18/Robinson_Nature_center_%28distant%29.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/eb0e4e3f-863e-48e1-b655-556257435a5e/thumb/', - detail_url: 'http://localhost:49153/v1/images/eb0e4e3f-863e-48e1-b655-556257435a5e/', - related_url: 'http://localhost:49153/v1/images/eb0e4e3f-863e-48e1-b655-556257435a5e/related/', - }, - { - id: '7ebbc26b-cd55-47d8-8cb0-fb4cbd7a3715', - title: 'File:Aerial view of Yokohama Aoba Interchange from south.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89117180', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/9/90/Aerial_view_of_Yokohama_Aoba_Interchange_from_south.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/7ebbc26b-cd55-47d8-8cb0-fb4cbd7a3715/thumb/', - detail_url: 'http://localhost:49153/v1/images/7ebbc26b-cd55-47d8-8cb0-fb4cbd7a3715/', - related_url: 'http://localhost:49153/v1/images/7ebbc26b-cd55-47d8-8cb0-fb4cbd7a3715/related/', - }, - { - id: '0229ef5f-b697-4d13-af42-4e6661313f0b', - title: 'File:Aerial view of Okuma-river truss bridge.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89377739', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/8/84/Aerial_view_of_Okuma-river_truss_bridge.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/0229ef5f-b697-4d13-af42-4e6661313f0b/thumb/', - detail_url: 'http://localhost:49153/v1/images/0229ef5f-b697-4d13-af42-4e6661313f0b/', - related_url: 'http://localhost:49153/v1/images/0229ef5f-b697-4d13-af42-4e6661313f0b/related/', - }, - { - id: 'dc90f9a5-3572-4220-82ad-2a016c619929', - title: "File:Aerial view of Eda station of Tokyu Den'en Toshi Line.jpg", - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89833030', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/1/16/Aerial_view_of_Eda_station_of_Tokyu_Den%27en_Toshi_Line.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/dc90f9a5-3572-4220-82ad-2a016c619929/thumb/', - detail_url: 'http://localhost:49153/v1/images/dc90f9a5-3572-4220-82ad-2a016c619929/', - related_url: 'http://localhost:49153/v1/images/dc90f9a5-3572-4220-82ad-2a016c619929/related/', - }, - { - id: '84a328b2-3575-4710-a0d4-53b403e82a67', - title: "Bearded Wrestler in Evangelist's Tableau", - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38407507441', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4567/38407507441_070406270c_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'bearded', - }, - { - name: 'ben', - }, - { - name: 'big', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'morgan', - }, - { - name: 'performer', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'tableau', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - { - name: 'wrestler', - }, - { - name: 'wrestling', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/84a328b2-3575-4710-a0d4-53b403e82a67/thumb/', - detail_url: 'http://localhost:49153/v1/images/84a328b2-3575-4710-a0d4-53b403e82a67/', - related_url: 'http://localhost:49153/v1/images/84a328b2-3575-4710-a0d4-53b403e82a67/related/', - }, - { - id: '074b64ba-1663-423b-ba8d-b20b0c4bb25e', - title: 'Two thumbs up', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/47556436921', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7861/47556436921_a562d472f4_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'actor', - }, - { - name: 'approval', - }, - { - name: 'approve', - }, - { - name: 'boy', - }, - { - name: 'cat', - }, - { - name: 'child', - }, - { - name: 'clippingpath', - }, - { - name: 'continue', - }, - { - name: 'critical', - }, - { - name: 'doubt', - }, - { - name: 'excellent', - }, - { - name: 'excited', - }, - { - name: 'facebook', - }, - { - name: 'finger', - }, - { - name: 'fist', - }, - { - name: 'good', - }, - { - name: 'great', - }, - { - name: 'hand', - }, - { - name: 'happy', - }, - { - name: 'isolated', - }, - { - name: 'isolatedonwhite', - }, - { - name: 'male', - }, - { - name: 'reason', - }, - { - name: 'research', - }, - { - name: 'skeptical', - }, - { - name: 'skepticism', - }, - { - name: 'skeptics', - }, - { - name: 'smile', - }, - { - name: 'thinking', - }, - { - name: 'thumb', - }, - { - name: 'twitter', - }, - { - name: 'up', - }, - { - name: 'vaccines', - }, - { - name: 'white', - }, - { - name: 'woo', - }, - { - name: 'yes', - }, - { - name: 'youth', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/074b64ba-1663-423b-ba8d-b20b0c4bb25e/thumb/', - detail_url: 'http://localhost:49153/v1/images/074b64ba-1663-423b-ba8d-b20b0c4bb25e/', - related_url: 'http://localhost:49153/v1/images/074b64ba-1663-423b-ba8d-b20b0c4bb25e/related/', - }, - { - id: '2c63dc0b-c1af-4557-8be9-141523cf6275', - title: 'Evangelist Pleads for Funds to Fight Suit', - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38407506091', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4573/38407506091_caeeaf808a_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/2c63dc0b-c1af-4557-8be9-141523cf6275/thumb/', - detail_url: 'http://localhost:49153/v1/images/2c63dc0b-c1af-4557-8be9-141523cf6275/', - related_url: 'http://localhost:49153/v1/images/2c63dc0b-c1af-4557-8be9-141523cf6275/related/', - }, - { - id: '08e07334-c39b-4afa-bbb4-1fba1aa635e9', - title: 'File:Aerial view of Daikoku Junction.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89477803', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/3/3d/Aerial_view_of_Daikoku_Junction.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/08e07334-c39b-4afa-bbb4-1fba1aa635e9/thumb/', - detail_url: 'http://localhost:49153/v1/images/08e07334-c39b-4afa-bbb4-1fba1aa635e9/', - related_url: 'http://localhost:49153/v1/images/08e07334-c39b-4afa-bbb4-1fba1aa635e9/related/', - }, - { - id: '0d0420a1-c3f5-43bf-8425-91d65a06a895', - title: 'File:Yokohama Aoba IC.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=88762248', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/6/6a/Yokohama_Aoba_IC.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/0d0420a1-c3f5-43bf-8425-91d65a06a895/thumb/', - detail_url: 'http://localhost:49153/v1/images/0d0420a1-c3f5-43bf-8425-91d65a06a895/', - related_url: 'http://localhost:49153/v1/images/0d0420a1-c3f5-43bf-8425-91d65a06a895/related/', - }, - { - id: 'c869ed6d-acdf-47fc-8ba4-b752bb4dbac0', - title: 'File:Aerial view of Jike town 1.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=91702285', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/a/ac/Aerial_view_of_Jike_town_1.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/c869ed6d-acdf-47fc-8ba4-b752bb4dbac0/thumb/', - detail_url: 'http://localhost:49153/v1/images/c869ed6d-acdf-47fc-8ba4-b752bb4dbac0/', - related_url: 'http://localhost:49153/v1/images/c869ed6d-acdf-47fc-8ba4-b752bb4dbac0/related/', - }, - { - id: '0f3c73d9-4971-45dc-b803-71b8c8f845f5', - title: 'File:Aerial view of exit toll gates of Yokohama Hokusei Line.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=89502077', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/5/52/Aerial_view_of_exit_toll_gates_of_Yokohama_Hokusei_Line.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/0f3c73d9-4971-45dc-b803-71b8c8f845f5/thumb/', - detail_url: 'http://localhost:49153/v1/images/0f3c73d9-4971-45dc-b803-71b8c8f845f5/', - related_url: 'http://localhost:49153/v1/images/0f3c73d9-4971-45dc-b803-71b8c8f845f5/related/', - }, - { - id: 'bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b', - title: 'Evangelist Pleads for Funds to Fight Suit', - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38375625562', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4529/38375625562_df700efabe_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b/thumb/', - detail_url: 'http://localhost:49153/v1/images/bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b/', - related_url: 'http://localhost:49153/v1/images/bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b/related/', - }, - { - id: '35fa78c8-26a0-4354-aabf-582e35c0a38c', - title: 'unscientific american', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/33540654738', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7847/33540654738_dd70e86408_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'american', - }, - { - name: 'autism', - }, - { - name: 'critical', - }, - { - name: 'donald', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'trump', - }, - { - name: 'unscientific', - }, - { - name: 'vaccines', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/35fa78c8-26a0-4354-aabf-582e35c0a38c/thumb/', - detail_url: 'http://localhost:49153/v1/images/35fa78c8-26a0-4354-aabf-582e35c0a38c/', - related_url: 'http://localhost:49153/v1/images/35fa78c8-26a0-4354-aabf-582e35c0a38c/related/', - }, - { - id: '2d872962-833c-4997-8874-2749b269e84a', - title: 'File:Aerial view of Ashigara Station.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=93185075', - creator: 'Hovering Cat', - creator_url: 'https://commons.wikimedia.org/wiki/User:Hovering_Cat', - url: 'https://upload.wikimedia.org/wikipedia/commons/6/6d/Aerial_view_of_Ashigara_Station.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/2d872962-833c-4997-8874-2749b269e84a/thumb/', - detail_url: 'http://localhost:49153/v1/images/2d872962-833c-4997-8874-2749b269e84a/', - related_url: 'http://localhost:49153/v1/images/2d872962-833c-4997-8874-2749b269e84a/related/', - }, - ], - }, - }, -} \ No newline at end of file diff --git a/frontend/test/tapes/search/images/license_type=commercial&license=cc0&searchBy=creator&creator=cat_keep-alive.json5 b/frontend/test/tapes/search/images/license_type=commercial&license=cc0&searchBy=creator&creator=cat_keep-alive.json5 deleted file mode 100644 index f5dba61131d..00000000000 --- a/frontend/test/tapes/search/images/license_type=commercial&license=cc0&searchBy=creator&creator=cat_keep-alive.json5 +++ /dev/null @@ -1,1316 +0,0 @@ -{ - meta: { - createdAt: '2022-03-28T15:05:41.332Z', - host: 'https://api.openverse.engineering', - resHumanReadable: true, - resUncompressed: true, - }, - req: { - headers: { - connection: 'keep-alive', - pragma: 'no-cache', - 'cache-control': 'no-cache', - 'sec-ch-ua': '', - accept: 'application/json, text/plain, */*', - 'sec-ch-ua-mobile': '?0', - 'sec-ch-ua-platform': '', - 'sec-fetch-site': 'same-site', - 'sec-fetch-mode': 'cors', - 'sec-fetch-dest': 'empty', - referer: 'http://localhost:8443/', - 'accept-encoding': 'gzip, deflate, br', - }, - url: '/v1/images/?license_type=commercial&license=cc0&searchBy=creator&creator=cat', - method: 'GET', - body: '', - }, - res: { - status: 200, - headers: { - date: [ - 'Mon, 28 Mar 2022 15:05:41 GMT', - ], - 'content-type': [ - 'application/json', - ], - 'transfer-encoding': [ - 'chunked', - ], - connection: [ - 'keep-alive', - ], - vary: [ - 'Accept-Encoding, Accept, Authorization, Origin', - ], - allow: [ - 'GET, HEAD, OPTIONS', - ], - 'x-frame-options': [ - 'DENY', - ], - 'access-control-allow-origin': [ - '*', - ], - 'x-content-type-options': [ - 'nosniff', - ], - 'referrer-policy': [ - 'same-origin', - ], - 'cross-origin-opener-policy': [ - 'same-origin', - ], - 'cache-control': [ - 'max-age=14400', - ], - 'cf-cache-status': [ - 'HIT', - ], - age: [ - '102892', - ], - 'last-modified': [ - 'Sun, 27 Mar 2022 10:30:49 GMT', - ], - 'expect-ct': [ - 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', - ], - 'strict-transport-security': [ - 'max-age=15552000; includeSubDomains; preload', - ], - server: [ - 'cloudflare', - ], - 'cf-ray': [ - '6f3143f2accb1cd8-BUD', - ], - 'content-encoding': [ - 'br', - ], - 'alt-svc': [ - 'h3=":443"; ma=86400, h3-29=":443"; ma=86400', - ], - }, - body: { - result_count: 95, - page_count: 5, - page_size: 20, - page: 1, - results: [ - { - id: '65fcbef2-09bf-43e9-9908-bac9fe4b0489', - title: 'File:1964 Corgi Aston Martin DB5.jpg', - foreign_landing_url: 'https://commons.wikimedia.org/w/index.php?curid=15895561', - creator: "Schrodinger's cat is alive", - creator_url: 'https://commons.wikimedia.org/w/index.php?title=User:Schrodinger%27s_cat_is_alive&action=edit&redlink=1', - url: 'https://upload.wikimedia.org/wikipedia/commons/9/98/1964_Corgi_Aston_Martin_DB5.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/deed.en', - provider: 'wikimedia', - source: 'wikimedia', - category: null, - tags: [], - thumbnail: 'http://localhost:49153/v1/images/65fcbef2-09bf-43e9-9908-bac9fe4b0489/thumb/', - detail_url: 'http://localhost:49153/v1/images/65fcbef2-09bf-43e9-9908-bac9fe4b0489/', - related_url: 'http://localhost:49153/v1/images/65fcbef2-09bf-43e9-9908-bac9fe4b0489/related/', - }, - { - id: '3e96e7d4-56c3-452e-abce-468bf9609b8c', - title: 'red heart', - foreign_landing_url: 'https://www.flickr.com/photos/34608298@N05/49518632747', - creator: 'Cat Girl 007', - creator_url: 'https://www.flickr.com/photos/34608298@N05', - url: 'https://live.staticflickr.com/65535/49518632747_1e48b32df6.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'concept', - }, - { - name: 'design', - }, - { - name: 'graphic', - }, - { - name: 'heart', - }, - { - name: 'love', - }, - { - name: 'passion', - }, - { - name: 'red', - }, - { - name: 'shape', - }, - { - name: 'symbol', - }, - { - name: 'valentine', - }, - { - name: 'vector', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/3e96e7d4-56c3-452e-abce-468bf9609b8c/thumb/', - detail_url: 'http://localhost:49153/v1/images/3e96e7d4-56c3-452e-abce-468bf9609b8c/', - related_url: 'http://localhost:49153/v1/images/3e96e7d4-56c3-452e-abce-468bf9609b8c/related/', - }, - { - id: '7152fd26-4a48-4996-b25c-1691fc7c31b1', - title: "Bearded Wrestler in Evangelist's Tableau", - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38375627862', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4552/38375627862_dc229bd669_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'bearded', - }, - { - name: 'ben', - }, - { - name: 'big', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'morgan', - }, - { - name: 'performer', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'tableau', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - { - name: 'wrestler', - }, - { - name: 'wrestling', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/7152fd26-4a48-4996-b25c-1691fc7c31b1/thumb/', - detail_url: 'http://localhost:49153/v1/images/7152fd26-4a48-4996-b25c-1691fc7c31b1/', - related_url: 'http://localhost:49153/v1/images/7152fd26-4a48-4996-b25c-1691fc7c31b1/related/', - }, - { - id: '84a328b2-3575-4710-a0d4-53b403e82a67', - title: "Bearded Wrestler in Evangelist's Tableau", - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38407507441', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4567/38407507441_070406270c_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'bearded', - }, - { - name: 'ben', - }, - { - name: 'big', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'morgan', - }, - { - name: 'performer', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'tableau', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - { - name: 'wrestler', - }, - { - name: 'wrestling', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/84a328b2-3575-4710-a0d4-53b403e82a67/thumb/', - detail_url: 'http://localhost:49153/v1/images/84a328b2-3575-4710-a0d4-53b403e82a67/', - related_url: 'http://localhost:49153/v1/images/84a328b2-3575-4710-a0d4-53b403e82a67/related/', - }, - { - id: '074b64ba-1663-423b-ba8d-b20b0c4bb25e', - title: 'Two thumbs up', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/47556436921', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7861/47556436921_a562d472f4_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'actor', - }, - { - name: 'approval', - }, - { - name: 'approve', - }, - { - name: 'boy', - }, - { - name: 'cat', - }, - { - name: 'child', - }, - { - name: 'clippingpath', - }, - { - name: 'continue', - }, - { - name: 'critical', - }, - { - name: 'doubt', - }, - { - name: 'excellent', - }, - { - name: 'excited', - }, - { - name: 'facebook', - }, - { - name: 'finger', - }, - { - name: 'fist', - }, - { - name: 'good', - }, - { - name: 'great', - }, - { - name: 'hand', - }, - { - name: 'happy', - }, - { - name: 'isolated', - }, - { - name: 'isolatedonwhite', - }, - { - name: 'male', - }, - { - name: 'reason', - }, - { - name: 'research', - }, - { - name: 'skeptical', - }, - { - name: 'skepticism', - }, - { - name: 'skeptics', - }, - { - name: 'smile', - }, - { - name: 'thinking', - }, - { - name: 'thumb', - }, - { - name: 'twitter', - }, - { - name: 'up', - }, - { - name: 'vaccines', - }, - { - name: 'white', - }, - { - name: 'woo', - }, - { - name: 'yes', - }, - { - name: 'youth', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/074b64ba-1663-423b-ba8d-b20b0c4bb25e/thumb/', - detail_url: 'http://localhost:49153/v1/images/074b64ba-1663-423b-ba8d-b20b0c4bb25e/', - related_url: 'http://localhost:49153/v1/images/074b64ba-1663-423b-ba8d-b20b0c4bb25e/related/', - }, - { - id: '2c63dc0b-c1af-4557-8be9-141523cf6275', - title: 'Evangelist Pleads for Funds to Fight Suit', - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38407506091', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4573/38407506091_caeeaf808a_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/2c63dc0b-c1af-4557-8be9-141523cf6275/thumb/', - detail_url: 'http://localhost:49153/v1/images/2c63dc0b-c1af-4557-8be9-141523cf6275/', - related_url: 'http://localhost:49153/v1/images/2c63dc0b-c1af-4557-8be9-141523cf6275/related/', - }, - { - id: 'bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b', - title: 'Evangelist Pleads for Funds to Fight Suit', - foreign_landing_url: 'https://www.flickr.com/photos/79761301@N00/38375625562', - creator: 'jericl cat', - creator_url: 'https://www.flickr.com/photos/79761301@N00', - url: 'https://live.staticflickr.com/4529/38375625562_df700efabe_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: '1937', - }, - { - name: 'aimee', - }, - { - name: 'angelus', - }, - { - name: 'church', - }, - { - name: 'crawford', - }, - { - name: 'evangelism', - }, - { - name: 'evangelist', - }, - { - name: 'foursquare', - }, - { - name: 'losangeles', - }, - { - name: 'mcpherson', - }, - { - name: 'photo', - }, - { - name: 'press', - }, - { - name: 'rheba', - }, - { - name: 'semple', - }, - { - name: 'sister', - }, - { - name: 'slander', - }, - { - name: 'ssocaited', - }, - { - name: 'suit', - }, - { - name: 'temple', - }, - { - name: 'vintage', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b/thumb/', - detail_url: 'http://localhost:49153/v1/images/bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b/', - related_url: 'http://localhost:49153/v1/images/bb6a5828-81a6-4ad5-bb6d-e75b9bb6f12b/related/', - }, - { - id: '35fa78c8-26a0-4354-aabf-582e35c0a38c', - title: 'unscientific american', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/33540654738', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7847/33540654738_dd70e86408_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'american', - }, - { - name: 'autism', - }, - { - name: 'critical', - }, - { - name: 'donald', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'trump', - }, - { - name: 'unscientific', - }, - { - name: 'vaccines', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/35fa78c8-26a0-4354-aabf-582e35c0a38c/thumb/', - detail_url: 'http://localhost:49153/v1/images/35fa78c8-26a0-4354-aabf-582e35c0a38c/', - related_url: 'http://localhost:49153/v1/images/35fa78c8-26a0-4354-aabf-582e35c0a38c/related/', - }, - { - id: 'c5e6027a-1580-42bb-beee-8ffba110623d', - title: 'Capt Planet', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/32474398837', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7847/32474398837_b9b7e9efe1.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'antivaccine', - }, - { - name: 'critical', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'vaccines', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/c5e6027a-1580-42bb-beee-8ffba110623d/thumb/', - detail_url: 'http://localhost:49153/v1/images/c5e6027a-1580-42bb-beee-8ffba110623d/', - related_url: 'http://localhost:49153/v1/images/c5e6027a-1580-42bb-beee-8ffba110623d/related/', - }, - { - id: '7216e7de-0c55-4236-bb4d-c99046767ce3', - title: 'christopher hitchens essence of independant mind', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/46833019274', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7912/46833019274_7bbc987387_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'cat', - }, - { - name: 'christopher', - }, - { - name: 'critical', - }, - { - name: 'hitchens', - }, - { - name: 'independant', - }, - { - name: 'quote', - }, - { - name: 'reason', - }, - { - name: 'road', - }, - { - name: 'skeptical', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'thought', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/7216e7de-0c55-4236-bb4d-c99046767ce3/thumb/', - detail_url: 'http://localhost:49153/v1/images/7216e7de-0c55-4236-bb4d-c99046767ce3/', - related_url: 'http://localhost:49153/v1/images/7216e7de-0c55-4236-bb4d-c99046767ce3/related/', - }, - { - id: '8c04dfd6-a0c3-4e6e-a3c8-6dc01b54d8be', - title: 'Scotland best holiday', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/46693259304', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7901/46693259304_7ebf405311.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'aliens', - }, - { - name: 'bigfoot', - }, - { - name: 'critical', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'scotland', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'vacation', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/8c04dfd6-a0c3-4e6e-a3c8-6dc01b54d8be/thumb/', - detail_url: 'http://localhost:49153/v1/images/8c04dfd6-a0c3-4e6e-a3c8-6dc01b54d8be/', - related_url: 'http://localhost:49153/v1/images/8c04dfd6-a0c3-4e6e-a3c8-6dc01b54d8be/related/', - }, - { - id: 'f8e2b234-a56c-4c1f-8202-2dd954bb9f2c', - title: 'steals a cow', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/40450951363', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7924/40450951363_6762860d49.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'abduction', - }, - { - name: 'alien', - }, - { - name: 'cow', - }, - { - name: 'critical', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/f8e2b234-a56c-4c1f-8202-2dd954bb9f2c/thumb/', - detail_url: 'http://localhost:49153/v1/images/f8e2b234-a56c-4c1f-8202-2dd954bb9f2c/', - related_url: 'http://localhost:49153/v1/images/f8e2b234-a56c-4c1f-8202-2dd954bb9f2c/related/', - }, - { - id: 'a68b6633-f947-4aeb-96e9-6afc4f96b29b', - title: '6 minutes watching youtube videos', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/46640940625', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7839/46640940625_03845af467_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'cat', - }, - { - name: 'critical', - }, - { - name: 'doubt', - }, - { - name: 'facebook', - }, - { - name: 'reason', - }, - { - name: 'research', - }, - { - name: 'skeptical', - }, - { - name: 'skepticism', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'twitter', - }, - { - name: 'vaccines', - }, - { - name: 'woo', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/a68b6633-f947-4aeb-96e9-6afc4f96b29b/thumb/', - detail_url: 'http://localhost:49153/v1/images/a68b6633-f947-4aeb-96e9-6afc4f96b29b/', - related_url: 'http://localhost:49153/v1/images/a68b6633-f947-4aeb-96e9-6afc4f96b29b/related/', - }, - { - id: '9a141b70-8929-42dc-a9ee-f75d01e6c299', - title: 'Health Experts warn', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/32474404897', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7910/32474404897_0bc159c6a5.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'critical', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'pesticides', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/9a141b70-8929-42dc-a9ee-f75d01e6c299/thumb/', - detail_url: 'http://localhost:49153/v1/images/9a141b70-8929-42dc-a9ee-f75d01e6c299/', - related_url: 'http://localhost:49153/v1/images/9a141b70-8929-42dc-a9ee-f75d01e6c299/related/', - }, - { - id: '44156a42-a8e3-4597-8df2-e3a1da9fd30a', - title: 'Chopra Word Salad', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/46693200584', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7816/46693200584_b7a5f9dbf3_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'chopra', - }, - { - name: 'critical', - }, - { - name: 'deepak', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/44156a42-a8e3-4597-8df2-e3a1da9fd30a/thumb/', - detail_url: 'http://localhost:49153/v1/images/44156a42-a8e3-4597-8df2-e3a1da9fd30a/', - related_url: 'http://localhost:49153/v1/images/44156a42-a8e3-4597-8df2-e3a1da9fd30a/related/', - }, - { - id: '52109f17-1ff8-4e51-94de-658eb1236af3', - title: 'Satellites pointing away from earth', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/47416432851', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7871/47416432851_e806b6a5a1_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'aliens', - }, - { - name: 'critical', - }, - { - name: 'funny', - }, - { - name: 'life', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'satelite', - }, - { - name: 'science', - }, - { - name: 'search', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/52109f17-1ff8-4e51-94de-658eb1236af3/thumb/', - detail_url: 'http://localhost:49153/v1/images/52109f17-1ff8-4e51-94de-658eb1236af3/', - related_url: 'http://localhost:49153/v1/images/52109f17-1ff8-4e51-94de-658eb1236af3/related/', - }, - { - id: 'a4d2f66c-f671-41c3-a708-1ce00fb3c156', - title: 'Gallivare', - foreign_landing_url: 'https://www.flickr.com/photos/38335258@N04/27632154648', - creator: 'Julay Cat', - creator_url: 'https://www.flickr.com/photos/38335258@N04', - url: 'https://live.staticflickr.com/797/27632154648_2d1fdd6c32_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'countriside', - }, - { - name: 'forest', - }, - { - name: 'lake', - }, - { - name: 'landscape', - }, - { - name: 'river', - }, - { - name: 'sky', - }, - { - name: 'trees', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/a4d2f66c-f671-41c3-a708-1ce00fb3c156/thumb/', - detail_url: 'http://localhost:49153/v1/images/a4d2f66c-f671-41c3-a708-1ce00fb3c156/', - related_url: 'http://localhost:49153/v1/images/a4d2f66c-f671-41c3-a708-1ce00fb3c156/related/', - }, - { - id: '5cecfa32-cfe2-4f9f-b9ff-55288c5876f3', - title: 'Charge More for Tomates', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/46501225705', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7827/46501225705_97dee10945_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'critical', - }, - { - name: 'food', - }, - { - name: 'funny', - }, - { - name: 'gmo', - }, - { - name: 'memes', - }, - { - name: 'organic', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'tomatoes', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/5cecfa32-cfe2-4f9f-b9ff-55288c5876f3/thumb/', - detail_url: 'http://localhost:49153/v1/images/5cecfa32-cfe2-4f9f-b9ff-55288c5876f3/', - related_url: 'http://localhost:49153/v1/images/5cecfa32-cfe2-4f9f-b9ff-55288c5876f3/related/', - }, - { - id: '0a229492-787f-4497-9d8f-3249186bf4e7', - title: 'taken from ISIS', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/46693279104', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7898/46693279104_b2263745e0.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'astronaut', - }, - { - name: 'critical', - }, - { - name: 'earth', - }, - { - name: 'flat', - }, - { - name: 'funny', - }, - { - name: 'memes', - }, - { - name: 'nasa', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/0a229492-787f-4497-9d8f-3249186bf4e7/thumb/', - detail_url: 'http://localhost:49153/v1/images/0a229492-787f-4497-9d8f-3249186bf4e7/', - related_url: 'http://localhost:49153/v1/images/0a229492-787f-4497-9d8f-3249186bf4e7/related/', - }, - { - id: '3984ebd9-eca7-4fe3-9a3b-908de900edbb', - title: 'hierarchy of evidence', - foreign_landing_url: 'https://www.flickr.com/photos/146303603@N04/40450892043', - creator: 'Skeptical Cat', - creator_url: 'https://www.flickr.com/photos/146303603@N04', - url: 'https://live.staticflickr.com/7872/40450892043_4fe244e8a1_b.jpg', - license: 'cc0', - license_version: '1.0', - license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', - provider: 'flickr', - source: 'flickr', - category: null, - tags: [ - { - name: 'critical', - }, - { - name: 'funny', - }, - { - name: 'hierarchy', - }, - { - name: 'memes', - }, - { - name: 'pseudoscience', - }, - { - name: 'science', - }, - { - name: 'skeptics', - }, - { - name: 'thinking', - }, - { - name: 'triangle', - }, - ], - thumbnail: 'http://localhost:49153/v1/images/3984ebd9-eca7-4fe3-9a3b-908de900edbb/thumb/', - detail_url: 'http://localhost:49153/v1/images/3984ebd9-eca7-4fe3-9a3b-908de900edbb/', - related_url: 'http://localhost:49153/v1/images/3984ebd9-eca7-4fe3-9a3b-908de900edbb/related/', - }, - ], - }, - }, -} \ No newline at end of file diff --git a/frontend/test/tapes/search/images/q=cat&extension=jpg_close.json5 b/frontend/test/tapes/search/images/q=cat&extension=jpg_close.json5 new file mode 100644 index 00000000000..e42ab07a5ac --- /dev/null +++ b/frontend/test/tapes/search/images/q=cat&extension=jpg_close.json5 @@ -0,0 +1,892 @@ +{ + meta: { + createdAt: '2023-10-05T02:59:06.997Z', + host: 'https://api.openverse.engineering', + resHumanReadable: true, + }, + req: { + headers: { + connection: 'close', + }, + url: '/v1/images/?q=cat&extension=jpg,png,gif,svg', + method: 'GET', + body: '', + }, + res: { + status: 200, + headers: { + date: [ + 'Thu, 05 Oct 2023 02:59:08 GMT', + ], + 'content-type': [ + 'application/json', + ], + 'transfer-encoding': [ + 'chunked', + ], + connection: [ + 'close', + ], + vary: [ + 'Accept-Encoding, Accept, Authorization, origin', + ], + allow: [ + 'GET, HEAD, OPTIONS', + ], + 'x-ratelimit-limit-anon_burst': [ + '5/hour', + ], + 'x-ratelimit-available-anon_burst': [ + '4', + ], + 'x-ratelimit-limit-anon_sustained': [ + '100/day', + ], + 'x-ratelimit-available-anon_sustained': [ + '99', + ], + 'x-ratelimit-limit-anon_thumbnail': [ + '150/minute', + ], + 'x-ratelimit-available-anon_thumbnail': [ + '149', + ], + 'x-frame-options': [ + 'DENY', + ], + 'x-content-type-options': [ + 'nosniff', + ], + 'referrer-policy': [ + 'same-origin', + ], + 'cross-origin-opener-policy': [ + 'same-origin', + ], + 'x-request-id': [ + '6e6b1388d1dc4890a5deb7988f47e65d', + ], + 'cache-control': [ + 'max-age=14400', + ], + 'cf-cache-status': [ + 'MISS', + ], + 'last-modified': [ + 'Thu, 05 Oct 2023 02:59:08 GMT', + ], + 'strict-transport-security': [ + 'max-age=15552000; includeSubDomains; preload', + ], + server: [ + 'cloudflare', + ], + 'cf-ray': [ + '81126821ee1c26f8-OTP', + ], + 'alt-svc': [ + 'h3=":443"; ma=86400', + ], + }, + body: { + result_count: 10000, + page_count: 20, + page_size: 20, + page: 1, + results: [ + { + id: 'f9384235-b72e-4f1e-9b05-e1b116262a29', + title: 'Cat', + indexed_on: '2020-04-05T06:07:19.339195Z', + foreign_landing_url: 'https://www.flickr.com/photos/7788419@N05/15218475961', + url: 'https://live.staticflickr.com/3903/15218475961_963a4c116e_b.jpg', + creator: 'strogoscope', + creator_url: 'https://www.flickr.com/photos/7788419@N05', + license: 'by', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Cat" by strogoscope is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 678, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/f9384235-b72e-4f1e-9b05-e1b116262a29/thumb/', + detail_url: 'http://localhost:49153/v1/images/f9384235-b72e-4f1e-9b05-e1b116262a29/', + related_url: 'http://localhost:49153/v1/images/f9384235-b72e-4f1e-9b05-e1b116262a29/related/', + unstable__sensitivity: [], + }, + { + id: 'b9bbd2be-a68e-4d2c-ad85-f43000cb8d55', + title: 'cat', + indexed_on: '2020-04-25T01:39:33.773553Z', + foreign_landing_url: 'https://www.flickr.com/photos/93665474@N00/3717404325', + url: 'https://live.staticflickr.com/3436/3717404325_db41d8d687_b.jpg', + creator: 'Alex Balan', + creator_url: 'https://www.flickr.com/photos/93665474@N00', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'animals', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'cats', + accuracy: null, + }, + { + name: 'lovely', + accuracy: null, + }, + { + name: 'pets', + accuracy: null, + }, + ], + attribution: '"cat" by Alex Balan is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/b9bbd2be-a68e-4d2c-ad85-f43000cb8d55/thumb/', + detail_url: 'http://localhost:49153/v1/images/b9bbd2be-a68e-4d2c-ad85-f43000cb8d55/', + related_url: 'http://localhost:49153/v1/images/b9bbd2be-a68e-4d2c-ad85-f43000cb8d55/related/', + unstable__sensitivity: [], + }, + { + id: '06e72ec0-b67e-4c41-853c-2b6798f0fc89', + title: 'cat', + indexed_on: '2018-11-08T01:45:17.652714Z', + foreign_landing_url: 'https://www.flickr.com/photos/7664470@N05/2319638358', + url: 'https://live.staticflickr.com/2353/2319638358_a5f14ae004_b.jpg', + creator: 'gney', + creator_url: 'https://www.flickr.com/photos/7664470@N05', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'goldstaraward', + accuracy: null, + }, + ], + attribution: '"cat" by gney is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/06e72ec0-b67e-4c41-853c-2b6798f0fc89/thumb/', + detail_url: 'http://localhost:49153/v1/images/06e72ec0-b67e-4c41-853c-2b6798f0fc89/', + related_url: 'http://localhost:49153/v1/images/06e72ec0-b67e-4c41-853c-2b6798f0fc89/related/', + unstable__sensitivity: [], + }, + { + id: '14463e0e-cff5-4872-9085-7b8d9a251344', + title: 'CAT', + indexed_on: '2020-04-16T09:45:21.423375Z', + foreign_landing_url: 'https://www.flickr.com/photos/21644167@N04/8710251481', + url: 'https://live.staticflickr.com/8417/8710251481_139d32a3a2_b.jpg', + creator: 'Bahman Farzad', + creator_url: 'https://www.flickr.com/photos/21644167@N04', + license: 'by', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"CAT" by Bahman Farzad is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 682, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/14463e0e-cff5-4872-9085-7b8d9a251344/thumb/', + detail_url: 'http://localhost:49153/v1/images/14463e0e-cff5-4872-9085-7b8d9a251344/', + related_url: 'http://localhost:49153/v1/images/14463e0e-cff5-4872-9085-7b8d9a251344/related/', + unstable__sensitivity: [], + }, + { + id: 'a6dd2414-7695-4f03-9723-a9dc6852e2b3', + title: 'Cat', + indexed_on: '2018-11-08T01:45:17.652714Z', + foreign_landing_url: 'https://www.flickr.com/photos/23001707@N04/2207159142', + url: 'https://live.staticflickr.com/2106/2207159142_8206ab6984.jpg', + creator: 'Lilithis', + creator_url: 'https://www.flickr.com/photos/23001707@N04', + license: 'by-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Cat" by Lilithis is licensed under CC BY-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 500, + width: 334, + thumbnail: 'http://localhost:49153/v1/images/a6dd2414-7695-4f03-9723-a9dc6852e2b3/thumb/', + detail_url: 'http://localhost:49153/v1/images/a6dd2414-7695-4f03-9723-a9dc6852e2b3/', + related_url: 'http://localhost:49153/v1/images/a6dd2414-7695-4f03-9723-a9dc6852e2b3/related/', + unstable__sensitivity: [], + }, + { + id: 'e5f45f85-c0c6-4b6c-97e3-19e9c3d92128', + title: 'cat', + indexed_on: '2020-04-21T15:55:36.196610Z', + foreign_landing_url: 'https://www.flickr.com/photos/18090920@N07/4615217885', + url: 'https://live.staticflickr.com/3415/4615217885_0bf565318f_b.jpg', + creator: 'Sean MacEntee', + creator_url: 'https://www.flickr.com/photos/18090920@N07', + license: 'by', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"cat" by Sean MacEntee is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/e5f45f85-c0c6-4b6c-97e3-19e9c3d92128/thumb/', + detail_url: 'http://localhost:49153/v1/images/e5f45f85-c0c6-4b6c-97e3-19e9c3d92128/', + related_url: 'http://localhost:49153/v1/images/e5f45f85-c0c6-4b6c-97e3-19e9c3d92128/related/', + unstable__sensitivity: [], + }, + { + id: '71533543-f4f3-4391-aacb-137586407b1b', + title: 'Cats', + indexed_on: '2020-04-24T03:31:30.926745Z', + foreign_landing_url: 'https://www.flickr.com/photos/51609867@N00/3338275165', + url: 'https://live.staticflickr.com/3594/3338275165_b00171c504_b.jpg', + creator: 'anderoo', + creator_url: 'https://www.flickr.com/photos/51609867@N00', + license: 'by-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cats', + accuracy: null, + }, + ], + attribution: '"Cats" by anderoo is licensed under CC BY-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/71533543-f4f3-4391-aacb-137586407b1b/thumb/', + detail_url: 'http://localhost:49153/v1/images/71533543-f4f3-4391-aacb-137586407b1b/', + related_url: 'http://localhost:49153/v1/images/71533543-f4f3-4391-aacb-137586407b1b/related/', + unstable__sensitivity: [], + }, + { + id: 'f94097cc-b971-4276-94f2-8f7a6877ee81', + title: 'cat', + indexed_on: '2020-04-21T15:55:36.196610Z', + foreign_landing_url: 'https://www.flickr.com/photos/18090920@N07/4615211501', + url: 'https://live.staticflickr.com/4067/4615211501_f0cee1c22b_b.jpg', + creator: 'Sean MacEntee', + creator_url: 'https://www.flickr.com/photos/18090920@N07', + license: 'by', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"cat" by Sean MacEntee is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/f94097cc-b971-4276-94f2-8f7a6877ee81/thumb/', + detail_url: 'http://localhost:49153/v1/images/f94097cc-b971-4276-94f2-8f7a6877ee81/', + related_url: 'http://localhost:49153/v1/images/f94097cc-b971-4276-94f2-8f7a6877ee81/related/', + unstable__sensitivity: [], + }, + { + id: 'df5e18ed-f936-4e46-93ba-dcc4ef0d7000', + title: 'CAT', + indexed_on: '2018-12-21T12:34:40.573425Z', + foreign_landing_url: 'https://www.flickr.com/photos/21644167@N04/8711378816', + url: 'https://live.staticflickr.com/8280/8711378816_39cc228e5c_b.jpg', + creator: 'Bahman Farzad', + creator_url: 'https://www.flickr.com/photos/21644167@N04', + license: 'by', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"CAT" by Bahman Farzad is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 671, + width: 1022, + thumbnail: 'http://localhost:49153/v1/images/df5e18ed-f936-4e46-93ba-dcc4ef0d7000/thumb/', + detail_url: 'http://localhost:49153/v1/images/df5e18ed-f936-4e46-93ba-dcc4ef0d7000/', + related_url: 'http://localhost:49153/v1/images/df5e18ed-f936-4e46-93ba-dcc4ef0d7000/related/', + unstable__sensitivity: [], + }, + { + id: 'de42d499-d660-47b4-b203-28d5589c31d2', + title: 'Cat bliss', + indexed_on: '2020-04-16T18:12:29.554388Z', + foreign_landing_url: 'https://www.flickr.com/photos/29468339@N02/5840168826', + url: 'https://live.staticflickr.com/2706/5840168826_486f364c6c_b.jpg', + creator: '@Doug88888', + creator_url: 'https://www.flickr.com/photos/29468339@N02', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'bliss', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'cating', + accuracy: null, + }, + { + name: 'cats', + accuracy: null, + }, + ], + attribution: '"Cat bliss" by @Doug88888 is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 819, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/de42d499-d660-47b4-b203-28d5589c31d2/thumb/', + detail_url: 'http://localhost:49153/v1/images/de42d499-d660-47b4-b203-28d5589c31d2/', + related_url: 'http://localhost:49153/v1/images/de42d499-d660-47b4-b203-28d5589c31d2/related/', + unstable__sensitivity: [], + }, + { + id: '5df4d187-de5f-4fd4-a0c7-f6ceb388983d', + title: 'Cats', + indexed_on: '2020-04-26T06:31:30.461974Z', + foreign_landing_url: 'https://www.flickr.com/photos/82056689@N00/4227907168', + url: 'https://live.staticflickr.com/2734/4227907168_3574201e36.jpg', + creator: 'CatladyOfSweden', + creator_url: 'https://www.flickr.com/photos/82056689@N00', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cats', + accuracy: null, + }, + ], + attribution: '"Cats" by CatladyOfSweden is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 375, + width: 500, + thumbnail: 'http://localhost:49153/v1/images/5df4d187-de5f-4fd4-a0c7-f6ceb388983d/thumb/', + detail_url: 'http://localhost:49153/v1/images/5df4d187-de5f-4fd4-a0c7-f6ceb388983d/', + related_url: 'http://localhost:49153/v1/images/5df4d187-de5f-4fd4-a0c7-f6ceb388983d/related/', + unstable__sensitivity: [], + }, + { + id: 'aafaf91c-4d64-4f2e-b8ec-d7e77131b888', + title: 'Cat on the sofa', + indexed_on: '2018-11-08T17:31:32.467511Z', + foreign_landing_url: 'https://www.flickr.com/photos/57443751@N07/6494613787', + url: 'https://live.staticflickr.com/7004/6494613787_9a3031fa7d_b.jpg', + creator: 'sushiraider', + creator_url: 'https://www.flickr.com/photos/57443751@N07', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'cats', + accuracy: null, + }, + { + name: 'chat', + accuracy: null, + }, + { + name: 'ringexcellence', + accuracy: null, + }, + { + name: 'sofa', + accuracy: null, + }, + ], + attribution: '"Cat on the sofa" by sushiraider is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 684, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/aafaf91c-4d64-4f2e-b8ec-d7e77131b888/thumb/', + detail_url: 'http://localhost:49153/v1/images/aafaf91c-4d64-4f2e-b8ec-d7e77131b888/', + related_url: 'http://localhost:49153/v1/images/aafaf91c-4d64-4f2e-b8ec-d7e77131b888/related/', + unstable__sensitivity: [], + }, + { + id: '1c5442f6-6bb6-4ab7-b603-f598e7579dd2', + title: 'Cat Fish 2', + indexed_on: '2020-04-24T11:47:34.004529Z', + foreign_landing_url: 'https://www.flickr.com/photos/32426194@N00/3481540500', + url: 'https://live.staticflickr.com/3313/3481540500_c846c62863_b.jpg', + creator: 'admiller', + creator_url: 'https://www.flickr.com/photos/32426194@N00', + license: 'by', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'cat', + accuracy: 0.90604, + }, + { + name: 'glass', + accuracy: 0.95701, + }, + { + name: 'one', + accuracy: 0.94012, + }, + ], + attribution: '"Cat Fish 2" by admiller is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 716, + thumbnail: 'http://localhost:49153/v1/images/1c5442f6-6bb6-4ab7-b603-f598e7579dd2/thumb/', + detail_url: 'http://localhost:49153/v1/images/1c5442f6-6bb6-4ab7-b603-f598e7579dd2/', + related_url: 'http://localhost:49153/v1/images/1c5442f6-6bb6-4ab7-b603-f598e7579dd2/related/', + unstable__sensitivity: [], + }, + { + id: '812ca736-2128-4652-aa36-2095cc23d359', + title: 'Cat Belgium', + indexed_on: '2020-04-09T23:24:25.426691Z', + foreign_landing_url: 'https://www.flickr.com/photos/45820171@N08/9806556103', + url: 'https://live.staticflickr.com/5479/9806556103_bb21b3f223_b.jpg', + creator: 'Chau kar', + creator_url: 'https://www.flickr.com/photos/45820171@N08', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Cat Belgium" by Chau kar is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/812ca736-2128-4652-aa36-2095cc23d359/thumb/', + detail_url: 'http://localhost:49153/v1/images/812ca736-2128-4652-aa36-2095cc23d359/', + related_url: 'http://localhost:49153/v1/images/812ca736-2128-4652-aa36-2095cc23d359/related/', + unstable__sensitivity: [], + }, + { + id: '1aa5017d-58f3-4198-b97e-1d2cf9bf6cae', + title: 'A neighbor obliged with a photo of himself and a beautiful if not petrified stray cat he adopted', + indexed_on: '2020-04-29T08:38:32.017281Z', + foreign_landing_url: 'https://www.flickr.com/photos/23697838@N07/3007439456', + url: 'https://live.staticflickr.com/3286/3007439456_522e170a60_b.jpg', + creator: 'aliceinthepoetsheartland', + creator_url: 'https://www.flickr.com/photos/23697838@N07', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"A neighbor obliged with a photo of himself and a beautiful if not petrified stray cat he adopted" by aliceinthepoetsheartland is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 768, + thumbnail: 'http://localhost:49153/v1/images/1aa5017d-58f3-4198-b97e-1d2cf9bf6cae/thumb/', + detail_url: 'http://localhost:49153/v1/images/1aa5017d-58f3-4198-b97e-1d2cf9bf6cae/', + related_url: 'http://localhost:49153/v1/images/1aa5017d-58f3-4198-b97e-1d2cf9bf6cae/related/', + unstable__sensitivity: [], + }, + { + id: 'e6d6b916-ea50-4ade-9c23-283fa6e3dd6b', + title: 'Home cat', + indexed_on: '2018-11-08T01:45:17.652714Z', + foreign_landing_url: 'https://www.flickr.com/photos/27429206@N02/2938234278', + url: 'https://live.staticflickr.com/3015/2938234278_7f641cd6ce_b.jpg', + creator: 'Vladimir Morozov', + creator_url: 'https://www.flickr.com/photos/27429206@N02', + license: 'by', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'portrait', + accuracy: null, + }, + ], + attribution: '"Home cat" by Vladimir Morozov is licensed under CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 771, + thumbnail: 'http://localhost:49153/v1/images/e6d6b916-ea50-4ade-9c23-283fa6e3dd6b/thumb/', + detail_url: 'http://localhost:49153/v1/images/e6d6b916-ea50-4ade-9c23-283fa6e3dd6b/', + related_url: 'http://localhost:49153/v1/images/e6d6b916-ea50-4ade-9c23-283fa6e3dd6b/related/', + unstable__sensitivity: [], + }, + { + id: '5c917852-6dad-4c43-b823-35a23e83fc55', + title: 'Cat', + indexed_on: '2020-04-12T06:45:19.981961Z', + foreign_landing_url: 'https://www.flickr.com/photos/29468339@N02/7181651234', + url: 'https://live.staticflickr.com/8160/7181651234_0399dbb372_b.jpg', + creator: '@Doug88888', + creator_url: 'https://www.flickr.com/photos/29468339@N02', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'drhwk7gallery', + accuracy: null, + }, + ], + attribution: '"Cat" by @Doug88888 is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/5c917852-6dad-4c43-b823-35a23e83fc55/thumb/', + detail_url: 'http://localhost:49153/v1/images/5c917852-6dad-4c43-b823-35a23e83fc55/', + related_url: 'http://localhost:49153/v1/images/5c917852-6dad-4c43-b823-35a23e83fc55/related/', + unstable__sensitivity: [], + }, + { + id: '4f3e81d8-705e-400a-aaf2-11d509886a72', + title: 'Cat', + indexed_on: '2020-04-04T22:54:22.978971Z', + foreign_landing_url: 'https://www.flickr.com/photos/57563162@N02/14962688165', + url: 'https://live.staticflickr.com/3894/14962688165_04759a8b03_b.jpg', + creator: 'tomhouslay', + creator_url: 'https://www.flickr.com/photos/57563162@N02', + license: 'by-nc', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + ], + attribution: '"Cat" by tomhouslay is licensed under CC BY-NC 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 838, + thumbnail: 'http://localhost:49153/v1/images/4f3e81d8-705e-400a-aaf2-11d509886a72/thumb/', + detail_url: 'http://localhost:49153/v1/images/4f3e81d8-705e-400a-aaf2-11d509886a72/', + related_url: 'http://localhost:49153/v1/images/4f3e81d8-705e-400a-aaf2-11d509886a72/related/', + unstable__sensitivity: [], + }, + { + id: '864ce10a-3b6a-4f8f-808a-b8de1f7cc78a', + title: 'Cat', + indexed_on: '2020-04-17T11:13:22.782810Z', + foreign_landing_url: 'https://www.flickr.com/photos/20442663@N00/6113519191', + url: 'https://live.staticflickr.com/6090/6113519191_db826056a1_b.jpg', + creator: 'Squirmelia', + creator_url: 'https://www.flickr.com/photos/20442663@N00', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Cat" by Squirmelia is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 678, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/864ce10a-3b6a-4f8f-808a-b8de1f7cc78a/thumb/', + detail_url: 'http://localhost:49153/v1/images/864ce10a-3b6a-4f8f-808a-b8de1f7cc78a/', + related_url: 'http://localhost:49153/v1/images/864ce10a-3b6a-4f8f-808a-b8de1f7cc78a/related/', + unstable__sensitivity: [], + }, + { + id: '2dadce9f-6567-45ab-9b96-10eb9eeb5a1c', + title: 'Cat', + indexed_on: '2020-04-28T18:41:32.819503Z', + foreign_landing_url: 'https://www.flickr.com/photos/23657985@N03/2787209562', + url: 'https://live.staticflickr.com/3010/2787209562_0604206807_b.jpg', + creator: 'PiNe87', + creator_url: 'https://www.flickr.com/photos/23657985@N03', + license: 'by-nc-sa', + license_version: '2.0', + license_url: 'https://creativecommons.org/licenses/by-nc-sa/2.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Cat" by PiNe87 is licensed under CC BY-NC-SA 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/2.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/2dadce9f-6567-45ab-9b96-10eb9eeb5a1c/thumb/', + detail_url: 'http://localhost:49153/v1/images/2dadce9f-6567-45ab-9b96-10eb9eeb5a1c/', + related_url: 'http://localhost:49153/v1/images/2dadce9f-6567-45ab-9b96-10eb9eeb5a1c/related/', + unstable__sensitivity: [], + }, + ], + }, + }, +} \ No newline at end of file diff --git a/frontend/test/tapes/search/images/q=cat&license_type=commercial&license=cc0_close.json5 b/frontend/test/tapes/search/images/q=cat&license_type=commercial&license=cc0_close.json5 new file mode 100644 index 00000000000..e83fb7cf778 --- /dev/null +++ b/frontend/test/tapes/search/images/q=cat&license_type=commercial&license=cc0_close.json5 @@ -0,0 +1,1941 @@ +{ + meta: { + createdAt: '2023-10-05T02:58:56.618Z', + host: 'https://api.openverse.engineering', + resHumanReadable: true, + }, + req: { + headers: { + connection: 'close', + }, + url: '/v1/images/?q=cat&license_type=commercial&license=cc0', + method: 'GET', + body: '', + }, + res: { + status: 200, + headers: { + date: [ + 'Thu, 05 Oct 2023 02:59:01 GMT', + ], + 'content-type': [ + 'application/json', + ], + 'transfer-encoding': [ + 'chunked', + ], + connection: [ + 'close', + ], + vary: [ + 'Accept-Encoding, Accept, Authorization, origin', + ], + allow: [ + 'GET, HEAD, OPTIONS', + ], + 'x-ratelimit-limit-anon_burst': [ + '5/hour', + ], + 'x-ratelimit-available-anon_burst': [ + '4', + ], + 'x-ratelimit-limit-anon_sustained': [ + '100/day', + ], + 'x-ratelimit-available-anon_sustained': [ + '99', + ], + 'x-ratelimit-limit-anon_thumbnail': [ + '150/minute', + ], + 'x-ratelimit-available-anon_thumbnail': [ + '149', + ], + 'x-frame-options': [ + 'DENY', + ], + 'x-content-type-options': [ + 'nosniff', + ], + 'referrer-policy': [ + 'same-origin', + ], + 'cross-origin-opener-policy': [ + 'same-origin', + ], + 'x-request-id': [ + '8ba1c7e061e24f3497d36ed46dbe8f45', + ], + 'cache-control': [ + 'max-age=14400', + ], + 'cf-cache-status': [ + 'MISS', + ], + 'last-modified': [ + 'Thu, 05 Oct 2023 02:59:01 GMT', + ], + 'strict-transport-security': [ + 'max-age=15552000; includeSubDomains; preload', + ], + server: [ + 'cloudflare', + ], + 'cf-ray': [ + '811267e12af10550-OTP', + ], + 'alt-svc': [ + 'h3=":443"; ma=86400', + ], + }, + body: { + result_count: 10000, + page_count: 20, + page_size: 20, + page: 1, + results: [ + { + id: '3431889d-59fb-46a4-a231-12652d1bc275', + title: 'cat', + indexed_on: '2020-03-22T13:18:31.555346Z', + foreign_landing_url: 'https://www.flickr.com/photos/105675854@N04/38268795194', + url: 'https://live.staticflickr.com/4642/38268795194_5861fd8b96_b.jpg', + creator: 'koiest', + creator_url: 'https://www.flickr.com/photos/105675854@N04', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: '길고양이', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'uae38uace0uc591uc774', + accuracy: null, + }, + ], + attribution: '"cat" by koiest is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/3431889d-59fb-46a4-a231-12652d1bc275/thumb/', + detail_url: 'http://localhost:49153/v1/images/3431889d-59fb-46a4-a231-12652d1bc275/', + related_url: 'http://localhost:49153/v1/images/3431889d-59fb-46a4-a231-12652d1bc275/related/', + unstable__sensitivity: [], + }, + { + id: '9ffc33cc-4633-4040-b270-ca87e3aa838f', + title: 'I wonder why I love this CAT - IMG_3475-002', + indexed_on: '2023-03-12T02:36:57.709071Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/52181630725', + url: 'https://live.staticflickr.com/65535/52181630725_cfbe283a43_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: 'photograph', + filesize: null, + filetype: 'jpg', + tags: [ + { + name: 'beautiful', + accuracy: null, + }, + { + name: 'black', + accuracy: null, + }, + { + name: 'blue', + accuracy: null, + }, + { + name: 'canoneos700d', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'catlovers', + accuracy: null, + }, + { + name: 'closeup', + accuracy: null, + }, + { + name: 'colorful', + accuracy: null, + }, + { + name: 'contrast', + accuracy: null, + }, + { + name: 'cute', + accuracy: null, + }, + { + name: 'eyes', + accuracy: null, + }, + { + name: 'green', + accuracy: null, + }, + { + name: 'iwonderwhyilovethiscat', + accuracy: null, + }, + { + name: 'ooops', + accuracy: null, + }, + { + name: 'orange', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'pink', + accuracy: null, + }, + { + name: 'portrait', + accuracy: null, + }, + { + name: 'thankyou', + accuracy: null, + }, + { + name: 'thinkpositive', + accuracy: null, + }, + { + name: 'turquoise', + accuracy: null, + }, + { + name: 'upsidedown', + accuracy: null, + }, + { + name: 'white', + accuracy: null, + }, + ], + attribution: '"I wonder why I love this CAT - IMG_3475-002" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/9ffc33cc-4633-4040-b270-ca87e3aa838f/thumb/', + detail_url: 'http://localhost:49153/v1/images/9ffc33cc-4633-4040-b270-ca87e3aa838f/', + related_url: 'http://localhost:49153/v1/images/9ffc33cc-4633-4040-b270-ca87e3aa838f/related/', + unstable__sensitivity: [], + }, + { + id: '62172841-c64c-460f-bdd8-d48fd2416d09', + title: 'cat', + indexed_on: '2020-03-22T13:18:31.555346Z', + foreign_landing_url: 'https://www.flickr.com/photos/105675854@N04/24119958367', + url: 'https://live.staticflickr.com/4568/24119958367_69117845b1_b.jpg', + creator: 'koiest', + creator_url: 'https://www.flickr.com/photos/105675854@N04', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: '길고양이', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'uae38uace0uc591uc774', + accuracy: null, + }, + ], + attribution: '"cat" by koiest is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/62172841-c64c-460f-bdd8-d48fd2416d09/thumb/', + detail_url: 'http://localhost:49153/v1/images/62172841-c64c-460f-bdd8-d48fd2416d09/', + related_url: 'http://localhost:49153/v1/images/62172841-c64c-460f-bdd8-d48fd2416d09/related/', + unstable__sensitivity: [], + }, + { + id: '57b8393a-7f20-43d6-a4fc-cf0d281d5f9a', + title: 'cat', + indexed_on: '2020-03-22T13:18:31.555346Z', + foreign_landing_url: 'https://www.flickr.com/photos/105675854@N04/25113442788', + url: 'https://live.staticflickr.com/4564/25113442788_fd65f85a2d_b.jpg', + creator: 'koiest', + creator_url: 'https://www.flickr.com/photos/105675854@N04', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: '길고양이', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'uae38uace0uc591uc774', + accuracy: null, + }, + ], + attribution: '"cat" by koiest is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/57b8393a-7f20-43d6-a4fc-cf0d281d5f9a/thumb/', + detail_url: 'http://localhost:49153/v1/images/57b8393a-7f20-43d6-a4fc-cf0d281d5f9a/', + related_url: 'http://localhost:49153/v1/images/57b8393a-7f20-43d6-a4fc-cf0d281d5f9a/related/', + unstable__sensitivity: [], + }, + { + id: '8542e2e8-8d9d-4340-932e-7069e807447f', + title: 'Don Juan cat serenade IMG_9619', + indexed_on: '2019-12-18T09:07:58.300213Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/49129860157', + url: 'https://live.staticflickr.com/65535/49129860157_af3b89886f_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'beautiful', + accuracy: null, + }, + { + name: 'black', + accuracy: null, + }, + { + name: 'canoneos700d', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'catslovers', + accuracy: null, + }, + { + name: 'charming', + accuracy: null, + }, + { + name: 'donjuancatsserenade', + accuracy: null, + }, + { + name: 'expression', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'funny', + accuracy: null, + }, + { + name: 'garden', + accuracy: null, + }, + { + name: 'grass', + accuracy: null, + }, + { + name: 'green', + accuracy: null, + }, + { + name: 'happy', + accuracy: null, + }, + { + name: 'happylife', + accuracy: null, + }, + { + name: 'high', + accuracy: null, + }, + { + name: 'light', + accuracy: null, + }, + { + name: 'lol', + accuracy: null, + }, + { + name: 'love', + accuracy: null, + }, + { + name: 'lovely', + accuracy: null, + }, + { + name: 'nice', + accuracy: null, + }, + { + name: 'orange', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'photo', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'seducing', + accuracy: null, + }, + { + name: 'thankyou', + accuracy: null, + }, + { + name: 'thinkpositive', + accuracy: null, + }, + ], + attribution: '"Don Juan cat serenade IMG_9619" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 684, + thumbnail: 'http://localhost:49153/v1/images/8542e2e8-8d9d-4340-932e-7069e807447f/thumb/', + detail_url: 'http://localhost:49153/v1/images/8542e2e8-8d9d-4340-932e-7069e807447f/', + related_url: 'http://localhost:49153/v1/images/8542e2e8-8d9d-4340-932e-7069e807447f/related/', + unstable__sensitivity: [], + }, + { + id: '630a45a0-d989-404e-a043-0305636568e7', + title: 'CAT Selfie by iezalel williams IMG_4904', + indexed_on: '2019-09-18T08:31:19.315552Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/48591817522', + url: 'https://live.staticflickr.com/65535/48591817522_f0d21cd880_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'abstract', + accuracy: null, + }, + { + name: 'animal', + accuracy: null, + }, + { + name: 'beautiful', + accuracy: null, + }, + { + name: 'beauty', + accuracy: null, + }, + { + name: 'black', + accuracy: null, + }, + { + name: 'blue', + accuracy: null, + }, + { + name: 'canoneos700d', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'closeup', + accuracy: null, + }, + { + name: 'cute', + accuracy: null, + }, + { + name: 'halfportrait', + accuracy: null, + }, + { + name: 'happylife', + accuracy: null, + }, + { + name: 'high', + accuracy: null, + }, + { + name: 'inhalf', + accuracy: null, + }, + { + name: 'light', + accuracy: null, + }, + { + name: 'love', + accuracy: null, + }, + { + name: 'lovely', + accuracy: null, + }, + { + name: 'natural', + accuracy: null, + }, + { + name: 'nature', + accuracy: null, + }, + { + name: 'nice', + accuracy: null, + }, + { + name: 'orange', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'photo', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'pink', + accuracy: null, + }, + { + name: 'selfie', + accuracy: null, + }, + { + name: 'thankyou', + accuracy: null, + }, + { + name: 'thinkpositive', + accuracy: null, + }, + { + name: 'white', + accuracy: null, + }, + { + name: 'yellow', + accuracy: null, + }, + ], + attribution: '"CAT Selfie by iezalel williams IMG_4904" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 684, + thumbnail: 'http://localhost:49153/v1/images/630a45a0-d989-404e-a043-0305636568e7/thumb/', + detail_url: 'http://localhost:49153/v1/images/630a45a0-d989-404e-a043-0305636568e7/', + related_url: 'http://localhost:49153/v1/images/630a45a0-d989-404e-a043-0305636568e7/related/', + unstable__sensitivity: [], + }, + { + id: '1f72c9e8-1942-4002-bd6c-a22d16a08f5e', + title: "Hallowe'en Abstract - X Ray Cat by iezalel williams IMG_0797-002", + indexed_on: '2020-01-02T08:27:45.939103Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/48845339758', + url: 'https://live.staticflickr.com/65535/48845339758_a80629ff0d_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'abstract', + accuracy: null, + }, + { + name: 'amazing', + accuracy: null, + }, + { + name: 'animal', + accuracy: null, + }, + { + name: 'beige', + accuracy: null, + }, + { + name: 'black', + accuracy: null, + }, + { + name: 'blue', + accuracy: null, + }, + { + name: 'canoneos700d', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'closeup', + accuracy: null, + }, + { + name: 'colorful', + accuracy: null, + }, + { + name: 'crazy', + accuracy: null, + }, + { + name: 'creative', + accuracy: null, + }, + { + name: 'creepy', + accuracy: null, + }, + { + name: 'eerie', + accuracy: null, + }, + { + name: 'effect', + accuracy: null, + }, + { + name: 'electricblue', + accuracy: null, + }, + { + name: 'energy', + accuracy: null, + }, + { + name: 'expression', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'ghostly', + accuracy: null, + }, + { + name: 'halloween', + accuracy: null, + }, + { + name: 'happylife', + accuracy: null, + }, + { + name: 'high', + accuracy: null, + }, + { + name: 'light', + accuracy: null, + }, + { + name: 'love', + accuracy: null, + }, + { + name: 'lovely', + accuracy: null, + }, + { + name: 'mysterious', + accuracy: null, + }, + { + name: 'nice', + accuracy: null, + }, + { + name: 'orange', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'pink', + accuracy: null, + }, + { + name: 'purple', + accuracy: null, + }, + { + name: 'scary', + accuracy: null, + }, + { + name: 'spooky', + accuracy: null, + }, + { + name: 'stange', + accuracy: null, + }, + { + name: 'thankyou', + accuracy: null, + }, + { + name: 'thinkpositive', + accuracy: null, + }, + { + name: 'uncanny', + accuracy: null, + }, + { + name: 'unearthly', + accuracy: null, + }, + { + name: 'vibration', + accuracy: null, + }, + { + name: 'weird', + accuracy: null, + }, + { + name: 'white', + accuracy: null, + }, + { + name: 'wow', + accuracy: null, + }, + { + name: 'xray', + accuracy: null, + }, + { + name: 'yellow', + accuracy: null, + }, + ], + attribution: '"Hallowe\'en Abstract - X Ray Cat by iezalel williams IMG_0797-002" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 684, + thumbnail: 'http://localhost:49153/v1/images/1f72c9e8-1942-4002-bd6c-a22d16a08f5e/thumb/', + detail_url: 'http://localhost:49153/v1/images/1f72c9e8-1942-4002-bd6c-a22d16a08f5e/', + related_url: 'http://localhost:49153/v1/images/1f72c9e8-1942-4002-bd6c-a22d16a08f5e/related/', + unstable__sensitivity: [], + }, + { + id: 'aba5bda0-04af-4f11-80c1-6224a2fb8c09', + title: 'Should I Stay or Should I go?!!! - Cat Arthur - DSCN6822', + indexed_on: '2023-03-10T13:01:20.749180Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/51566875862', + url: 'https://live.staticflickr.com/65535/51566875862_9b0e893475_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: 'photograph', + filesize: null, + filetype: 'jpg', + tags: [ + { + name: 'arthur', + accuracy: null, + }, + { + name: 'beautiful', + accuracy: null, + }, + { + name: 'beauty', + accuracy: null, + }, + { + name: 'black', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'catlover', + accuracy: null, + }, + { + name: 'closeup', + accuracy: null, + }, + { + name: 'cute', + accuracy: null, + }, + { + name: 'enjoy', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'funny', + accuracy: null, + }, + { + name: 'happylife', + accuracy: null, + }, + { + name: 'hurisadorableandyourphotisgreatandtellsthestoryilikethissong', + accuracy: null, + }, + { + name: 'indoor', + accuracy: null, + }, + { + name: 'light', + accuracy: null, + }, + { + name: 'love', + accuracy: null, + }, + { + name: 'lovely', + accuracy: null, + }, + { + name: 'natural', + accuracy: null, + }, + { + name: 'nikoncoolpixp900', + accuracy: null, + }, + { + name: 'photo', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'portrait', + accuracy: null, + }, + { + name: 'salute', + accuracy: null, + }, + { + name: 'shouldistayorshouldigonow', + accuracy: null, + }, + { + name: 'thankyou', + accuracy: null, + }, + { + name: 'theclash', + accuracy: null, + }, + { + name: 'thinkpositive', + accuracy: null, + }, + { + name: 'too', + accuracy: null, + }, + { + name: 'white', + accuracy: null, + }, + ], + attribution: '"Should I Stay or Should I go?!!! - Cat Arthur - DSCN6822" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/aba5bda0-04af-4f11-80c1-6224a2fb8c09/thumb/', + detail_url: 'http://localhost:49153/v1/images/aba5bda0-04af-4f11-80c1-6224a2fb8c09/', + related_url: 'http://localhost:49153/v1/images/aba5bda0-04af-4f11-80c1-6224a2fb8c09/related/', + unstable__sensitivity: [], + }, + { + id: '50afd9b9-c9eb-4665-89df-36ce304aa15e', + title: 'Cat', + indexed_on: '2019-07-13T08:18:54.299394Z', + foreign_landing_url: 'https://www.flickr.com/photos/140095225@N02/41906373431', + url: 'https://live.staticflickr.com/962/41906373431_72c25d0dfd_b.jpg', + creator: 'y.akahori.ramen', + creator_url: 'https://www.flickr.com/photos/140095225@N02', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'japanese', + accuracy: null, + }, + ], + attribution: '"Cat" by y.akahori.ramen is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 765, + thumbnail: 'http://localhost:49153/v1/images/50afd9b9-c9eb-4665-89df-36ce304aa15e/thumb/', + detail_url: 'http://localhost:49153/v1/images/50afd9b9-c9eb-4665-89df-36ce304aa15e/', + related_url: 'http://localhost:49153/v1/images/50afd9b9-c9eb-4665-89df-36ce304aa15e/related/', + unstable__sensitivity: [], + }, + { + id: '77948efd-03ac-491b-8687-09de482aac99', + title: 'A Cretan cat', + indexed_on: '2018-11-09T20:20:31.275041Z', + foreign_landing_url: 'https://www.flickr.com/photos/129822560@N05/30486239537', + url: 'https://live.staticflickr.com/1975/30486239537_593886f307_b.jpg', + creator: 'andymiccone', + creator_url: 'https://www.flickr.com/photos/129822560@N05', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'crete', + accuracy: null, + }, + { + name: 'greece', + accuracy: null, + }, + { + name: 'kitten', + accuracy: null, + }, + ], + attribution: '"A Cretan cat" by andymiccone is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/77948efd-03ac-491b-8687-09de482aac99/thumb/', + detail_url: 'http://localhost:49153/v1/images/77948efd-03ac-491b-8687-09de482aac99/', + related_url: 'http://localhost:49153/v1/images/77948efd-03ac-491b-8687-09de482aac99/related/', + unstable__sensitivity: [], + }, + { + id: 'a9b80213-3e4c-4e50-ab75-f2bce56f6c6f', + title: 'Mad Cat (V2)', + indexed_on: '2020-04-09T19:07:23.006964Z', + foreign_landing_url: 'https://www.flickr.com/photos/38451115@N04/7107605605', + url: 'https://live.staticflickr.com/8162/7107605605_d1883789e9_b.jpg', + creator: 'pasukaru76', + creator_url: 'https://www.flickr.com/photos/38451115@N04', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'battlemech', + accuracy: null, + }, + { + name: 'battletech', + accuracy: null, + }, + { + name: 'canon100mm', + accuracy: null, + }, + { + name: 'clan', + accuracy: null, + }, + { + name: 'lego', + accuracy: null, + }, + { + name: 'madcat', + accuracy: null, + }, + { + name: 'mech', + accuracy: null, + }, + { + name: 'microscale', + accuracy: null, + }, + { + name: 'moc', + accuracy: null, + }, + { + name: 'timberwolf', + accuracy: null, + }, + ], + attribution: '"Mad Cat (V2)" by pasukaru76 is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/a9b80213-3e4c-4e50-ab75-f2bce56f6c6f/thumb/', + detail_url: 'http://localhost:49153/v1/images/a9b80213-3e4c-4e50-ab75-f2bce56f6c6f/', + related_url: 'http://localhost:49153/v1/images/a9b80213-3e4c-4e50-ab75-f2bce56f6c6f/related/', + unstable__sensitivity: [], + }, + { + id: '145e0b37-0577-416b-8d05-27c0b0bdde46', + title: 'Cat', + indexed_on: '2019-08-05T18:40:46.500031Z', + foreign_landing_url: 'https://www.flickr.com/photos/51686021@N07/42700002412', + url: 'https://live.staticflickr.com/1731/42700002412_c4e96ba054_b.jpg', + creator: 'Burnt Pineapple Productions', + creator_url: 'https://www.flickr.com/photos/51686021@N07', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: 'photograph', + filesize: null, + filetype: 'jpg', + tags: [ + { + name: 'cat', + accuracy: null, + }, + { + name: 'cats', + accuracy: null, + }, + { + name: 'pets', + accuracy: null, + }, + ], + attribution: '"Cat" by Burnt Pineapple Productions is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'tags.name', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/145e0b37-0577-416b-8d05-27c0b0bdde46/thumb/', + detail_url: 'http://localhost:49153/v1/images/145e0b37-0577-416b-8d05-27c0b0bdde46/', + related_url: 'http://localhost:49153/v1/images/145e0b37-0577-416b-8d05-27c0b0bdde46/related/', + unstable__sensitivity: [], + }, + { + id: 'ab1b0490-d752-4c96-b5c8-47cac7c4b5e7', + title: "RESCUED CAT 'Arthur'- HOPE IMG_8073", + indexed_on: '2020-11-05T00:18:53.161332Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/50564465138', + url: 'https://live.staticflickr.com/65535/50564465138_a9928ae996_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'arthur', + accuracy: null, + }, + { + name: 'beautiful', + accuracy: null, + }, + { + name: 'beige', + accuracy: null, + }, + { + name: 'black', + accuracy: null, + }, + { + name: 'brown', + accuracy: null, + }, + { + name: 'canoneos700d', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'cateye', + accuracy: null, + }, + { + name: 'cathead', + accuracy: null, + }, + { + name: 'catlovers', + accuracy: null, + }, + { + name: 'closeup', + accuracy: null, + }, + { + name: 'energy', + accuracy: null, + }, + { + name: 'enjoy', + accuracy: null, + }, + { + name: 'expression', + accuracy: null, + }, + { + name: 'eye', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'free', + accuracy: null, + }, + { + name: 'freedom', + accuracy: null, + }, + { + name: 'grey', + accuracy: null, + }, + { + name: 'happylife', + accuracy: null, + }, + { + name: 'hope', + accuracy: null, + }, + { + name: 'liberty', + accuracy: null, + }, + { + name: 'light', + accuracy: null, + }, + { + name: 'love', + accuracy: null, + }, + { + name: 'newlife', + accuracy: null, + }, + { + name: 'outofthedarkness', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'photo', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'pink', + accuracy: null, + }, + { + name: 'rescued', + accuracy: null, + }, + { + name: 'shadow', + accuracy: null, + }, + { + name: 'shed', + accuracy: null, + }, + { + name: 'thankyou', + accuracy: null, + }, + { + name: 'thinkpositive', + accuracy: null, + }, + { + name: 'white', + accuracy: null, + }, + { + name: 'yellow', + accuracy: null, + }, + ], + attribution: '"RESCUED CAT \'Arthur\'- HOPE IMG_8073" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 683, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/ab1b0490-d752-4c96-b5c8-47cac7c4b5e7/thumb/', + detail_url: 'http://localhost:49153/v1/images/ab1b0490-d752-4c96-b5c8-47cac7c4b5e7/', + related_url: 'http://localhost:49153/v1/images/ab1b0490-d752-4c96-b5c8-47cac7c4b5e7/related/', + unstable__sensitivity: [], + }, + { + id: 'd9084695-12a1-42ca-aef5-273da2f879d4', + title: "Roommate's cat Steve 1", + indexed_on: '2020-04-24T15:07:34.215213Z', + foreign_landing_url: 'https://www.flickr.com/photos/29507259@N02/3538435153', + url: 'https://live.staticflickr.com/2161/3538435153_a5ebcaa2b6_b.jpg', + creator: 'D Coetzee', + creator_url: 'https://www.flickr.com/photos/29507259@N02', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Roommate\'s cat Steve 1" by D Coetzee is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/d9084695-12a1-42ca-aef5-273da2f879d4/thumb/', + detail_url: 'http://localhost:49153/v1/images/d9084695-12a1-42ca-aef5-273da2f879d4/', + related_url: 'http://localhost:49153/v1/images/d9084695-12a1-42ca-aef5-273da2f879d4/related/', + unstable__sensitivity: [], + }, + { + id: '5366a342-2801-415e-ba11-e0ea77309952', + title: "Roommate's cat Steve 4", + indexed_on: '2020-04-24T15:07:34.215213Z', + foreign_landing_url: 'https://www.flickr.com/photos/29507259@N02/3539249174', + url: 'https://live.staticflickr.com/3349/3539249174_22e3823586_b.jpg', + creator: 'D Coetzee', + creator_url: 'https://www.flickr.com/photos/29507259@N02', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Roommate\'s cat Steve 4" by D Coetzee is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'description', + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/5366a342-2801-415e-ba11-e0ea77309952/thumb/', + detail_url: 'http://localhost:49153/v1/images/5366a342-2801-415e-ba11-e0ea77309952/', + related_url: 'http://localhost:49153/v1/images/5366a342-2801-415e-ba11-e0ea77309952/related/', + unstable__sensitivity: [], + }, + { + id: 'f85b2e5b-fd0b-404a-a9b6-2e138f75bf27', + title: 'Feral cat', + indexed_on: '2020-03-22T13:30:43.425339Z', + foreign_landing_url: 'https://www.flickr.com/photos/40632439@N00/38960943252', + url: 'https://live.staticflickr.com/4682/38960943252_ee94370e7d_b.jpg', + creator: 'Thad Zajdowicz', + creator_url: 'https://www.flickr.com/photos/40632439@N00', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'availablelight', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'color', + accuracy: null, + }, + { + name: 'ears', + accuracy: null, + }, + { + name: 'eyes', + accuracy: null, + }, + { + name: 'face', + accuracy: null, + }, + { + name: 'fauna', + accuracy: null, + }, + { + name: 'felis', + accuracy: null, + }, + { + name: 'feral', + accuracy: null, + }, + { + name: 'fur', + accuracy: null, + }, + { + name: 'ginger', + accuracy: null, + }, + { + name: 'hanaumabay', + accuracy: null, + }, + { + name: 'hawaii', + accuracy: null, + }, + { + name: 'honolulu', + accuracy: null, + }, + { + name: 'leica', + accuracy: null, + }, + { + name: 'lightroom', + accuracy: null, + }, + { + name: 'nose', + accuracy: null, + }, + { + name: 'paws', + accuracy: null, + }, + { + name: 'travel', + accuracy: null, + }, + { + name: 'usa', + accuracy: null, + }, + { + name: 'zajdowicz', + accuracy: null, + }, + ], + attribution: '"Feral cat" by Thad Zajdowicz is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'tags.name', + 'title', + ], + mature: false, + height: 576, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/f85b2e5b-fd0b-404a-a9b6-2e138f75bf27/thumb/', + detail_url: 'http://localhost:49153/v1/images/f85b2e5b-fd0b-404a-a9b6-2e138f75bf27/', + related_url: 'http://localhost:49153/v1/images/f85b2e5b-fd0b-404a-a9b6-2e138f75bf27/related/', + unstable__sensitivity: [], + }, + { + id: 'e8cdca1a-270d-47a3-a14b-b0280fb1a697', + title: "Cat copyright - StoOop shooting me or I'll scratchhhhh you... real Baaad IMG_3211", + indexed_on: '2020-01-02T08:27:45.939103Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/49252660992', + url: 'https://live.staticflickr.com/65535/49252660992_f3fa835440_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'beautiful', + accuracy: null, + }, + { + name: 'brown', + accuracy: null, + }, + { + name: 'canoneos700d', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'catcopyrights', + accuracy: null, + }, + { + name: 'catlovers', + accuracy: null, + }, + { + name: 'cute', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'funny', + accuracy: null, + }, + { + name: 'garden', + accuracy: null, + }, + { + name: 'grass', + accuracy: null, + }, + { + name: 'green', + accuracy: null, + }, + { + name: 'humour', + accuracy: null, + }, + { + name: 'lolhehehehehehe', + accuracy: null, + }, + { + name: 'nature', + accuracy: null, + }, + { + name: 'nice', + accuracy: null, + }, + { + name: 'orange', + accuracy: null, + }, + { + name: 'outdoor', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'photo', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'white', + accuracy: null, + }, + { + name: 'yellow', + accuracy: null, + }, + ], + attribution: '"Cat copyright - StoOop shooting me or I\'ll scratchhhhh you... real Baaad IMG_3211" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'tags.name', + 'title', + ], + mature: false, + height: 684, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/e8cdca1a-270d-47a3-a14b-b0280fb1a697/thumb/', + detail_url: 'http://localhost:49153/v1/images/e8cdca1a-270d-47a3-a14b-b0280fb1a697/', + related_url: 'http://localhost:49153/v1/images/e8cdca1a-270d-47a3-a14b-b0280fb1a697/related/', + unstable__sensitivity: [], + }, + { + id: '9bec2f45-063e-451f-adca-4033c464a2bb', + title: 'Cat', + indexed_on: '2018-11-09T02:22:56.756031Z', + foreign_landing_url: 'https://www.flickr.com/photos/55551626@N02/9230485361', + url: 'https://live.staticflickr.com/5344/9230485361_7ed2383d24_b.jpg', + creator: 'davispuh', + creator_url: 'https://www.flickr.com/photos/55551626@N02', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Cat" by davispuh is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/9bec2f45-063e-451f-adca-4033c464a2bb/thumb/', + detail_url: 'http://localhost:49153/v1/images/9bec2f45-063e-451f-adca-4033c464a2bb/', + related_url: 'http://localhost:49153/v1/images/9bec2f45-063e-451f-adca-4033c464a2bb/related/', + unstable__sensitivity: [], + }, + { + id: '61a0592a-2261-432c-b6e1-5aa0c7c35262', + title: 'Cat', + indexed_on: '2020-04-08T14:13:24.452478Z', + foreign_landing_url: 'https://www.flickr.com/photos/55551626@N02/9230474439', + url: 'https://live.staticflickr.com/7388/9230474439_7a4fc109c6_b.jpg', + creator: 'davispuh', + creator_url: 'https://www.flickr.com/photos/55551626@N02', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + ], + attribution: '"Cat" by davispuh is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'tags.name', + 'title', + ], + mature: false, + height: 768, + width: 1024, + thumbnail: 'http://localhost:49153/v1/images/61a0592a-2261-432c-b6e1-5aa0c7c35262/thumb/', + detail_url: 'http://localhost:49153/v1/images/61a0592a-2261-432c-b6e1-5aa0c7c35262/', + related_url: 'http://localhost:49153/v1/images/61a0592a-2261-432c-b6e1-5aa0c7c35262/related/', + unstable__sensitivity: [], + }, + { + id: '0b20e40c-fae7-499e-98c0-0cb1ba29fcdd', + title: 'Cat - Head and Paw by iezalel williams IMG_4753', + indexed_on: '2019-12-21T08:33:43.833887Z', + foreign_landing_url: 'https://www.flickr.com/photos/181765699@N08/48730948367', + url: 'https://live.staticflickr.com/65535/48730948367_ca34deb7ae_b.jpg', + creator: 'iezalel7williams', + creator_url: 'https://www.flickr.com/photos/181765699@N08', + license: 'cc0', + license_version: '1.0', + license_url: 'https://creativecommons.org/publicdomain/zero/1.0/', + provider: 'flickr', + source: 'flickr', + category: null, + filesize: null, + filetype: null, + tags: [ + { + name: 'animal', + accuracy: null, + }, + { + name: 'beautiful', + accuracy: null, + }, + { + name: 'beauty', + accuracy: null, + }, + { + name: 'blackbackground', + accuracy: null, + }, + { + name: 'canoneos700d', + accuracy: null, + }, + { + name: 'cat', + accuracy: null, + }, + { + name: 'cathead', + accuracy: null, + }, + { + name: 'closeup', + accuracy: null, + }, + { + name: 'cute', + accuracy: null, + }, + { + name: 'feline', + accuracy: null, + }, + { + name: 'happylife', + accuracy: null, + }, + { + name: 'high', + accuracy: null, + }, + { + name: 'light', + accuracy: null, + }, + { + name: 'love', + accuracy: null, + }, + { + name: 'lovely', + accuracy: null, + }, + { + name: 'natural', + accuracy: null, + }, + { + name: 'nature', + accuracy: null, + }, + { + name: 'nice', + accuracy: null, + }, + { + name: 'orange', + accuracy: null, + }, + { + name: 'paw', + accuracy: null, + }, + { + name: 'peaceofmind', + accuracy: null, + }, + { + name: 'pet', + accuracy: null, + }, + { + name: 'photo', + accuracy: null, + }, + { + name: 'photography', + accuracy: null, + }, + { + name: 'thankyou', + accuracy: null, + }, + { + name: 'thinkpositive', + accuracy: null, + }, + { + name: 'white', + accuracy: null, + }, + { + name: 'yellow', + accuracy: null, + }, + ], + attribution: '"Cat - Head and Paw by iezalel williams IMG_4753" by iezalel7williams is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/.', + fields_matched: [ + 'tags.name', + 'title', + ], + mature: false, + height: 1024, + width: 684, + thumbnail: 'http://localhost:49153/v1/images/0b20e40c-fae7-499e-98c0-0cb1ba29fcdd/thumb/', + detail_url: 'http://localhost:49153/v1/images/0b20e40c-fae7-499e-98c0-0cb1ba29fcdd/', + related_url: 'http://localhost:49153/v1/images/0b20e40c-fae7-499e-98c0-0cb1ba29fcdd/related/', + unstable__sensitivity: [], + }, + ], + }, + }, +} \ No newline at end of file diff --git a/frontend/test/unit/specs/stores/search-store.spec.js b/frontend/test/unit/specs/stores/search-store.spec.js index 9a24fc061b8..eeda3f659c9 100644 --- a/frontend/test/unit/specs/stores/search-store.spec.js +++ b/frontend/test/unit/specs/stores/search-store.spec.js @@ -15,7 +15,7 @@ import { } from "~/constants/media" import { INCLUDE_SENSITIVE_QUERY_PARAM } from "~/constants/content-safety" -import { useSearchStore } from "~/stores/search" +import { computeQueryParams, useSearchStore } from "~/stores/search" import { useFeatureFlagStore } from "~/stores/feature-flag" describe("Search Store", () => { @@ -31,7 +31,7 @@ describe("Search Store", () => { describe("getters", () => { /** * Check for some special cases: - * - `fetch_sensitive` feature flag and `searchBy` filter. + * - `fetch_sensitive` feature flag filter. * - several options for single filter. * - media specific filters that are unique (durations). * - media specific filters that have the same API param (extensions) @@ -39,7 +39,6 @@ describe("Search Store", () => { it.each` sensitivityFlag | query | searchType | filterCount ${"on"} | ${{ licenses: ["by"] }} | ${IMAGE} | ${1} - ${"off"} | ${{ licenses: ["by"], searchBy: ["creator"] }} | ${ALL_MEDIA} | ${2} ${"off"} | ${{ licenses: ["cc0", "pdm", "by", "by-nc"] }} | ${ALL_MEDIA} | ${4} ${"off"} | ${{ lengths: ["medium"] }} | ${AUDIO} | ${1} ${"off"} | ${{ imageExtensions: ["svg"] }} | ${IMAGE} | ${1} @@ -63,27 +62,37 @@ describe("Search Store", () => { ) /** - * If the type is provided, search path is updated to it, and the query is - * kept as is if filter parameters can be used with the new type, otherwise - * the unused parameters are removed. - * - Uses the type and query from the store if type and query are undefined. - * Note that the search term is not added to the query either. - * - Replaces the type, keeps the store query if type is provided and query is undefined. - * Common query parameters are kept as is, and the parameters that are incompatible with - * the type are removed. + * If type or query are not provided, uses the current state values. + * Uses the query as is, if provided. Otherwise, uses the store state + * as the query, omitting parameters that are not relevant for the search type. */ it.each` - type | query | currentState | expected - ${undefined} | ${undefined} | ${{ path: "/search/audio", urlQuery: { q: "cat", license: "by,by-sa", extension: "ogg" } }} | ${{ path: "/search/audio", query: { q: "cat", license: "by,by-sa", extension: "ogg" } }} - ${IMAGE} | ${undefined} | ${{ path: "/search/audio", urlQuery: { q: "cat", license: "by,by-sa" } }} | ${{ path: "/search/image", query: { q: "cat", license: "by,by-sa" } }} - ${AUDIO} | ${undefined} | ${{ path: "/search/image", urlQuery: { q: "cat", license: "by,by-sa" } }} | ${{ path: "/search/audio", query: { q: "cat", license: "by,by-sa" } }} - ${AUDIO} | ${undefined} | ${{ path: "/search/image", urlQuery: { q: "cat", extension: "svg" } }} | ${{ path: "/search/audio", query: { q: "cat" } }} - ${IMAGE} | ${undefined} | ${{ path: "/search/image", urlQuery: { q: "cat", extension: "svg" } }} | ${{ path: "/search/image", query: { q: "cat", extension: "svg" } }} - ${IMAGE} | ${undefined} | ${{ path: "/search/audio", urlQuery: { q: "cat", duration: "medium" } }} | ${{ path: "/search/image", query: { q: "cat" } }} - ${VIDEO} | ${undefined} | ${{ path: "/search/audio", urlQuery: { q: "cat", extension: "ogg" } }} | ${{ path: "/search/video", query: { q: "cat", extension: "ogg" } }} - ${undefined} | ${{ param: "passedAsIs" }} | ${{ path: "/search/image", urlQuery: {} }} | ${{ path: "/search/image", query: { param: "passedAsIs" } }} + type | currentState | expected + ${undefined} | ${{ path: "/search/audio", urlQuery: { q: "cat", license: "by,by-sa", extension: "ogg" } }} | ${{ path: "/search/audio", query: { q: "cat", license: "by,by-sa", extension: "ogg" } }} + ${IMAGE} | ${{ path: "/search/audio", urlQuery: { q: "cat", license: "by,by-sa" } }} | ${{ path: "/search/image", query: { q: "cat", license: "by,by-sa" } }} + ${AUDIO} | ${{ path: "/search/image", urlQuery: { q: "cat", license: "by,by-sa" } }} | ${{ path: "/search/audio", query: { q: "cat", license: "by,by-sa" } }} + ${AUDIO} | ${{ path: "/search/image", urlQuery: { q: "cat", extension: "svg" } }} | ${{ path: "/search/audio", query: { q: "cat" } }} + ${IMAGE} | ${{ path: "/search/image", urlQuery: { q: "cat", extension: "svg" } }} | ${{ path: "/search/image", query: { q: "cat", extension: "svg" } }} + ${IMAGE} | ${{ path: "/search/audio", urlQuery: { q: "cat", duration: "medium" } }} | ${{ path: "/search/image", query: { q: "cat" } }} + ${VIDEO} | ${{ path: "/search/audio", urlQuery: { q: "cat", extension: "ogg" } }} | ${{ path: "/search/video", query: { q: "cat" } }} `( - "getSearchPath returns correct path $query and searchType $searchType", + "getSearchPath returns $expected.path, $expected.query for $type and current state $currentState.path, $currentState.urlQuery", + ({ type, query, currentState, expected }) => { + const searchStore = useSearchStore() + + searchStore.setSearchStateFromUrl(currentState) + + searchStore.getSearchPath({ type, query }) + + expect(searchStore.$nuxt.localePath).toHaveBeenCalledWith(expected) + } + ) + + it.each` + type | query | currentState | expected + ${undefined} | ${{ unknownParam: "dropped" }} | ${{ path: "/search/image", urlQuery: { q: "" } }} | ${{ path: "/search/image", query: { unknownParam: "dropped" } }} + `( + "getSearchPath returns $expected.path, $expected.query for query $query $type and current state $currentState.path, $currentState.urlQuery", ({ type, query, currentState, expected }) => { const searchStore = useSearchStore() @@ -115,16 +124,13 @@ describe("Search Store", () => { const searchStore = useSearchStore() searchStore.setSearchType(searchType) const filtersForDisplay = searchStore.searchFilters - // `searchBy` filter is not displayed - const expectedFilterCount = Math.max(0, filterTypeCount - 1) - expect(Object.keys(filtersForDisplay).length).toEqual( - expectedFilterCount - ) + + expect(Object.keys(filtersForDisplay).length).toEqual(filterTypeCount) } ) /** * Check for some special cases: - * - `fetch_sensitive` feature flag and `searchBy` filter. + * - `fetch_sensitive` feature flag. * - several options for single filter. * - media specific filters that are unique (durations). * - media specific filters that have the same API param (extensions) @@ -132,20 +138,19 @@ describe("Search Store", () => { * - more than one value for a parameter in the query (q=cat&q=dog). */ it.each` - sensitivityFlag | query | expectedQueryParams | searchType - ${"on"} | ${{ q: "cat", license: "by" }} | ${{ q: "cat", license: "by", [INCLUDE_SENSITIVE_QUERY_PARAM]: "true" }} | ${IMAGE} - ${"on"} | ${{ license: "by" }} | ${{ q: "", license: "by", [INCLUDE_SENSITIVE_QUERY_PARAM]: "true" }} | ${IMAGE} - ${"off"} | ${{ license: "" }} | ${{ q: "" }} | ${IMAGE} - ${"off"} | ${{ q: "cat", license: "by", searchBy: "creator" }} | ${{ q: "cat", license: "by", searchBy: "creator" }} | ${ALL_MEDIA} - ${"off"} | ${{ q: "cat", license: "pdm,cc0,by,by-nc" }} | ${{ q: "cat", license: "pdm,cc0,by,by-nc" }} | ${ALL_MEDIA} - ${"off"} | ${{ q: "cat", length: "medium" }} | ${{ q: "cat" }} | ${IMAGE} - ${"off"} | ${{ q: "cat", length: "medium" }} | ${{ q: "cat", length: "medium" }} | ${AUDIO} - ${"off"} | ${{ q: "cat", extension: "svg" }} | ${{ q: "cat", extension: "svg" }} | ${IMAGE} - ${"off"} | ${{ q: "cat", extension: "mp3" }} | ${{ q: "cat", extension: "mp3" }} | ${AUDIO} - ${"off"} | ${{ q: "cat", extension: "svg" }} | ${{ q: "cat" }} | ${AUDIO} - ${"off"} | ${{ q: ["cat", "dog"], license: ["by", "cc0"] }} | ${{ q: "cat", license: "by" }} | ${IMAGE} + sensitivityFlag | query | expectedQueryParams | searchType + ${"on"} | ${{ q: "cat", license: "by" }} | ${{ q: "cat", license: "by", [INCLUDE_SENSITIVE_QUERY_PARAM]: "true" }} | ${IMAGE} + ${"on"} | ${{ license: "by" }} | ${{ q: "", license: "by", [INCLUDE_SENSITIVE_QUERY_PARAM]: "true" }} | ${IMAGE} + ${"off"} | ${{ license: "" }} | ${{ q: "" }} | ${IMAGE} + ${"off"} | ${{ q: "cat", license: "pdm,cc0,by,by-nc" }} | ${{ q: "cat", license: "pdm,cc0,by,by-nc" }} | ${ALL_MEDIA} + ${"off"} | ${{ q: "cat", length: "medium" }} | ${{ q: "cat" }} | ${IMAGE} + ${"off"} | ${{ q: "cat", length: "medium" }} | ${{ q: "cat", length: "medium" }} | ${AUDIO} + ${"off"} | ${{ q: "cat", extension: "svg" }} | ${{ q: "cat", extension: "svg" }} | ${IMAGE} + ${"off"} | ${{ q: "cat", extension: "mp3" }} | ${{ q: "cat", extension: "mp3" }} | ${AUDIO} + ${"off"} | ${{ q: "cat", extension: "svg" }} | ${{ q: "cat" }} | ${AUDIO} + ${"off"} | ${{ q: ["cat", "dog"], license: ["by", "cc0"] }} | ${{ q: "cat", license: "by" }} | ${IMAGE} `( - "returns correct searchQueryParams and filter status for $query and searchType $searchType", + "returns correct apiSearchQueryParams and filter status for $query and searchType $searchType", ({ sensitivityFlag, query, expectedQueryParams, searchType }) => { const featureFlagStore = useFeatureFlagStore() featureFlagStore.toggleFeature("fetch_sensitive", sensitivityFlag) @@ -157,10 +162,11 @@ describe("Search Store", () => { urlQuery: query, }) - expect(searchStore.searchQueryParams).toEqual(expectedQueryParams) + expect(searchStore.apiSearchQueryParams).toEqual(expectedQueryParams) } ) }) + describe("actions", () => { it.each(["foo", ""])( "`setSearchTerm correctly updates the searchTerm", @@ -180,6 +186,24 @@ describe("Search Store", () => { expect(searchStore.searchType).toEqual(type) } ) + it("throws an error for additional search types if the feature flag is off", () => { + const searchStore = useSearchStore() + const featureFlagStore = useFeatureFlagStore() + featureFlagStore.toggleFeature("additional_search_types", "off") + + expect(() => searchStore.setSearchType(VIDEO)).toThrow( + "Please enable the 'additional_search_types' flag to use the video" + ) + }) + + it("sets an additional search types if the feature flag is on", () => { + const searchStore = useSearchStore() + const featureFlagStore = useFeatureFlagStore() + featureFlagStore.toggleFeature("additional_search_types", "on") + + searchStore.setSearchType(VIDEO) + expect(searchStore.searchType).toEqual(VIDEO) + }) // TODO: add support for video path it.each` @@ -201,7 +225,7 @@ describe("Search Store", () => { it.each` sensitivityFlag | query | path | searchType ${"off"} | ${{ license: "cc0,by", q: "cat" }} | ${"/search/"} | ${ALL_MEDIA} - ${"off"} | ${{ searchBy: "creator", q: "dog" }} | ${"/search/image/"} | ${IMAGE} + ${"off"} | ${{ q: "dog" }} | ${"/search/image/"} | ${IMAGE} ${"on"} | ${{ [INCLUDE_SENSITIVE_QUERY_PARAM]: "true", q: "galah" }} | ${"/search/audio/"} | ${AUDIO} ${"off"} | ${{ length: "medium" }} | ${"/search/image"} | ${IMAGE} `( @@ -210,7 +234,7 @@ describe("Search Store", () => { const featureFlagStore = useFeatureFlagStore() featureFlagStore.toggleFeature("fetch_sensitive", sensitivityFlag) const searchStore = useSearchStore() - const expectedQuery = { ...searchStore.searchQueryParams, ...query } + const expectedQuery = { ...searchStore.apiSearchQueryParams, ...query } // The values that are not applicable for the search type should be discarded if (searchType === IMAGE) { delete expectedQuery.length @@ -219,15 +243,40 @@ describe("Search Store", () => { searchStore.setSearchStateFromUrl({ path: path, urlQuery: query }) expect(searchStore.searchType).toEqual(searchType) - expect(searchStore.searchQueryParams).toEqual(expectedQuery) + expect(searchStore.apiSearchQueryParams).toEqual(expectedQuery) } ) + it("updateSearchPath updates searchType and query", () => { + const searchStore = useSearchStore() + searchStore.updateSearchPath({ type: "audio", searchTerm: "cat" }) + + expect(searchStore.searchType).toEqual("audio") + expect(searchStore.apiSearchQueryParams).toEqual({ q: "cat" }) + expect(searchStore.$nuxt.localePath).toHaveBeenCalledWith({ + path: "/search/audio", + query: { q: "cat" }, + }) + }) + + it("updateSearchPath keeps searchType and query if none provided", () => { + const searchStore = useSearchStore() + searchStore.setSearchTerm("cat") + searchStore.setSearchType("audio") + searchStore.updateSearchPath() + + expect(searchStore.searchType).toEqual("audio") + expect(searchStore.apiSearchQueryParams).toEqual({ q: "cat" }) + expect(searchStore.$nuxt.localePath).toHaveBeenCalledWith({ + path: "/search/audio", + query: { q: "cat" }, + }) + }) + it.each` filters | query ${[["licenses", "by"], ["licenses", "by-nc-sa"]]} | ${["license", "by,by-nc-sa"]} ${[["licenseTypes", "commercial"], ["licenseTypes", "modification"]]} | ${["license_type", "commercial,modification"]} - ${[["searchBy", "creator"]]} | ${["searchBy", "creator"]} ${[["sizes", "large"]]} | ${["size", undefined]} `( "toggleFilter updates the query values to $query", @@ -237,7 +286,7 @@ describe("Search Store", () => { const [filterType, code] = filterItem searchStore.toggleFilter({ filterType, code }) } - expect(searchStore.searchQueryParams[query[0]]).toEqual(query[1]) + expect(searchStore.apiSearchQueryParams[query[0]]).toEqual(query[1]) } ) @@ -257,10 +306,12 @@ describe("Search Store", () => { }) if (supportedSearchTypes.includes(searchType)) { // eslint-disable-next-line jest/no-conditional-expect - expect(searchStore.query).not.toEqual(expectedQueryParams) + expect(searchStore.apiSearchQueryParams).not.toEqual( + expectedQueryParams + ) } searchStore.clearFilters() - expect(searchStore.searchQueryParams).toEqual(expectedQueryParams) + expect(searchStore.apiSearchQueryParams).toEqual(expectedQueryParams) } ) @@ -270,7 +321,6 @@ describe("Search Store", () => { ${"licenseTypes"} | ${0} ${"imageExtensions"} | ${0} ${"imageCategories"} | ${0} - ${"searchBy"} | ${0} ${"aspectRatios"} | ${0} ${"sizes"} | ${0} `( @@ -361,7 +411,6 @@ describe("Search Store", () => { ${"licenseTypes"} | ${"modification"} | ${1} ${"imageExtensions"} | ${"svg"} | ${3} ${"imageCategories"} | ${"photograph"} | ${0} - ${"searchBy"} | ${"creator"} | ${0} ${"aspectRatios"} | ${"tall"} | ${0} ${"sizes"} | ${"medium"} | ${1} `( @@ -389,6 +438,7 @@ describe("Search Store", () => { ${{ code: "commercial", filterType: "licenseTypes" }} | ${{ filterType: "licenses", code: "by-nc-sa" }} | ${true} ${{ code: "modification", filterType: "licenseTypes" }} | ${{ filterType: "licenses", code: "by-nd" }} | ${true} ${{ code: "modification", filterType: "licenseTypes" }} | ${{ filterType: "licenses", code: "by-nc-nd" }} | ${true} + ${{ code: "jpg", filterType: "imageExtensions" }} | ${{ filterType: "imageExtensions", code: "png" }} | ${false} `( "isFilterDisabled for $item.code should return $disabled when $dependency.code is checked", ({ item, dependency, disabled }) => { @@ -417,12 +467,12 @@ describe("Search Store", () => { it.each` searchType | nextSearchType | expectedFilterCount - ${AUDIO} | ${IMAGE} | ${24} - ${IMAGE} | ${ALL_MEDIA} | ${11} - ${IMAGE} | ${AUDIO} | ${29} - ${ALL_MEDIA} | ${VIDEO} | ${11} - ${VIDEO} | ${AUDIO} | ${29} - ${ALL_MEDIA} | ${IMAGE} | ${24} + ${AUDIO} | ${IMAGE} | ${23} + ${IMAGE} | ${ALL_MEDIA} | ${10} + ${IMAGE} | ${AUDIO} | ${28} + ${ALL_MEDIA} | ${VIDEO} | ${10} + ${VIDEO} | ${AUDIO} | ${28} + ${ALL_MEDIA} | ${IMAGE} | ${23} `( "changing searchType from $searchType clears all but $expectedFilterCount $nextSearchType filters", async ({ searchType, nextSearchType, expectedFilterCount }) => { @@ -504,4 +554,41 @@ describe("Search Store", () => { }) }) }) + + describe("computeQueryParams", () => { + it("should return only `q` if search type is not supported", () => { + const params = computeQueryParams(VIDEO, {}, "cat", "frontend") + expect(params).toEqual({ q: "cat" }) + }) + + it("should not set sensitive query param if mode is `frontend`", () => { + const searchStore = useSearchStore() + const featureFlagStore = useFeatureFlagStore() + featureFlagStore.toggleFeature("fetch_sensitive", "on") + + const params = computeQueryParams( + IMAGE, + searchStore.filters, + "cat", + "frontend" + ) + expect(params).toEqual({ q: "cat" }) + }) + it("should set sensitive query param if mode is `API`", () => { + const searchStore = useSearchStore() + const featureFlagStore = useFeatureFlagStore() + featureFlagStore.toggleFeature("fetch_sensitive", "on") + + const params = computeQueryParams( + IMAGE, + searchStore.filters, + "cat", + "API" + ) + expect(params).toEqual({ + q: "cat", + unstable__include_sensitive_results: "true", + }) + }) + }) }) diff --git a/frontend/test/unit/specs/utils/prepare-search-query-params.spec.js b/frontend/test/unit/specs/utils/prepare-search-query-params.spec.js deleted file mode 100644 index e551adc3cf1..00000000000 --- a/frontend/test/unit/specs/utils/prepare-search-query-params.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -import prepareSearchQueryParams from "~/utils/prepare-search-query-params" - -describe("prepareSearchQueryParams", () => { - it("returns params object clone", () => { - const params = { - q: "foo", - } - - const result = prepareSearchQueryParams(params) - expect(result).not.toBe(params) // toBe checks for ref. equality - expect(result).toEqual(params) // toEqual checks for value equality - }) - - it('swaps "q" key for "creator" key when searchBy equals "creator', () => { - const params = { - q: "foo", - searchBy: "creator", - } - - const result = prepareSearchQueryParams(params) - expect(result.q).toBeUndefined() - expect(result.creator).toBe("foo") - }) - - it('swaps "q" key for "tags" key when searchBy equals "tags', () => { - const params = { - q: "foo", - searchBy: "tags", - } - - const result = prepareSearchQueryParams(params) - expect(result.q).toBeUndefined() - expect(result.tags).toBe("foo") - }) - - it("does not remove q key when searchBy value is empty", () => { - const params = { - q: "foo", - searchBy: [], - } - - const result = prepareSearchQueryParams(params) - expect(result.q).toBe("foo") - }) - - it('removes leading and trailing whitespace from "q" key', () => { - const params = { - q: " foo ", - } - - const result = prepareSearchQueryParams(params) - expect(result.q).toBe("foo") - }) -}) diff --git a/frontend/test/unit/specs/utils/search-query-transform.spec.js b/frontend/test/unit/specs/utils/search-query-transform.spec.js index 68519738d15..ad1587ce161 100644 --- a/frontend/test/unit/specs/utils/search-query-transform.spec.js +++ b/frontend/test/unit/specs/utils/search-query-transform.spec.js @@ -2,7 +2,6 @@ import { deepClone } from "~/utils/clone" import { filtersToQueryData, queryToFilterData, - queryStringToQueryData, } from "~/utils/search-query-transform" import { AUDIO, IMAGE } from "~/constants/media" @@ -87,7 +86,6 @@ describe("searchQueryTransform", () => { { code: "animaldiversity", checked: true }, { code: "brooklynmuseum", checked: true }, ], - searchBy: [{ code: "creator", checked: true }], } const expectedQueryData = { aspect_ratio: "tall", @@ -95,7 +93,6 @@ describe("searchQueryTransform", () => { extension: "jpg", license: "cc0", license_type: "commercial", - searchBy: "creator", size: "medium", source: "animaldiversity,brooklynmuseum", } @@ -242,9 +239,6 @@ describe("searchQueryTransform", () => { code: "wikimedia", }, ], - searchBy: [ - { code: "creator", checked: true, name: "filters.searchBy.creator" }, - ], } const query = { q: "cat", @@ -254,7 +248,6 @@ describe("searchQueryTransform", () => { extension: "mp3", length: "medium", source: "jamendo", - searchBy: "creator", includeSensitiveResults: "true", } const testFilters = deepClone(filters) @@ -284,7 +277,7 @@ describe("searchQueryTransform", () => { * exist in `filters.audioProviders` list before. Other values either exist in * `filters.imageProviders` list, or do not exist at all, so they are discarded. * Valid filter items for categories that exist for all search types - * (`license`, `license_type`, `searchBy`) are set to checked. + * (`license`, `license_type`) are set to checked. * Invalid filter items for valid categories (`nonexistent` in `license`) * are discarded. */ @@ -296,7 +289,6 @@ describe("searchQueryTransform", () => { extension: "svg", length: "medium", source: "animaldiversity,wikimedia,nonexistent,wikimedia_audio,jamendo", - searchBy: "creator", } const expectedFilters = deepClone(filters) const setChecked = (code, filterCategory) => { @@ -308,7 +300,6 @@ describe("searchQueryTransform", () => { setChecked("cc0", "licenses") setChecked("commercial", "licenseTypes") setChecked("medium", "lengths") - setChecked("creator", "searchBy") setChecked("jamendo", "audioProviders") setChecked("wikimedia_audio", "audioProviders") @@ -319,23 +310,4 @@ describe("searchQueryTransform", () => { }) expect(result).toEqual(expectedFilters) // toEqual checks for value equality }) - it("queryStringToQueryData", () => { - const expectedQueryData = { - license: "cc0", - license_type: "commercial", - category: "photograph", - extension: "jpg", - aspect_ratio: "tall", - size: "medium", - source: "animaldiversity,brooklynmuseum", - q: "cat", - searchBy: "creator", - } - const queryString = - "http://localhost:8443/search/image?q=cat&license=cc0&license_type=commercial" + - "&category=photograph&extension=jpg&aspect_ratio=tall&size=medium" + - "&source=animaldiversity,brooklynmuseum&searchBy=creator" - const result = queryStringToQueryData(queryString) - expect(result).toEqual(expectedQueryData) - }) })