1
0
mirror of https://github.com/osmarks/meme-search-engine.git synced 2024-11-13 07:19:54 +00:00

I hate precedence

This commit is contained in:
osmarks 2024-05-21 12:33:32 +01:00
parent b7010b41dd
commit e705a9db21

View File

@ -1,6 +1,4 @@
import * as config from "../../frontend_config.json"
import * as backendConfig from "../../mse_config.json"
import * as formats from "../../formats.json"
export const getURL = x => config.image_path + x[1]
@ -13,10 +11,9 @@ export const doQuery = args => fetch(config.backend_url, {
}).then(x => x.json())
export const hasFormat = (results, result, format) => {
return result[3] && (1 << results.formats.indexOf(format)) !== 0
return (results.formats.indexOf(format) != -1) && ((result[3] & (1 << results.formats.indexOf(format))) != 0)
}
export const thumbnailURL = (results, result, format) => {
console.log("RES", results)
return `${config.thumb_path}${result[2]}${format}.${results.extensions[format]}`
}