Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
feat(album): add hidden albums function (#172)
kenvie33b87c6d6039
diff --git a/app/app.vue b/app/app.vueindex babf44f5..5236ca3f 100644--- a/app/app.vue+++ b/app/app.vue@@ -33,7 +33,22 @@ useHead({`${title ? title + ' | ' : ''}${appTitle.value || 'ChronoFrame'}`,})-const { data, refresh, status } = useFetch('/api/photos')+// 根据用户登录状态和当前路由决定使用哪个 API+// 登录用户或后台管理页面显示所有照片,未登录用户在前端页面只显示可见照片+const route = useRoute()+const { loggedIn } = useUserSession()+const apiEndpoint = computed(() => {+ // 后台管理页面始终显示所有照片+ if (route.path.startsWith('/dashboard')) {+ return '/api/photos'+ }+ // 前端页面:登录用户显示所有照片,未登录用户只显示可见照片+ return loggedIn.value ? '/api/photos' : '/api/photos/visible'+})+const { data, refresh, status } = await useFetch(() => apiEndpoint.value, {+ watch: [apiEndpoint],+})+const photos = computed(() => (data.value as Photo[]) || [])const { switchToIndex, closeViewer, clearReturnRoute } = useViewerState()diff --git a/app/pages/albums/index.vue b/app/pages/albums/index.vueindex f978de3a..9918196f 100644--- a/app/pages/albums/index.vue+++ b/app/pages/albums/index.vue@@ -1,17 +1,30 @@<script lang="ts" setup>import { motion } from 'motion-v'-+import type { Album } from '~~/server/utils/db'+interface AlbumWithPhotos extends Album {+ photoIds?: string[]+}const config = useRuntimeConfig()const { photos } = usePhotos()-const { data: albums } = useAsyncData(+const { loggedIn } = useUserSession()+const { data: albums } = useAsyncData<AlbumWithPhotos[]>('albums',- // @ts-nocheck() => $fetch('/api/albums'),{watch: [],},)+// 根据登录状态决定是否过滤隐藏的相册+// 登录用户可以看到所有相册,未登录用户只能看到非隐藏相册+const visibleAlbums = computed(() => {+ if (loggedIn.value) {+ return albums.value || []+ }+ return (albums.value || []).filter((album) => !album.isHidden)+})++// randomly pick 30 photos for waterfallconst waterfallPhotos = computed(() =>photos.value.toSorted(() => 0.5 - Math.random()).slice(0, 30),@@ -57,10 +70,10 @@ const getPhotoById = (photoId: string) => {return photos.value.find((p) => p.id === photoId) || null}-const getAlbumDisplayPhotos = (album: any) => {+const getAlbumDisplayPhotos = (album: AlbumWithPhotos) => {if (!album.photoIds || album.photoIds.length === 0) return []- const displayPhotos = []+ const displayPhotos: Photo[] = []// 第一张:优先使用封面照片if (album.coverPhotoId) {@@ -200,7 +213,7 @@ const hoveredAlbum = ref<number | null>(null)class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-16"><NuxtLink- v-for="album in albums"+ v-for="album in visibleAlbums":key="album.id":to="`/albums/${album.id}`"class="block"diff --git a/app/pages/dashboard/albums.vue b/app/pages/dashboard/albums.vueindex 4cfb6293..23120ac1 100644--- a/app/pages/dashboard/albums.vue+++ b/app/pages/dashboard/albums.vue@@ -19,6 +19,7 @@ interface AlbumItem extends Album {interface AlbumFormState {title: stringdescription: string+ isHidden: boolean}const albums = ref<AlbumItem[]>([])@@ -35,6 +36,7 @@ const currentAlbum = ref<AlbumItem | null>(null)const formData = reactive<AlbumFormState>({title: '',description: '',+ isHidden: false,})const formRef = ref()@@ -101,6 +103,7 @@ const openCreateSlideover = () => {currentAlbum.value = nullformData.title = ''formData.description = ''+ formData.isHidden = falseselectedPhotoIds.value = []coverPhotoId.value = ''formRef.value?.clear()@@ -113,6 +116,7 @@ const openEditSlideover = async (album: AlbumItem) => {const albumDetail = (await $fetch(`/api/albums/${album.id}`)) as anyformData.title = album.titleformData.description = album.description || ''+ formData.isHidden = album.isHidden || falseselectedPhotoIds.value = (albumDetail.photos || []).map((p: Photo) => p.id)coverPhotoId.value = album.coverPhotoId || ''formRef.value?.clear()@@ -142,6 +146,7 @@ const onFormSubmit = async (event: FormSubmitEvent<AlbumFormState>) => {description: event.data.description || undefined,coverPhotoId: coverPhotoId.value || undefined,photoIds: selectedPhotoIds.value,+ isHidden: event.data.isHidden,},})@@ -159,6 +164,7 @@ const onFormSubmit = async (event: FormSubmitEvent<AlbumFormState>) => {description: event.data.description || undefined,coverPhotoId: coverPhotoId.value || undefined,photoIds: selectedPhotoIds.value,+ isHidden: event.data.isHidden,},})@@ -551,6 +557,17 @@ const columns: any[] = [:rows="3"/></UFormField>++ <UFormField+ :label="$t('dashboard.albums.form.isHidden')"+ name="isHidden"+ :hint="$t('dashboard.albums.form.isHiddenHint')"+ >+ <UCheckbox+ v-model="formData.isHidden"+ :label="$t('dashboard.albums.form.isHidden')"+ />+ </UFormField></UForm><!-- 照片选择部分 -->diff --git a/i18n/locales/zh-Hans.json b/i18n/locales/zh-Hans.jsonindex 74cc6ee3..235e932e 100644--- a/i18n/locales/zh-Hans.json+++ b/i18n/locales/zh-Hans.json@@ -693,7 +693,9 @@"selectPhotos": "选择照片","editPhotos": "修改照片选择","selectedCount": "已选择 {count} 张照片",- "clearAll": "全部清除"+ "clearAll": "全部清除",+ "isHidden": "隐藏相簿",+ "isHiddenHint": "隐藏的相簿中的照片不会在首页展示"},"table": {"columns": {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 07531912..97ecc580 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -2535,12 +2535,14 @@ packages:engines: {node: ^20.19.0 || >=22.12.0}cpu: [arm]os: [linux]+ libc: [glibc]'@oxfmt/[email protected]':resolution: {integrity: sha512-5eax+FkxyCqAi3Rw0mrZFr7+KTt/XweFsbALR+B5ljWBLBl8nHe4ADrUnb1gLEfQCJLl+Ca5FIVD4xEt95AwIw==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [arm]os: [linux]+ libc: [musl]'@oxfmt/[email protected]':resolution: {integrity: sha512-58l8JaHxSGOmOMOG2CIrNsnkRJAj0YcHQCmvNACniOa/vd1iRHhlPajczegzS5jwMENlqgreyiTR9iNlke8qCw==}diff --git a/server/api/albums/[albumId]/index.get.ts b/server/api/albums/[albumId]/index.get.tsindex 264995b6..ac101232 100644--- a/server/api/albums/[albumId]/index.get.ts+++ b/server/api/albums/[albumId]/index.get.ts@@ -26,6 +26,17 @@ export default eventHandler(async (event) => {statusMessage: 'Album not found',})}++ // 检查相册是否隐藏,如果隐藏则需要用户登录才能访问+ if (album.isHidden) {+ const session = await getUserSession(event)+ if (!session.user) {+ throw createError({+ statusCode: 404,+ statusMessage: 'Album not found',+ })+ }+ }// 获取相册中的照片const photos = await dbdiff --git a/server/api/albums/[albumId]/index.put.ts b/server/api/albums/[albumId]/index.put.tsindex bbdf9d78..fe3d590f 100644--- a/server/api/albums/[albumId]/index.put.ts+++ b/server/api/albums/[albumId]/index.put.ts@@ -20,6 +20,7 @@ export default eventHandler(async (event) => {description: z.string().max(1000).optional(),coverPhotoId: z.string().optional(),photoIds: z.array(z.string()).optional(),+ isHidden: z.boolean().optional(),}).parse,)@@ -57,6 +58,9 @@ export default eventHandler(async (event) => {if (body.coverPhotoId !== undefined) {updateData.coverPhotoId = body.coverPhotoId || null}+ if (body.isHidden !== undefined) {+ updateData.isHidden = body.isHidden+ }tx.update(tables.albums).set(updateData)diff --git a/server/api/albums/index.post.ts b/server/api/albums/index.post.tsindex f3d14d72..4e6d5b10 100644--- a/server/api/albums/index.post.ts+++ b/server/api/albums/index.post.ts@@ -10,6 +10,7 @@ export default eventHandler(async (event) => {description: z.string().max(1000).optional(),coverPhotoId: z.string().optional(),photoIds: z.array(z.string()).optional(),+ isHidden: z.boolean().optional(),}).parse,)@@ -22,6 +23,7 @@ export default eventHandler(async (event) => {title: body.title,description: body.description || null,coverPhotoId: body.coverPhotoId || null,+ isHidden: body.isHidden || false,}).returning().get()diff --git a/server/api/photos/visible.get.ts b/server/api/photos/visible.get.tsnew file mode 100644index 00000000..84ad3990--- /dev/null+++ b/server/api/photos/visible.get.ts@@ -0,0 +1,37 @@+import { desc, notInArray } from 'drizzle-orm'++export default eventHandler(async (_event) => {+ const db = useDB()++ // 获取所有隐藏相册中的照片ID+ const hiddenAlbumPhotos = db+ .select({+ photoId: tables.albumPhotos.photoId,+ })+ .from(tables.albumPhotos)+ .innerJoin(+ tables.albums,+ eq(tables.albumPhotos.albumId, tables.albums.id),+ )+ .where(eq(tables.albums.isHidden, true))+ .all()++ const hiddenPhotoIds = hiddenAlbumPhotos.map((row) => row.photoId)++ // 查询所有照片,排除隐藏相册中的照片+ if (hiddenPhotoIds.length > 0) {+ return db+ .select()+ .from(tables.photos)+ .where(notInArray(tables.photos.id, hiddenPhotoIds))+ .orderBy(desc(tables.photos.dateTaken))+ .all()+ }++ // 如果没有隐藏的照片,直接返回所有照片+ return db+ .select()+ .from(tables.photos)+ .orderBy(desc(tables.photos.dateTaken))+ .all()+})diff --git a/server/database/migrations/0010_bent_retro_girl.sql b/server/database/migrations/0010_bent_retro_girl.sqlnew file mode 100644index 00000000..4646711d--- /dev/null+++ b/server/database/migrations/0010_bent_retro_girl.sql@@ -0,0 +1 @@+ALTER TABLE `albums` ADD `is_hidden` integer DEFAULT false NOT NULL;\ No newline at end of filediff --git a/server/database/migrations/meta/0010_snapshot.json b/server/database/migrations/meta/0010_snapshot.jsonnew file mode 100644index 00000000..8582af71--- /dev/null+++ b/server/database/migrations/meta/0010_snapshot.json@@ -0,0 +1,788 @@+{+ "version": "6",+ "dialect": "sqlite",+ "id": "473f7c35-64dc-4089-b157-de72749f215b",+ "prevId": "7cab846e-ae9d-4fd2-a764-11c2ee301b47",+ "tables": {+ "album_photos": {+ "name": "album_photos",+ "columns": {+ "id": {+ "name": "id",+ "type": "integer",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": true+ },+ "album_id": {+ "name": "album_id",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "photo_id": {+ "name": "photo_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "position": {+ "name": "position",+ "type": "real",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 1000000+ },+ "added_at": {+ "name": "added_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ }+ },+ "indexes": {},+ "foreignKeys": {+ "album_photos_album_id_albums_id_fk": {+ "name": "album_photos_album_id_albums_id_fk",+ "tableFrom": "album_photos",+ "tableTo": "albums",+ "columnsFrom": [+ "album_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "album_photos_photo_id_photos_id_fk": {+ "name": "album_photos_photo_id_photos_id_fk",+ "tableFrom": "album_photos",+ "tableTo": "photos",+ "columnsFrom": [+ "photo_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "albums": {+ "name": "albums",+ "columns": {+ "id": {+ "name": "id",+ "type": "integer",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": true+ },+ "title": {+ "name": "title",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "cover_photo_id": {+ "name": "cover_photo_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "is_hidden": {+ "name": "is_hidden",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ }+ },+ "indexes": {},+ "foreignKeys": {+ "albums_cover_photo_id_photos_id_fk": {+ "name": "albums_cover_photo_id_photos_id_fk",+ "tableFrom": "albums",+ "tableTo": "photos",+ "columnsFrom": [+ "cover_photo_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "photo_reactions": {+ "name": "photo_reactions",+ "columns": {+ "id": {+ "name": "id",+ "type": "integer",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": true+ },+ "photo_id": {+ "name": "photo_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "reaction_type": {+ "name": "reaction_type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "fingerprint": {+ "name": "fingerprint",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "ip_address": {+ "name": "ip_address",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "user_agent": {+ "name": "user_agent",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ }+ },+ "indexes": {},+ "foreignKeys": {+ "photo_reactions_photo_id_photos_id_fk": {+ "name": "photo_reactions_photo_id_photos_id_fk",+ "tableFrom": "photo_reactions",+ "tableTo": "photos",+ "columnsFrom": [+ "photo_id"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "photos": {+ "name": "photos",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "title": {+ "name": "title",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "width": {+ "name": "width",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "height": {+ "name": "height",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "aspect_ratio": {+ "name": "aspect_ratio",+ "type": "real",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "date_taken": {+ "name": "date_taken",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "storage_key": {+ "name": "storage_key",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "thumbnail_key": {+ "name": "thumbnail_key",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "file_size": {+ "name": "file_size",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "last_modified": {+ "name": "last_modified",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "original_url": {+ "name": "original_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "thumbnail_url": {+ "name": "thumbnail_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "thumbnail_hash": {+ "name": "thumbnail_hash",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "tags": {+ "name": "tags",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "exif": {+ "name": "exif",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "latitude": {+ "name": "latitude",+ "type": "real",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "longitude": {+ "name": "longitude",+ "type": "real",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "country": {+ "name": "country",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "city": {+ "name": "city",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "location_name": {+ "name": "location_name",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "is_live_photo": {+ "name": "is_live_photo",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 0+ },+ "live_photo_video_url": {+ "name": "live_photo_video_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "live_photo_video_key": {+ "name": "live_photo_video_key",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "photos_id_unique": {+ "name": "photos_id_unique",+ "columns": [+ "id"+ ],+ "isUnique": true+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "pipeline_queue": {+ "name": "pipeline_queue",+ "columns": {+ "id": {+ "name": "id",+ "type": "integer",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": true+ },+ "payload": {+ "name": "payload",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'{\"type\":\"photo\",\"storageKey\":\"\"}'"+ },+ "priority": {+ "name": "priority",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 0+ },+ "attempts": {+ "name": "attempts",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 0+ },+ "max_attempts": {+ "name": "max_attempts",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 3+ },+ "status": {+ "name": "status",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'pending'"+ },+ "status_stage": {+ "name": "status_stage",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "error_message": {+ "name": "error_message",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ },+ "completed_at": {+ "name": "completed_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "settings": {+ "name": "settings",+ "columns": {+ "id": {+ "name": "id",+ "type": "integer",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": true+ },+ "namespace": {+ "name": "namespace",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'common'"+ },+ "key": {+ "name": "key",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "type": {+ "name": "type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "value": {+ "name": "value",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "default_value": {+ "name": "default_value",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "label": {+ "name": "label",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "is_public": {+ "name": "is_public",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ },+ "is_readonly": {+ "name": "is_readonly",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ },+ "is_secret": {+ "name": "is_secret",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ },+ "enum": {+ "name": "enum",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ },+ "updated_by": {+ "name": "updated_by",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "idx_namespace_key": {+ "name": "idx_namespace_key",+ "columns": [+ "namespace",+ "key"+ ],+ "isUnique": true+ }+ },+ "foreignKeys": {+ "settings_updated_by_users_id_fk": {+ "name": "settings_updated_by_users_id_fk",+ "tableFrom": "settings",+ "tableTo": "users",+ "columnsFrom": [+ "updated_by"+ ],+ "columnsTo": [+ "id"+ ],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "settings_storage_providers": {+ "name": "settings_storage_providers",+ "columns": {+ "id": {+ "name": "id",+ "type": "integer",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": true+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "provider": {+ "name": "provider",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "config": {+ "name": "config",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "users": {+ "name": "users",+ "columns": {+ "id": {+ "name": "id",+ "type": "integer",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": true+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "email": {+ "name": "email",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "password": {+ "name": "password",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "avatar": {+ "name": "avatar",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "is_admin": {+ "name": "is_admin",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 0+ }+ },+ "indexes": {+ "users_name_unique": {+ "name": "users_name_unique",+ "columns": [+ "name"+ ],+ "isUnique": true+ },+ "users_email_unique": {+ "name": "users_email_unique",+ "columns": [+ "email"+ ],+ "isUnique": true+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ }+ },+ "views": {},+ "enums": {},+ "_meta": {+ "schemas": {},+ "tables": {},+ "columns": {}+ },+ "internal": {+ "indexes": {}+ }+}\ No newline at end of filediff --git a/server/database/migrations/meta/_journal.json b/server/database/migrations/meta/_journal.jsonindex f192552c..6a094a68 100644--- a/server/database/migrations/meta/_journal.json+++ b/server/database/migrations/meta/_journal.json@@ -71,6 +71,13 @@"when": 1762089381492,"tag": "0009_careful_ultragirl","breakpoints": true+ },+ {+ "idx": 10,+ "version": "6",+ "when": 1775699286491,+ "tag": "0010_bent_retro_girl",+ "breakpoints": true}]-}+}\ No newline at end of filediff --git a/server/database/schema.ts b/server/database/schema.tsindex 41c39590..0765cac0 100644--- a/server/database/schema.ts+++ b/server/database/schema.ts@@ -133,6 +133,9 @@ export const albums = sqliteTable('albums', {coverPhotoId: text('cover_photo_id').references(() => photos.id, {onDelete: 'set null',}),+ isHidden: integer('is_hidden', { mode: 'boolean' })+ .default(false)+ .notNull(),createdAt: integer('created_at', { mode: 'timestamp' }).notNull().default(sql`(unixepoch())`),