Alex Tran 1 rok pred
rodič
commit
22e5c6ead2

+ 70 - 0
server/immich-openapi-specs.json

@@ -376,6 +376,76 @@
         ]
         ]
       }
       }
     },
     },
+    "/album/{id}/rule": {
+      "post": {
+        "operationId": "addRule",
+        "parameters": [
+          {
+            "name": "id",
+            "required": true,
+            "in": "path",
+            "schema": {
+              "format": "uuid",
+              "type": "string"
+            }
+          }
+        ],
+        "responses": {
+          "201": {
+            "description": ""
+          }
+        },
+        "security": [
+          {
+            "bearer": []
+          },
+          {
+            "cookie": []
+          },
+          {
+            "api_key": []
+          }
+        ],
+        "tags": [
+          "Album"
+        ]
+      }
+    },
+    "/album/{id}/rule/{ruleId}": {
+      "delete": {
+        "operationId": "removeRule",
+        "parameters": [
+          {
+            "name": "id",
+            "required": true,
+            "in": "path",
+            "schema": {
+              "format": "uuid",
+              "type": "string"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": ""
+          }
+        },
+        "security": [
+          {
+            "bearer": []
+          },
+          {
+            "cookie": []
+          },
+          {
+            "api_key": []
+          }
+        ],
+        "tags": [
+          "Album"
+        ]
+      }
+    },
     "/album/{id}/user/{userId}": {
     "/album/{id}/user/{userId}": {
       "delete": {
       "delete": {
         "operationId": "removeUserFromAlbum",
         "operationId": "removeUserFromAlbum",

+ 10 - 0
server/src/immich/controllers/album.controller.ts

@@ -86,4 +86,14 @@ export class AlbumController {
   ) {
   ) {
     return this.service.removeUser(authUser, id, userId);
     return this.service.removeUser(authUser, id, userId);
   }
   }
+
+  @Post(':id/rule')
+  addRule(@AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto) {
+    throw new Error('Not implemented');
+  }
+
+  @Delete(':id/rule/:ruleId')
+  removeRule(@AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto) {
+    throw new Error('Not implemented');
+  }
 }
 }

+ 1 - 0
server/src/infra/entities/rule.entity.ts

@@ -29,4 +29,5 @@ export class RuleEntity {
 export enum RuleKey {
 export enum RuleKey {
   PERSON = 'personId',
   PERSON = 'personId',
   EXIF_CITY = 'exifInfo.city',
   EXIF_CITY = 'exifInfo.city',
+  DATE_AFTER = 'asset.fileCreatedAt',
 }
 }