summaryrefslogtreecommitdiff
path: root/src/immich.js
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-06-12 22:23:55 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-06-12 22:23:55 -0500
commit81ce440269a29d70de5c806f03d064b0897cf7db (patch)
tree8dbb3128b427023037551d39bac97f72cc10da6a /src/immich.js
parent043317fc36bf39ab073941eae4611645637aaee9 (diff)
downloadimmich-frame-81ce440269a29d70de5c806f03d064b0897cf7db.tar.xz
immich-frame-81ce440269a29d70de5c806f03d064b0897cf7db.zip
integrate tailwind more and a few other minor features
Diffstat (limited to 'src/immich.js')
-rw-r--r--src/immich.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/immich.js b/src/immich.js
deleted file mode 100644
index d938fea..0000000
--- a/src/immich.js
+++ /dev/null
@@ -1,48 +0,0 @@
-class ImmichConnector {
- constructor(url, apiKey) {
- this.url = url
- this.apiKey = apiKey
- }
-
- fetchAlbums() {
- return this.fetch("/albums")
- }
-
- #fetch(endpoint) {
- return fetch(this.url + "/api" + endpoint, {
- headers: { "x-api-key": this.apiKey }
- })
- }
-
- fetch(endpoint) {
- return this.#fetch(endpoint)
- .then(response => {
- if (!response.ok)
- throw new Error(`HTTP error! Status: ${response.status}`)
- return response.json()
- })
- .then(data => {
- return data
- })
- .catch(error => {
- console.error("Fetch error:", error)
- })
- }
-
- fetchImageSrc(key, size) {
- const url = `/assets/${key}/thumbnail` + (this.size ? `?size=${this.size}` : "")
- return this.#fetch(url)
- .then(response => {
- if (!response.ok)
- throw new Error(`HTTP error! Status: ${response.status}`)
- return response.blob()
- })
- .then(blob => {
- return URL.createObjectURL(blob)
- })
- }
-}
-
-const immichConnector = new ImmichConnector("http://192.168.1.13", "m5nqOoBc4uhAba21gZdCP3z8D3JT4GPxDXL2psd52EA")
-document.immichConnector = immichConnector // FIXME TEMP
-export default immichConnector