mirror of
https://github.com/Afilmory/afilmory
synced 2026-04-24 23:05:05 +00:00
refactor(builder): remove maxPhotos option and related checks
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -181,7 +181,6 @@ pnpm dev
|
|||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"defaultConcurrency": 8,
|
"defaultConcurrency": 8,
|
||||||
"maxPhotos": 5000,
|
|
||||||
"enableLivePhotoDetection": true,
|
"enableLivePhotoDetection": true,
|
||||||
"showProgress": true,
|
"showProgress": true,
|
||||||
"showDetailedStats": true
|
"showDetailedStats": true
|
||||||
@@ -215,8 +214,7 @@ pnpm dev
|
|||||||
|
|
||||||
#### 构建选项 (`options`)
|
#### 构建选项 (`options`)
|
||||||
|
|
||||||
- `defaultConcurrency`: 默认并发数 (1-50)
|
- `defaultConcurrency`: 默认并发数
|
||||||
- `maxPhotos`: 最大照片数量限制
|
|
||||||
- `enableLivePhotoDetection`: 启用 Live Photo 检测
|
- `enableLivePhotoDetection`: 启用 Live Photo 检测
|
||||||
- `showProgress`: 显示构建进度
|
- `showProgress`: 显示构建进度
|
||||||
- `showDetailedStats`: 显示详细统计信息
|
- `showDetailedStats`: 显示详细统计信息
|
||||||
|
|||||||
@@ -95,13 +95,6 @@ export class PhotoGalleryBuilder {
|
|||||||
const imageObjects = await this.storageManager.listImages()
|
const imageObjects = await this.storageManager.listImages()
|
||||||
logger.main.info(`存储中找到 ${imageObjects.length} 张照片`)
|
logger.main.info(`存储中找到 ${imageObjects.length} 张照片`)
|
||||||
|
|
||||||
// 检查照片数量限制
|
|
||||||
if (imageObjects.length > this.config.options.maxPhotos) {
|
|
||||||
logger.main.warn(
|
|
||||||
`⚠️ 照片数量 (${imageObjects.length}) 超过配置限制 (${this.config.options.maxPhotos})`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建存储中存在的图片 key 集合,用于检测已删除的图片
|
// 创建存储中存在的图片 key 集合,用于检测已删除的图片
|
||||||
const s3ImageKeys = new Set(imageObjects.map((obj) => obj.key))
|
const s3ImageKeys = new Set(imageObjects.map((obj) => obj.key))
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ export interface BuilderConfig {
|
|||||||
// 默认并发限制
|
// 默认并发限制
|
||||||
defaultConcurrency: number
|
defaultConcurrency: number
|
||||||
|
|
||||||
// 最大照片数量限制
|
|
||||||
maxPhotos: number
|
|
||||||
|
|
||||||
// 支持的图片格式(可以覆盖默认的 SUPPORTED_FORMATS)
|
// 支持的图片格式(可以覆盖默认的 SUPPORTED_FORMATS)
|
||||||
supportedFormats?: Set<string>
|
supportedFormats?: Set<string>
|
||||||
|
|
||||||
@@ -87,7 +84,6 @@ export const defaultBuilderConfig: BuilderConfig = {
|
|||||||
|
|
||||||
options: {
|
options: {
|
||||||
defaultConcurrency: 10,
|
defaultConcurrency: 10,
|
||||||
maxPhotos: 10000,
|
|
||||||
enableLivePhotoDetection: true,
|
enableLivePhotoDetection: true,
|
||||||
showProgress: true,
|
showProgress: true,
|
||||||
showDetailedStats: true,
|
showDetailedStats: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user