Adding blurhash to image_details. (#5227)

* Adding blurhash to image_details.

- Fixes #5142

* Using new pictrs to get blurhash.

* Fixing ts-binding.

* Addressing PR comments.

* Commenting checks.

* Switching back to rust 1.81.

* Adding diesel schema

* Adding database user creation.

* Specific tests.

* Upping pictrs to 0.5.17-pre.9

* Fixing

* Using full tests.

* Fixing pictrs hash.

* Upgrading pnpm deps.
This commit is contained in:
Dessalines
2025-02-10 17:27:22 -05:00
committed by GitHub
parent 16ba42c152
commit 426684d90f
11 changed files with 189 additions and 156 deletions

View File

@@ -6,7 +6,7 @@
"repository": "https://github.com/LemmyNet/lemmy",
"author": "Dessalines",
"license": "AGPL-3.0",
"packageManager": "pnpm@9.15.0",
"packageManager": "pnpm@10.2.1+sha512.398035c7bd696d0ba0b10a688ed558285329d27ea994804a52bad9167d8e3a72bcb993f9699585d3ca25779ac64949ef422757a6c31102c12ab932e5cbe5cc92",
"scripts": {
"lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check 'src/**/*.ts'",
"fix": "prettier --write src && eslint --fix src",
@@ -23,17 +23,17 @@
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/joi": "^17.2.3",
"@types/node": "^22.10.7",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"eslint": "^9.18.0",
"@types/node": "^22.13.1",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"eslint": "^9.20.0",
"eslint-plugin-prettier": "^5.2.3",
"jest": "^29.5.0",
"lemmy-js-client": "0.20.0-ap-id.1",
"prettier": "^3.4.2",
"prettier": "^3.5.0",
"ts-jest": "^29.1.0",
"tsoa": "^6.6.0",
"typescript": "^5.7.3",
"typescript-eslint": "^8.21.0"
"typescript-eslint": "^8.24.0"
}
}

289
api_tests/pnpm-lock.yaml generated
View File

@@ -15,32 +15,32 @@ importers:
specifier: ^17.2.3
version: 17.2.3
'@types/node':
specifier: ^22.10.7
version: 22.10.7
specifier: ^22.13.1
version: 22.13.1
'@typescript-eslint/eslint-plugin':
specifier: ^8.21.0
version: 8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)
specifier: ^8.24.0
version: 8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/parser':
specifier: ^8.21.0
version: 8.21.0(eslint@9.18.0)(typescript@5.7.3)
specifier: ^8.24.0
version: 8.24.0(eslint@9.20.0)(typescript@5.7.3)
eslint:
specifier: ^9.18.0
version: 9.18.0
specifier: ^9.20.0
version: 9.20.0
eslint-plugin-prettier:
specifier: ^5.2.3
version: 5.2.3(eslint@9.18.0)(prettier@3.4.2)
version: 5.2.3(eslint@9.20.0)(prettier@3.5.0)
jest:
specifier: ^29.5.0
version: 29.7.0(@types/node@22.10.7)
version: 29.7.0(@types/node@22.13.1)
lemmy-js-client:
specifier: 0.20.0-ap-id.1
version: 0.20.0-ap-id.1
prettier:
specifier: ^3.4.2
version: 3.4.2
specifier: ^3.5.0
version: 3.5.0
ts-jest:
specifier: ^29.1.0
version: 29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.10.7))(typescript@5.7.3)
version: 29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.13.1))(typescript@5.7.3)
tsoa:
specifier: ^6.6.0
version: 6.6.0
@@ -48,8 +48,8 @@ importers:
specifier: ^5.7.3
version: 5.7.3
typescript-eslint:
specifier: ^8.21.0
version: 8.21.0(eslint@9.18.0)(typescript@5.7.3)
specifier: ^8.24.0
version: 8.24.0(eslint@9.20.0)(typescript@5.7.3)
packages:
@@ -242,12 +242,16 @@ packages:
resolution: {integrity: sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/core@0.11.0':
resolution: {integrity: sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/eslintrc@3.2.0':
resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/js@9.18.0':
resolution: {integrity: sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==}
'@eslint/js@9.20.0':
resolution: {integrity: sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/object-schema@2.1.5':
@@ -597,8 +601,8 @@ packages:
'@types/multer@1.4.12':
resolution: {integrity: sha512-pQ2hoqvXiJt2FP9WQVLPRO+AmiIm/ZYkavPlIQnx282u4ZrVdztx0pkh3jjpQt0Kz+YI0YhSG264y08UJKoUQg==}
'@types/node@22.10.7':
resolution: {integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==}
'@types/node@22.13.1':
resolution: {integrity: sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==}
'@types/qs@6.9.18':
resolution: {integrity: sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==}
@@ -621,51 +625,51 @@ packages:
'@types/yargs@17.0.32':
resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==}
'@typescript-eslint/eslint-plugin@8.21.0':
resolution: {integrity: sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA==}
'@typescript-eslint/eslint-plugin@8.24.0':
resolution: {integrity: sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.8.0'
'@typescript-eslint/parser@8.21.0':
resolution: {integrity: sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==}
'@typescript-eslint/parser@8.24.0':
resolution: {integrity: sha512-MFDaO9CYiard9j9VepMNa9MTcqVvSny2N4hkY6roquzj8pdCBRENhErrteaQuu7Yjn1ppk0v1/ZF9CG3KIlrTA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.8.0'
'@typescript-eslint/scope-manager@8.21.0':
resolution: {integrity: sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==}
'@typescript-eslint/scope-manager@8.24.0':
resolution: {integrity: sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/type-utils@8.21.0':
resolution: {integrity: sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==}
'@typescript-eslint/type-utils@8.24.0':
resolution: {integrity: sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.8.0'
'@typescript-eslint/types@8.21.0':
resolution: {integrity: sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==}
'@typescript-eslint/types@8.24.0':
resolution: {integrity: sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/typescript-estree@8.21.0':
resolution: {integrity: sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==}
'@typescript-eslint/typescript-estree@8.24.0':
resolution: {integrity: sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '>=4.8.4 <5.8.0'
'@typescript-eslint/utils@8.21.0':
resolution: {integrity: sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw==}
'@typescript-eslint/utils@8.24.0':
resolution: {integrity: sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.8.0'
'@typescript-eslint/visitor-keys@8.21.0':
resolution: {integrity: sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==}
'@typescript-eslint/visitor-keys@8.24.0':
resolution: {integrity: sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
accepts@1.3.8:
@@ -1020,8 +1024,8 @@ packages:
resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint@9.18.0:
resolution: {integrity: sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==}
eslint@9.20.0:
resolution: {integrity: sha512-aL4F8167Hg4IvsW89ejnpTwx+B/UQRzJPGgbIOl+4XqffWsahVVsLEWoZvnrVuwpWmnRd7XeXmQI1zlKcFDteA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
hasBin: true
peerDependencies:
@@ -1091,8 +1095,8 @@ packages:
fast-levenshtein@2.0.6:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
fastq@1.18.0:
resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==}
fastq@1.19.0:
resolution: {integrity: sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==}
fb-watchman@2.0.2:
resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==}
@@ -1770,8 +1774,8 @@ packages:
resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
engines: {node: '>=6.0.0'}
prettier@3.4.2:
resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==}
prettier@3.5.0:
resolution: {integrity: sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==}
engines: {node: '>=14'}
hasBin: true
@@ -1866,6 +1870,11 @@ packages:
engines: {node: '>=10'}
hasBin: true
semver@7.7.1:
resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==}
engines: {node: '>=10'}
hasBin: true
send@0.19.0:
resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==}
engines: {node: '>= 0.8.0'}
@@ -2000,8 +2009,8 @@ packages:
resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==}
engines: {node: '>=0.6'}
ts-api-utils@2.0.0:
resolution: {integrity: sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==}
ts-api-utils@2.0.1:
resolution: {integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==}
engines: {node: '>=18.12'}
peerDependencies:
typescript: '>=4.8.4'
@@ -2058,8 +2067,8 @@ packages:
resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}
engines: {node: '>= 0.6'}
typescript-eslint@8.21.0:
resolution: {integrity: sha512-txEKYY4XMKwPXxNkN8+AxAdX6iIJAPiJbHE/FpQccs/sxw8Lf26kqwC3cn0xkHlW8kEbLhkhCsjWuMveaY9Rxw==}
typescript-eslint@8.24.0:
resolution: {integrity: sha512-/lmv4366en/qbB32Vz5+kCNZEMf6xYHwh1z48suBwZvAtnXKbP+YhGe8OLE2BqC67LMqKkCNLtjejdwsdW6uOQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
@@ -2368,9 +2377,9 @@ snapshots:
'@bcoe/v8-coverage@0.2.3': {}
'@eslint-community/eslint-utils@4.4.1(eslint@9.18.0)':
'@eslint-community/eslint-utils@4.4.1(eslint@9.20.0)':
dependencies:
eslint: 9.18.0
eslint: 9.20.0
eslint-visitor-keys: 3.4.3
'@eslint-community/regexpp@4.12.1': {}
@@ -2387,6 +2396,10 @@ snapshots:
dependencies:
'@types/json-schema': 7.0.15
'@eslint/core@0.11.0':
dependencies:
'@types/json-schema': 7.0.15
'@eslint/eslintrc@3.2.0':
dependencies:
ajv: 6.12.6
@@ -2401,7 +2414,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@eslint/js@9.18.0': {}
'@eslint/js@9.20.0': {}
'@eslint/object-schema@2.1.5': {}
@@ -2614,7 +2627,7 @@ snapshots:
'@jest/console@29.7.0':
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
chalk: 4.1.2
jest-message-util: 29.7.0
jest-util: 29.7.0
@@ -2627,14 +2640,14 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.9.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@22.10.7)
jest-config: 29.7.0(@types/node@22.13.1)
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@@ -2659,7 +2672,7 @@ snapshots:
dependencies:
'@jest/fake-timers': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
jest-mock: 29.7.0
'@jest/expect-utils@29.7.0':
@@ -2677,7 +2690,7 @@ snapshots:
dependencies:
'@jest/types': 29.6.3
'@sinonjs/fake-timers': 10.3.0
'@types/node': 22.10.7
'@types/node': 22.13.1
jest-message-util: 29.7.0
jest-mock: 29.7.0
jest-util: 29.7.0
@@ -2699,7 +2712,7 @@ snapshots:
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@jridgewell/trace-mapping': 0.3.22
'@types/node': 22.10.7
'@types/node': 22.13.1
chalk: 4.1.2
collect-v8-coverage: 1.0.2
exit: 0.1.2
@@ -2769,7 +2782,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/yargs': 17.0.32
chalk: 4.1.2
@@ -2800,7 +2813,7 @@ snapshots:
'@nodelib/fs.walk@1.2.8':
dependencies:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.18.0
fastq: 1.19.0
'@pkgjs/parseargs@0.11.0':
optional: true
@@ -2856,7 +2869,7 @@ snapshots:
'@types/accepts@1.3.7':
dependencies:
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/babel__core@7.20.5':
dependencies:
@@ -2882,11 +2895,11 @@ snapshots:
'@types/body-parser@1.19.5':
dependencies:
'@types/connect': 3.4.38
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/connect@3.4.38':
dependencies:
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/content-disposition@0.5.8': {}
@@ -2895,13 +2908,13 @@ snapshots:
'@types/connect': 3.4.38
'@types/express': 5.0.0
'@types/keygrip': 1.0.6
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/estree@1.0.6': {}
'@types/express-serve-static-core@5.0.6':
dependencies:
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/qs': 6.9.18
'@types/range-parser': 1.2.7
'@types/send': 0.17.4
@@ -2915,7 +2928,7 @@ snapshots:
'@types/graceful-fs@4.1.9':
dependencies:
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/http-assert@1.5.6': {}
@@ -2957,7 +2970,7 @@ snapshots:
'@types/http-errors': 2.0.4
'@types/keygrip': 1.0.6
'@types/koa-compose': 3.2.8
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/mime@1.3.5': {}
@@ -2965,7 +2978,7 @@ snapshots:
dependencies:
'@types/express': 5.0.0
'@types/node@22.10.7':
'@types/node@22.13.1':
dependencies:
undici-types: 6.20.0
@@ -2976,12 +2989,12 @@ snapshots:
'@types/send@0.17.4':
dependencies:
'@types/mime': 1.3.5
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/serve-static@1.15.7':
dependencies:
'@types/http-errors': 2.0.4
'@types/node': 22.10.7
'@types/node': 22.13.1
'@types/send': 0.17.4
'@types/stack-utils@2.0.3': {}
@@ -2992,81 +3005,81 @@ snapshots:
dependencies:
'@types/yargs-parser': 21.0.3
'@typescript-eslint/eslint-plugin@8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)':
'@typescript-eslint/eslint-plugin@8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@eslint-community/regexpp': 4.12.1
'@typescript-eslint/parser': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
'@typescript-eslint/scope-manager': 8.21.0
'@typescript-eslint/type-utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
'@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
'@typescript-eslint/visitor-keys': 8.21.0
eslint: 9.18.0
'@typescript-eslint/parser': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/scope-manager': 8.24.0
'@typescript-eslint/type-utils': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/utils': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/visitor-keys': 8.24.0
eslint: 9.20.0
graphemer: 1.4.0
ignore: 5.3.2
natural-compare: 1.4.0
ts-api-utils: 2.0.0(typescript@5.7.3)
ts-api-utils: 2.0.1(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3)':
'@typescript-eslint/parser@8.24.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@typescript-eslint/scope-manager': 8.21.0
'@typescript-eslint/types': 8.21.0
'@typescript-eslint/typescript-estree': 8.21.0(typescript@5.7.3)
'@typescript-eslint/visitor-keys': 8.21.0
'@typescript-eslint/scope-manager': 8.24.0
'@typescript-eslint/types': 8.24.0
'@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3)
'@typescript-eslint/visitor-keys': 8.24.0
debug: 4.4.0
eslint: 9.18.0
eslint: 9.20.0
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/scope-manager@8.21.0':
'@typescript-eslint/scope-manager@8.24.0':
dependencies:
'@typescript-eslint/types': 8.21.0
'@typescript-eslint/visitor-keys': 8.21.0
'@typescript-eslint/types': 8.24.0
'@typescript-eslint/visitor-keys': 8.24.0
'@typescript-eslint/type-utils@8.21.0(eslint@9.18.0)(typescript@5.7.3)':
'@typescript-eslint/type-utils@8.24.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@typescript-eslint/typescript-estree': 8.21.0(typescript@5.7.3)
'@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
'@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3)
'@typescript-eslint/utils': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
debug: 4.4.0
eslint: 9.18.0
ts-api-utils: 2.0.0(typescript@5.7.3)
eslint: 9.20.0
ts-api-utils: 2.0.1(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/types@8.21.0': {}
'@typescript-eslint/types@8.24.0': {}
'@typescript-eslint/typescript-estree@8.21.0(typescript@5.7.3)':
'@typescript-eslint/typescript-estree@8.24.0(typescript@5.7.3)':
dependencies:
'@typescript-eslint/types': 8.21.0
'@typescript-eslint/visitor-keys': 8.21.0
'@typescript-eslint/types': 8.24.0
'@typescript-eslint/visitor-keys': 8.24.0
debug: 4.4.0
fast-glob: 3.3.3
is-glob: 4.0.3
minimatch: 9.0.5
semver: 7.6.3
ts-api-utils: 2.0.0(typescript@5.7.3)
semver: 7.7.1
ts-api-utils: 2.0.1(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@8.21.0(eslint@9.18.0)(typescript@5.7.3)':
'@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0)
'@typescript-eslint/scope-manager': 8.21.0
'@typescript-eslint/types': 8.21.0
'@typescript-eslint/typescript-estree': 8.21.0(typescript@5.7.3)
eslint: 9.18.0
'@eslint-community/eslint-utils': 4.4.1(eslint@9.20.0)
'@typescript-eslint/scope-manager': 8.24.0
'@typescript-eslint/types': 8.24.0
'@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3)
eslint: 9.20.0
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/visitor-keys@8.21.0':
'@typescript-eslint/visitor-keys@8.24.0':
dependencies:
'@typescript-eslint/types': 8.21.0
'@typescript-eslint/types': 8.24.0
eslint-visitor-keys: 4.2.0
accepts@1.3.8:
@@ -3284,13 +3297,13 @@ snapshots:
cookie@0.7.1: {}
create-jest@29.7.0(@types/node@22.10.7):
create-jest@29.7.0(@types/node@22.13.1):
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
jest-config: 29.7.0(@types/node@22.10.7)
jest-config: 29.7.0(@types/node@22.13.1)
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
@@ -3379,10 +3392,10 @@ snapshots:
escape-string-regexp@4.0.0: {}
eslint-plugin-prettier@5.2.3(eslint@9.18.0)(prettier@3.4.2):
eslint-plugin-prettier@5.2.3(eslint@9.20.0)(prettier@3.5.0):
dependencies:
eslint: 9.18.0
prettier: 3.4.2
eslint: 9.20.0
prettier: 3.5.0
prettier-linter-helpers: 1.0.0
synckit: 0.9.1
@@ -3395,14 +3408,14 @@ snapshots:
eslint-visitor-keys@4.2.0: {}
eslint@9.18.0:
eslint@9.20.0:
dependencies:
'@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0)
'@eslint-community/eslint-utils': 4.4.1(eslint@9.20.0)
'@eslint-community/regexpp': 4.12.1
'@eslint/config-array': 0.19.1
'@eslint/core': 0.10.0
'@eslint/core': 0.11.0
'@eslint/eslintrc': 3.2.0
'@eslint/js': 9.18.0
'@eslint/js': 9.20.0
'@eslint/plugin-kit': 0.2.5
'@humanfs/node': 0.16.6
'@humanwhocodes/module-importer': 1.0.1
@@ -3530,7 +3543,7 @@ snapshots:
fast-levenshtein@2.0.6: {}
fastq@1.18.0:
fastq@1.19.0:
dependencies:
reusify: 1.0.4
@@ -3817,7 +3830,7 @@ snapshots:
'@jest/expect': 29.7.0
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
chalk: 4.1.2
co: 4.6.0
dedent: 1.5.1
@@ -3837,16 +3850,16 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-cli@29.7.0(@types/node@22.10.7):
jest-cli@29.7.0(@types/node@22.13.1):
dependencies:
'@jest/core': 29.7.0
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
create-jest: 29.7.0(@types/node@22.10.7)
create-jest: 29.7.0(@types/node@22.13.1)
exit: 0.1.2
import-local: 3.1.0
jest-config: 29.7.0(@types/node@22.10.7)
jest-config: 29.7.0(@types/node@22.13.1)
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.2
@@ -3856,7 +3869,7 @@ snapshots:
- supports-color
- ts-node
jest-config@29.7.0(@types/node@22.10.7):
jest-config@29.7.0(@types/node@22.13.1):
dependencies:
'@babel/core': 7.23.9
'@jest/test-sequencer': 29.7.0
@@ -3881,7 +3894,7 @@ snapshots:
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 22.10.7
'@types/node': 22.13.1
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
@@ -3910,7 +3923,7 @@ snapshots:
'@jest/environment': 29.7.0
'@jest/fake-timers': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
jest-mock: 29.7.0
jest-util: 29.7.0
@@ -3920,7 +3933,7 @@ snapshots:
dependencies:
'@jest/types': 29.6.3
'@types/graceful-fs': 4.1.9
'@types/node': 22.10.7
'@types/node': 22.13.1
anymatch: 3.1.3
fb-watchman: 2.0.2
graceful-fs: 4.2.11
@@ -3959,7 +3972,7 @@ snapshots:
jest-mock@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
jest-util: 29.7.0
jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
@@ -3994,7 +4007,7 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
chalk: 4.1.2
emittery: 0.13.1
graceful-fs: 4.2.11
@@ -4022,7 +4035,7 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
chalk: 4.1.2
cjs-module-lexer: 1.2.3
collect-v8-coverage: 1.0.2
@@ -4068,7 +4081,7 @@ snapshots:
jest-util@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
chalk: 4.1.2
ci-info: 3.9.0
graceful-fs: 4.2.11
@@ -4087,7 +4100,7 @@ snapshots:
dependencies:
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.10.7
'@types/node': 22.13.1
ansi-escapes: 4.3.2
chalk: 4.1.2
emittery: 0.13.1
@@ -4096,17 +4109,17 @@ snapshots:
jest-worker@29.7.0:
dependencies:
'@types/node': 22.10.7
'@types/node': 22.13.1
jest-util: 29.7.0
merge-stream: 2.0.0
supports-color: 8.1.1
jest@29.7.0(@types/node@22.10.7):
jest@29.7.0(@types/node@22.13.1):
dependencies:
'@jest/core': 29.7.0
'@jest/types': 29.6.3
import-local: 3.1.0
jest-cli: 29.7.0(@types/node@22.10.7)
jest-cli: 29.7.0(@types/node@22.13.1)
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
@@ -4356,7 +4369,7 @@ snapshots:
dependencies:
fast-diff: 1.3.0
prettier@3.4.2: {}
prettier@3.5.0: {}
pretty-format@29.7.0:
dependencies:
@@ -4431,6 +4444,8 @@ snapshots:
semver@7.6.3: {}
semver@7.7.1: {}
send@0.19.0:
dependencies:
debug: 2.6.9
@@ -4579,18 +4594,18 @@ snapshots:
toidentifier@1.0.1: {}
ts-api-utils@2.0.0(typescript@5.7.3):
ts-api-utils@2.0.1(typescript@5.7.3):
dependencies:
typescript: 5.7.3
ts-deepmerge@7.0.2: {}
ts-jest@29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.10.7))(typescript@5.7.3):
ts-jest@29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.13.1))(typescript@5.7.3):
dependencies:
bs-logger: 0.2.6
ejs: 3.1.10
fast-json-stable-stringify: 2.1.0
jest: 29.7.0(@types/node@22.10.7)
jest: 29.7.0(@types/node@22.13.1)
jest-util: 29.7.0
json5: 2.2.3
lodash.memoize: 4.1.2
@@ -4626,12 +4641,12 @@ snapshots:
media-typer: 0.3.0
mime-types: 2.1.35
typescript-eslint@8.21.0(eslint@9.18.0)(typescript@5.7.3):
typescript-eslint@8.24.0(eslint@9.20.0)(typescript@5.7.3):
dependencies:
'@typescript-eslint/eslint-plugin': 8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)
'@typescript-eslint/parser': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
'@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
eslint: 9.18.0
'@typescript-eslint/eslint-plugin': 8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/parser': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/utils': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
eslint: 9.20.0
typescript: 5.7.3
transitivePeerDependencies:
- supports-color

View File

@@ -14,7 +14,7 @@ export RUST_LOG="warn,lemmy_server=$LEMMY_LOG_LEVEL,lemmy_federate=$LEMMY_LOG_LE
export LEMMY_TEST_FAST_FEDERATION=1 # by default, the persistent federation queue has delays in the scale of 30s-5min
PICTRS_PATH="api_tests/pict-rs"
PICTRS_EXPECTED_HASH="d5e6ceb49d955e9f839a191f88ae86d744c291fbca295bba0029518770634e38 api_tests/pict-rs"
PICTRS_EXPECTED_HASH="7f7ac2a45ef9b13403ee139b7512135be6b060ff2f6460e0c800e18e1b49d2fd api_tests/pict-rs"
# Pictrs setup. Download file with hash check and up to 3 retries.
if [ ! -f "$PICTRS_PATH" ]; then
@@ -22,8 +22,8 @@ if [ ! -f "$PICTRS_PATH" ]; then
while [ ! -f "$PICTRS_PATH" ] && [ "$count" -lt 3 ]
do
# This one sometimes goes down
# curl "https://git.asonix.dog/asonix/pict-rs/releases/download/v0.5.16/pict-rs-linux-amd64" -o "$PICTRS_PATH"
curl "https://codeberg.org/asonix/pict-rs/releases/download/v0.5.5/pict-rs-linux-amd64" -o "$PICTRS_PATH"
curl "https://git.asonix.dog/asonix/pict-rs/releases/download/v0.5.17-pre.9/pict-rs-linux-amd64" -o "$PICTRS_PATH"
# curl "https://codeberg.org/asonix/pict-rs/releases/download/v0.5.5/pict-rs-linux-amd64" -o "$PICTRS_PATH"
PICTRS_HASH=$(sha256sum "$PICTRS_PATH")
if [[ "$PICTRS_HASH" != "$PICTRS_EXPECTED_HASH" ]]; then
echo "Pictrs binary hash mismatch, was $PICTRS_HASH but expected $PICTRS_EXPECTED_HASH"

View File

@@ -10,7 +10,7 @@ use chrono::{DateTime, Utc};
use encoding_rs::{Encoding, UTF_8};
use futures::StreamExt;
use lemmy_db_schema::source::{
images::{ImageDetailsForm, LocalImage, LocalImageForm},
images::{ImageDetailsInsertForm, LocalImage, LocalImageForm},
post::{Post, PostUpdateForm},
site::Site,
};
@@ -339,17 +339,19 @@ pub struct PictrsFileDetails {
pub height: u16,
pub content_type: String,
pub created_at: DateTime<Utc>,
pub blurhash: Option<String>,
}
impl PictrsFileDetails {
/// Builds the image form. This should always use the thumbnail_url,
/// Because the post_view joins to it
pub fn build_image_details_form(&self, thumbnail_url: &Url) -> ImageDetailsForm {
ImageDetailsForm {
pub fn build_image_details_form(&self, thumbnail_url: &Url) -> ImageDetailsInsertForm {
ImageDetailsInsertForm {
link: thumbnail_url.clone().into(),
width: self.width.into(),
height: self.height.into(),
content_type: self.content_type.clone(),
blurhash: self.blurhash.clone(),
}
}
}

View File

@@ -1,7 +1,7 @@
use crate::{
newtypes::{DbUrl, LocalUserId},
schema::{image_details, local_image, remote_image},
source::images::{ImageDetails, ImageDetailsForm, LocalImage, LocalImageForm, RemoteImage},
source::images::{ImageDetails, ImageDetailsInsertForm, LocalImage, LocalImageForm, RemoteImage},
utils::{get_conn, DbPool},
};
use diesel::{
@@ -21,7 +21,7 @@ impl LocalImage {
pub async fn create(
pool: &mut DbPool<'_>,
form: &LocalImageForm,
image_details_form: &ImageDetailsForm,
image_details_form: &ImageDetailsInsertForm,
) -> Result<Self, Error> {
let conn = &mut get_conn(pool).await?;
conn
@@ -102,7 +102,10 @@ impl RemoteImage {
}
impl ImageDetails {
pub async fn create(pool: &mut DbPool<'_>, form: &ImageDetailsForm) -> Result<usize, Error> {
pub async fn create(
pool: &mut DbPool<'_>,
form: &ImageDetailsInsertForm,
) -> Result<usize, Error> {
let conn = &mut get_conn(pool).await?;
insert_into(image_details::table)

View File

@@ -350,6 +350,8 @@ diesel::table! {
width -> Int4,
height -> Int4,
content_type -> Text,
#[max_length = 50]
blurhash -> Nullable<Varchar>,
}
}

View File

@@ -62,14 +62,17 @@ pub struct ImageDetails {
pub width: i32,
pub height: i32,
pub content_type: String,
#[cfg_attr(feature = "full", ts(optional))]
pub blurhash: Option<String>,
}
#[derive(Debug, Clone)]
#[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
#[cfg_attr(feature = "full", diesel(table_name = image_details))]
pub struct ImageDetailsForm {
pub struct ImageDetailsInsertForm {
pub link: DbUrl,
pub width: i32,
pub height: i32,
pub content_type: String,
pub blurhash: Option<String>,
}

View File

@@ -75,7 +75,7 @@ services:
init: true
pictrs:
image: asonix/pictrs:0.5.16
image: asonix/pictrs:0.5.17-pre.9
# this needs to match the pictrs url in lemmy.hjson
hostname: pictrs
# we can set options to pictrs like this, here we set max. image size and forced format for conversion

View File

@@ -49,7 +49,7 @@ services:
pictrs:
restart: always
image: asonix/pictrs:0.5.16
image: asonix/pictrs:0.5.17-pre.9
user: 991:991
volumes:
- ./volumes/pictrs_alpha:/mnt:Z

View File

@@ -0,0 +1,3 @@
ALTER TABLE image_details
DROP COLUMN blurhash;

View File

@@ -0,0 +1,5 @@
-- Add a blurhash column for image_details
ALTER TABLE image_details
-- Supposed to be 20-30 chars, use 50 to be safe
ADD COLUMN blurhash varchar(50);