pigallery2-extension-kit 3.5.2 → 3.6.0-edge
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/index.d.ts +1 -0
- package/index.js +2 -3
- package/lib/backend/Logger.d.ts +7 -7
- package/lib/backend/Logger.js +104 -0
- package/lib/backend/ProjectPath.d.ts +12 -0
- package/lib/backend/ProjectPath.js +28 -2
- package/lib/backend/exceptions/DirectoryNotFound.d.ts +2 -0
- package/lib/backend/exceptions/DirectoryNotFound.js +7 -0
- package/lib/backend/exceptions/FileAlreadyExists.js +10 -0
- package/lib/backend/exceptions/FolderNotWritable.d.ts +2 -0
- package/lib/backend/exceptions/FolderNotWritable.js +7 -0
- package/lib/backend/exceptions/LocationLookupException.js +10 -0
- package/lib/backend/index.d.ts +1 -1
- package/lib/backend/middlewares/AlbumMWs.js +61 -0
- package/lib/backend/middlewares/GalleryMWs.d.ts +4 -0
- package/lib/backend/middlewares/GalleryMWs.js +380 -0
- package/lib/backend/middlewares/MetaFileMWs.js +41 -0
- package/lib/backend/middlewares/NotificationMWs.js +21 -0
- package/lib/backend/middlewares/PersonMWs.d.ts +1 -1
- package/lib/backend/middlewares/PersonMWs.js +64 -0
- package/lib/backend/middlewares/RenderingMWs.d.ts +24 -0
- package/lib/backend/middlewares/RenderingMWs.js +182 -0
- package/lib/backend/middlewares/RequestParams.d.ts +13 -0
- package/lib/backend/middlewares/RequestParams.js +25 -0
- package/lib/backend/middlewares/RequestSession.d.ts +9 -0
- package/lib/backend/middlewares/RequestSession.js +16 -0
- package/lib/backend/middlewares/ServerTimingMWs.d.ts +6 -6
- package/lib/backend/middlewares/ServerTimingMWs.js +108 -0
- package/lib/backend/middlewares/SharingMWs.d.ts +2 -1
- package/lib/backend/middlewares/SharingMWs.js +240 -0
- package/lib/backend/middlewares/UploadMWs.js +95 -0
- package/lib/backend/middlewares/VersionMWs.d.ts +1 -1
- package/lib/backend/middlewares/VersionMWs.js +41 -0
- package/lib/backend/middlewares/admin/AdminMWs.js +115 -0
- package/lib/backend/middlewares/admin/ExtensionMWs.js +85 -0
- package/lib/backend/middlewares/admin/SettingsMWs.js +54 -0
- package/lib/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.d.ts +1 -1
- package/lib/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.js +153 -0
- package/lib/backend/middlewares/user/AuthenticationMWs.d.ts +37 -0
- package/lib/backend/middlewares/user/AuthenticationMWs.js +346 -0
- package/lib/backend/middlewares/user/OIDCAuthService.d.ts +36 -5
- package/lib/backend/middlewares/user/OIDCAuthService.js +216 -0
- package/lib/backend/middlewares/user/OIDCMWs.d.ts +10 -0
- package/lib/backend/middlewares/user/OIDCMWs.js +30 -0
- package/lib/backend/middlewares/user/UserMWs.d.ts +1 -0
- package/lib/backend/middlewares/user/UserMWs.js +120 -0
- package/lib/backend/middlewares/user/UserRequestConstrainsMWs.d.ts +0 -1
- package/lib/backend/middlewares/user/UserRequestConstrainsMWs.js +29 -0
- package/lib/backend/model/DirectoryAccess.d.ts +78 -0
- package/lib/backend/model/DirectoryAccess.js +222 -0
- package/lib/backend/model/EventLoopHandler.d.ts +1 -1
- package/lib/backend/model/EventLoopHandler.js +24 -0
- package/lib/backend/model/FFmpeg.d.ts +47 -0
- package/lib/backend/model/FFmpeg.js +75 -0
- package/lib/backend/model/FFmpegFactory.d.ts +11 -2
- package/lib/backend/model/FFmpegFactory.js +28 -0
- package/lib/backend/model/Localizations.js +19 -0
- package/lib/backend/model/ObjectManagers.d.ts +1 -1
- package/lib/backend/model/ObjectManagers.js +253 -0
- package/lib/backend/model/PasswordHelper.d.ts +1 -1
- package/lib/backend/model/PasswordHelper.js +6 -2
- package/lib/backend/model/SessionContext.d.ts +16 -6
- package/lib/backend/model/SessionContext.js +11 -0
- package/lib/backend/model/UploadManager.d.ts +6 -3
- package/lib/backend/model/UploadManager.js +101 -0
- package/lib/backend/model/database/AlbumManager.js +122 -0
- package/lib/backend/model/database/CoverManager.d.ts +8 -2
- package/lib/backend/model/database/CoverManager.js +169 -0
- package/lib/backend/model/database/GalleryManager.d.ts +15 -9
- package/lib/backend/model/database/GalleryManager.js +363 -0
- package/lib/backend/model/database/IObjectManager.js +2 -0
- package/lib/backend/model/database/IndexingManager.d.ts +7 -7
- package/lib/backend/model/database/IndexingManager.js +452 -0
- package/lib/backend/model/database/LocationManager.d.ts +2 -3
- package/lib/backend/model/database/LocationManager.js +39 -0
- package/lib/backend/model/database/PersonManager.d.ts +5 -3
- package/lib/backend/model/database/PersonManager.js +248 -0
- package/lib/backend/model/database/ProjectedCacheManager.d.ts +9 -8
- package/lib/backend/model/database/ProjectedCacheManager.js +297 -0
- package/lib/backend/model/database/ProjectionAwareManager.d.ts +4 -4
- package/lib/backend/model/database/ProjectionAwareManager.js +56 -0
- package/lib/backend/model/database/SQLConnection.d.ts +4 -2
- package/lib/backend/model/database/SQLConnection.js +295 -0
- package/lib/backend/model/database/SearchManager.d.ts +23 -8
- package/lib/backend/model/database/SearchManager.js +1032 -0
- package/lib/backend/model/database/SessionManager.d.ts +41 -4
- package/lib/backend/model/database/SessionManager.js +228 -0
- package/lib/backend/model/database/SharingManager.d.ts +11 -6
- package/lib/backend/model/database/SharingManager.js +160 -0
- package/lib/backend/model/database/UserManager.d.ts +8 -1
- package/lib/backend/model/database/UserManager.js +148 -0
- package/lib/backend/model/database/VersionManager.js +60 -0
- package/lib/backend/model/database/enitites/DirectoryEntity.d.ts +1 -1
- package/lib/backend/model/database/enitites/DirectoryEntity.js +76 -0
- package/lib/backend/model/database/enitites/EntityUtils.d.ts +22 -1
- package/lib/backend/model/database/enitites/EntityUtils.js +66 -0
- package/lib/backend/model/database/enitites/FileEntity.js +31 -0
- package/lib/backend/model/database/enitites/MDFileEntity.js +21 -0
- package/lib/backend/model/database/enitites/MediaEntity.d.ts +5 -2
- package/lib/backend/model/database/enitites/MediaEntity.js +223 -0
- package/lib/backend/model/database/enitites/PhotoEntity.js +19 -0
- package/lib/backend/model/database/enitites/ProjectedDirectoryCacheEntity.d.ts +2 -2
- package/lib/backend/model/database/enitites/ProjectedDirectoryCacheEntity.js +61 -0
- package/lib/backend/model/database/enitites/SharingEntity.d.ts +11 -5
- package/lib/backend/model/database/enitites/SharingEntity.js +100 -0
- package/lib/backend/model/database/enitites/UserEntity.d.ts +8 -5
- package/lib/backend/model/database/enitites/UserEntity.js +97 -0
- package/lib/backend/model/database/enitites/VersionEntity.js +19 -0
- package/lib/backend/model/database/enitites/VideoEntity.d.ts +2 -2
- package/lib/backend/model/database/enitites/VideoEntity.js +38 -0
- package/lib/backend/model/database/enitites/album/AlbumBaseEntity.js +32 -0
- package/lib/backend/model/database/enitites/album/ProjectedAlbumCacheEntity.d.ts +2 -2
- package/lib/backend/model/database/enitites/album/ProjectedAlbumCacheEntity.js +52 -0
- package/lib/backend/model/database/enitites/album/SavedSearchEntity.js +29 -0
- package/lib/backend/model/database/enitites/person/PersonEntry.js +36 -0
- package/lib/backend/model/database/enitites/person/PersonJunctionTable.js +37 -0
- package/lib/backend/model/database/enitites/person/ProjectedPersonCacheEntity.d.ts +1 -1
- package/lib/backend/model/database/enitites/person/ProjectedPersonCacheEntity.js +49 -0
- package/lib/backend/model/diagnostics/ConfigDiagnostics.d.ts +31 -12
- package/lib/backend/model/diagnostics/ConfigDiagnostics.js +537 -0
- package/lib/backend/model/extension/ExpressRouterWrapper.d.ts +10 -4
- package/lib/backend/model/extension/ExpressRouterWrapper.js +113 -0
- package/lib/backend/model/extension/ExtensionApp.d.ts +2 -3
- package/lib/backend/model/extension/ExtensionApp.js +18 -0
- package/lib/backend/model/extension/ExtensionConfig.js +17 -0
- package/lib/backend/model/extension/ExtensionConfigTemplateLoader.js +4 -3
- package/lib/backend/model/extension/ExtensionConfigWrapper.js +6 -5
- package/lib/backend/model/extension/ExtensionDB.d.ts +2 -2
- package/lib/backend/model/extension/ExtensionDB.js +22 -0
- package/lib/backend/model/extension/ExtensionDecorator.js +33 -0
- package/lib/backend/model/extension/ExtensionEvent.d.ts +12 -1
- package/lib/backend/model/extension/ExtensionEvent.js +81 -0
- package/lib/backend/model/extension/ExtensionManager.d.ts +22 -4
- package/lib/backend/model/extension/ExtensionManager.js +424 -0
- package/lib/backend/model/extension/ExtensionMessengerHandler.js +28 -0
- package/lib/backend/model/extension/ExtensionObject.d.ts +6 -3
- package/lib/backend/model/extension/ExtensionObject.js +45 -0
- package/lib/backend/model/extension/ExtensionRepository.js +69 -0
- package/lib/backend/model/extension/IExtension.d.ts +35 -18
- package/lib/backend/model/extension/IExtension.js +2 -0
- package/lib/backend/model/extension/UIExtension.js +23 -0
- package/lib/backend/model/fileaccess/DiskManager.d.ts +3 -1
- package/lib/backend/model/fileaccess/DiskManager.js +313 -0
- package/lib/backend/model/fileaccess/MetadataCreationDate.js +27 -0
- package/lib/backend/model/fileaccess/MetadataLoader.d.ts +17 -0
- package/lib/backend/model/fileaccess/MetadataLoader.js +765 -0
- package/lib/backend/model/fileaccess/PhotoWorker.js +159 -0
- package/lib/backend/model/fileaccess/TaskExecuter.js +41 -0
- package/lib/backend/model/fileaccess/TaskQue.d.ts +4 -4
- package/lib/backend/model/fileaccess/TaskQue.js +50 -0
- package/lib/backend/model/fileaccess/VideoConverterWorker.d.ts +4 -1
- package/lib/backend/model/fileaccess/VideoConverterWorker.js +59 -0
- package/lib/backend/model/fileaccess/fileprocessing/GPXProcessing.js +136 -0
- package/lib/backend/model/fileaccess/fileprocessing/PhotoProcessing.d.ts +3 -2
- package/lib/backend/model/fileaccess/fileprocessing/PhotoProcessing.js +251 -0
- package/lib/backend/model/fileaccess/fileprocessing/VideoProcessing.js +97 -0
- package/lib/backend/model/jobs/JobManager.d.ts +2 -4
- package/lib/backend/model/jobs/JobManager.js +129 -0
- package/lib/backend/model/jobs/JobProgressManager.d.ts +5 -3
- package/lib/backend/model/jobs/JobProgressManager.js +94 -0
- package/lib/backend/model/jobs/JobRepository.d.ts +1 -3
- package/lib/backend/model/jobs/JobRepository.js +50 -0
- package/lib/backend/model/jobs/jobs/AlbumCoverFillingJob.d.ts +1 -1
- package/lib/backend/model/jobs/jobs/AlbumCoverFillingJob.js +91 -0
- package/lib/backend/model/jobs/jobs/AlbumCoverResetJob.js +32 -0
- package/lib/backend/model/jobs/jobs/AlbumResetJob.js +30 -0
- package/lib/backend/model/jobs/jobs/FileJob.js +243 -0
- package/lib/backend/model/jobs/jobs/GPXCompressionJob.js +35 -0
- package/lib/backend/model/jobs/jobs/GPXCompressionResetJob.js +23 -0
- package/lib/backend/model/jobs/jobs/GalleryResetJob.js +30 -0
- package/lib/backend/model/jobs/jobs/IJob.js +2 -0
- package/lib/backend/model/jobs/jobs/IJobListener.d.ts +2 -2
- package/lib/backend/model/jobs/jobs/IJobListener.js +2 -0
- package/lib/backend/model/jobs/jobs/IndexingJob.js +99 -0
- package/lib/backend/model/jobs/jobs/Job.d.ts +4 -1
- package/lib/backend/model/jobs/jobs/Job.js +135 -0
- package/lib/backend/model/jobs/jobs/JobProgress.js +100 -0
- package/lib/backend/model/jobs/jobs/PhotoConvertingJob.js +78 -0
- package/lib/backend/model/jobs/jobs/TempFolderCleaningJob.js +122 -0
- package/lib/backend/model/jobs/jobs/TopPickSendJob.js +113 -0
- package/lib/backend/model/jobs/jobs/VideoConvertingJob.js +31 -0
- package/lib/backend/model/messenger/EmailMessenger.d.ts +1 -1
- package/lib/backend/model/messenger/EmailMessenger.js +87 -0
- package/lib/backend/model/messenger/ExtensionMessenger.js +16 -0
- package/lib/backend/model/messenger/Messenger.d.ts +1 -2
- package/lib/backend/model/messenger/Messenger.js +36 -0
- package/lib/backend/model/messenger/MessengerRepository.d.ts +1 -3
- package/lib/backend/model/messenger/MessengerRepository.js +38 -0
- package/lib/backend/model/messenger/StdoutMessenger.js +16 -0
- package/lib/backend/routes/AlbumRouter.js +39 -0
- package/lib/backend/routes/ErrorRouter.d.ts +1 -0
- package/lib/backend/routes/ErrorRouter.js +39 -0
- package/lib/backend/routes/GalleryRouter.d.ts +8 -0
- package/lib/backend/routes/GalleryRouter.js +165 -0
- package/lib/backend/routes/LoggerRouter.js +43 -0
- package/lib/backend/routes/NotificationRouter.js +19 -0
- package/lib/backend/routes/OIDCRouter.js +20 -0
- package/lib/backend/routes/PersonRouter.js +41 -0
- package/lib/backend/routes/PublicRouter.d.ts +3 -6
- package/lib/backend/routes/PublicRouter.js +301 -0
- package/lib/backend/routes/Router.js +36 -0
- package/lib/backend/routes/SharingRouter.d.ts +1 -1
- package/lib/backend/routes/SharingRouter.js +55 -0
- package/lib/backend/routes/UploadRouter.js +18 -0
- package/lib/backend/routes/UserRouter.d.ts +1 -0
- package/lib/backend/routes/UserRouter.js +53 -0
- package/lib/backend/routes/admin/AdminRouter.js +32 -0
- package/lib/backend/routes/admin/ExtensionRouter.js +30 -0
- package/lib/backend/routes/admin/SettingsRouter.js +18 -0
- package/lib/backend/server.d.ts +3 -3
- package/lib/backend/server.js +176 -0
- package/lib/common/CookieNames.js +10 -0
- package/lib/common/CustomHeaders.js +8 -0
- package/lib/common/DataStructureVersion.d.ts +1 -1
- package/lib/common/DataStructureVersion.js +7 -0
- package/lib/common/PG2ConfMap.js +36 -0
- package/lib/common/QueryParams.js +45 -0
- package/lib/common/SearchQueryParser.d.ts +2 -2
- package/lib/common/SearchQueryParser.js +611 -0
- package/lib/common/SearchQueryUtils.d.ts +71 -4
- package/lib/common/SearchQueryUtils.js +443 -0
- package/lib/common/SupportedFormats.d.ts +11 -1
- package/lib/common/SupportedFormats.js +13 -19
- package/lib/common/TextFold.d.ts +6 -0
- package/lib/common/TextFold.js +19 -0
- package/lib/common/UploadUtils.d.ts +4 -0
- package/lib/common/UploadUtils.js +20 -0
- package/lib/common/Utils.d.ts +23 -24
- package/lib/common/Utils.js +37 -97
- package/lib/common/config/private/Config.d.ts +1 -1
- package/lib/common/config/private/Config.js +2 -0
- package/lib/common/config/private/PrivateConfig.d.ts +17 -4
- package/lib/common/config/private/PrivateConfig.js +262 -33
- package/lib/common/config/private/PrivateConfigClass.js +10 -13
- package/lib/common/config/private/WebConfig.d.ts +1 -2
- package/lib/common/config/private/WebConfig.js +0 -2
- package/lib/common/config/private/subconfigs/MessagingConfig.js +8 -0
- package/lib/common/config/private/subconfigs/ServerExtensionsConfig.d.ts +2 -3
- package/lib/common/config/private/subconfigs/ServerExtensionsConfig.js +7 -3
- package/lib/common/config/public/ClientConfig.d.ts +55 -17
- package/lib/common/config/public/ClientConfig.js +291 -20
- package/lib/common/config/public/Config.js +5 -4
- package/lib/common/entities/AutoCompleteItem.d.ts +3 -3
- package/lib/common/entities/ContentWrapper.d.ts +21 -8
- package/lib/common/entities/ContentWrapper.js +286 -318
- package/lib/common/entities/DirectoryDTO.d.ts +7 -6
- package/lib/common/entities/DirectoryDTO.js +10 -5
- package/lib/common/entities/Error.d.ts +12 -7
- package/lib/common/entities/Error.js +15 -3
- package/lib/common/entities/MediaDTO.d.ts +13 -0
- package/lib/common/entities/MediaDTO.js +10 -7
- package/lib/common/entities/Message.d.ts +3 -3
- package/lib/common/entities/NotificationDTO.d.ts +2 -2
- package/lib/common/entities/SearchQueryDTO.d.ts +9 -1
- package/lib/common/entities/SearchQueryDTO.js +1 -0
- package/lib/common/entities/SharingDTO.d.ts +39 -5
- package/lib/common/entities/SortingMethods.d.ts +26 -2
- package/lib/common/entities/SortingMethods.js +14 -1
- package/lib/common/entities/UserDTO.d.ts +5 -2
- package/lib/common/entities/UserSettingsDTO.d.ts +3 -1
- package/lib/common/entities/VideoDTO.d.ts +2 -5
- package/lib/common/entities/album/AlbumBaseDTO.d.ts +2 -2
- package/lib/common/entities/extension/ExtensionListItem.d.ts +1 -1
- package/lib/common/entities/extension/IClientUIConfig.d.ts +19 -12
- package/lib/common/entities/job/JobDTO.d.ts +1 -1
- package/lib/common/entities/job/JobProgressDTO.d.ts +1 -1
- package/lib/common/entities/job/JobScheduleDTO.d.ts +5 -5
- package/lib/common/entities/job/JobScheduleDTO.js +9 -5
- package/lib/common/event/Event.js +49 -0
- package/lib/common/event/EventLimit.d.ts +1 -1
- package/package.json +21 -8
- package/REPOSITORY.md +0 -13
- package/events.drawio +0 -1
- package/events.png +0 -0
- package/index.js.map +0 -1
- package/index.ts +0 -2
- package/lib/backend/model/database/enitites/PersonEntry.d.ts +0 -11
- package/lib/backend/model/database/enitites/PersonJunctionTable.d.ts +0 -10
- package/lib/common/entities/ConentWrapper.d.ts +0 -18
- package/lib/common/entities/ConentWrapper.js +0 -490
- package/lib/frontend/app/app.component.d.ts +0 -18
- package/lib/frontend/app/app.module.d.ts +0 -23
- package/lib/frontend/app/app.routing.d.ts +0 -4
- package/lib/frontend/app/icon.component.d.ts +0 -7
- package/lib/frontend/app/model/IRenderable.d.ts +0 -17
- package/lib/frontend/app/model/backendtext.service.d.ts +0 -7
- package/lib/frontend/app/model/backendtext.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/extension.service.d.ts +0 -5
- package/lib/frontend/app/model/navigation.service.d.ts +0 -12
- package/lib/frontend/app/model/network/autehentication.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/network/authentication.service.d.ts +0 -22
- package/lib/frontend/app/model/network/helper/auth.guard.d.ts +0 -9
- package/lib/frontend/app/model/network/helper/csrf.interceptor.d.ts +0 -8
- package/lib/frontend/app/model/network/helper/error.interceptor.d.ts +0 -8
- package/lib/frontend/app/model/network/network.service.d.ts +0 -29
- package/lib/frontend/app/model/network/network.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/network/user.service.d.ts +0 -13
- package/lib/frontend/app/model/network/user.service.spec.d.ts +0 -1
- package/lib/frontend/app/model/notification.service.d.ts +0 -28
- package/lib/frontend/app/model/page.helper.d.ts +0 -15
- package/lib/frontend/app/model/pi-title.service.d.ts +0 -15
- package/lib/frontend/app/model/query.service.d.ts +0 -19
- package/lib/frontend/app/model/seededRandom.service.d.ts +0 -7
- package/lib/frontend/app/model/theme.service.d.ts +0 -16
- package/lib/frontend/app/model/version.service.d.ts +0 -10
- package/lib/frontend/app/pipes/DurationPipe.d.ts +0 -4
- package/lib/frontend/app/pipes/FileDTOToPathPipe.d.ts +0 -5
- package/lib/frontend/app/pipes/FileDTOToRelativePathPipe.d.ts +0 -5
- package/lib/frontend/app/pipes/FileSizePipe.d.ts +0 -4
- package/lib/frontend/app/pipes/GPXFilesFilterPipe.d.ts +0 -5
- package/lib/frontend/app/pipes/MDFilesFilterPipe.d.ts +0 -6
- package/lib/frontend/app/pipes/ParseIntPipe.d.ts +0 -4
- package/lib/frontend/app/pipes/PhotoFilterPipe.d.ts +0 -6
- package/lib/frontend/app/pipes/SafeHTMLPipe.d.ts +0 -7
- package/lib/frontend/app/pipes/StringifyEnum.d.ts +0 -4
- package/lib/frontend/app/pipes/StringifyGridSize.d.ts +0 -5
- package/lib/frontend/app/pipes/StringifyRolePipe.d.ts +0 -4
- package/lib/frontend/app/pipes/StringifySearchQuery.d.ts +0 -8
- package/lib/frontend/app/pipes/StringifySearchType.d.ts +0 -5
- package/lib/frontend/app/pipes/StringifySortingMethod.d.ts +0 -4
- package/lib/frontend/app/ui/EnumTranslations.d.ts +0 -5
- package/lib/frontend/app/ui/admin/admin.component.d.ts +0 -36
- package/lib/frontend/app/ui/albums/album/album.component.d.ts +0 -26
- package/lib/frontend/app/ui/albums/albums.component.d.ts +0 -31
- package/lib/frontend/app/ui/albums/albums.service.d.ts +0 -12
- package/lib/frontend/app/ui/albums/saved-search-popup/saved-search-popup.component.d.ts +0 -15
- package/lib/frontend/app/ui/duplicates/duplicates.component.d.ts +0 -36
- package/lib/frontend/app/ui/duplicates/duplicates.service.d.ts +0 -9
- package/lib/frontend/app/ui/duplicates/photo/photo.duplicates.component.d.ts +0 -11
- package/lib/frontend/app/ui/faces/Person.d.ts +0 -9
- package/lib/frontend/app/ui/faces/face/face.component.d.ts +0 -22
- package/lib/frontend/app/ui/faces/faces.component.d.ts +0 -18
- package/lib/frontend/app/ui/faces/faces.service.d.ts +0 -14
- package/lib/frontend/app/ui/faces/navigator/navigator.faces.component.d.ts +0 -15
- package/lib/frontend/app/ui/frame/frame.component.d.ts +0 -60
- package/lib/frontend/app/ui/gallery/Media.d.ts +0 -15
- package/lib/frontend/app/ui/gallery/MediaIcon.d.ts +0 -29
- package/lib/frontend/app/ui/gallery/blog/blog.gallery.component.d.ts +0 -16
- package/lib/frontend/app/ui/gallery/blog/blog.service.d.ts +0 -85
- package/lib/frontend/app/ui/gallery/blog/blog.service.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/cache.gallery.service.d.ts +0 -51
- package/lib/frontend/app/ui/gallery/content.service.d.ts +0 -11
- package/lib/frontend/app/ui/gallery/contentLoader.service.d.ts +0 -37
- package/lib/frontend/app/ui/gallery/directories/directories.component.d.ts +0 -14
- package/lib/frontend/app/ui/gallery/directories/directory/directory.gallery.component.d.ts +0 -20
- package/lib/frontend/app/ui/gallery/filter/filter.gallery.component.d.ts +0 -32
- package/lib/frontend/app/ui/gallery/filter/filter.service.d.ts +0 -51
- package/lib/frontend/app/ui/gallery/filter/filter.service.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/fullscreen.service.d.ts +0 -7
- package/lib/frontend/app/ui/gallery/gallery.component.d.ts +0 -64
- package/lib/frontend/app/ui/gallery/gallery.component.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/gallery.service.d.ts +0 -13
- package/lib/frontend/app/ui/gallery/grid/GridMedia.d.ts +0 -13
- package/lib/frontend/app/ui/gallery/grid/GridRowBuilder.d.ts +0 -16
- package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.d.ts +0 -88
- package/lib/frontend/app/ui/gallery/grid/grid.gallery.component.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.d.ts +0 -4
- package/lib/frontend/app/ui/gallery/grid/photo/media-button-modal/media-button-modal.component.d.ts +0 -20
- package/lib/frontend/app/ui/gallery/grid/photo/media-button-modal/media-button-modal.service.d.ts +0 -27
- package/lib/frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.d.ts +0 -53
- package/lib/frontend/app/ui/gallery/lightbox/controls/controls.lightbox.gallery.component.d.ts +0 -103
- package/lib/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.d.ts +0 -51
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.d.ts +0 -95
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.spec.d.ts +0 -1
- package/lib/frontend/app/ui/gallery/lightbox/lightbox.service.d.ts +0 -45
- package/lib/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.d.ts +0 -71
- package/lib/frontend/app/ui/gallery/map/MarkerFactory.d.ts +0 -12
- package/lib/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.d.ts +0 -80
- package/lib/frontend/app/ui/gallery/map/map.gallery.component.d.ts +0 -36
- package/lib/frontend/app/ui/gallery/map/map.service.d.ts +0 -30
- package/lib/frontend/app/ui/gallery/navigator/navigator.gallery.component.d.ts +0 -81
- package/lib/frontend/app/ui/gallery/navigator/navigator.service.d.ts +0 -14
- package/lib/frontend/app/ui/gallery/navigator/sorting.service.d.ts +0 -38
- package/lib/frontend/app/ui/gallery/overlay.service.d.ts +0 -9
- package/lib/frontend/app/ui/gallery/photo-frame-builder/photo-frame-builder.gallery.component.d.ts +0 -40
- package/lib/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.d.ts +0 -30
- package/lib/frontend/app/ui/gallery/search/AutoCompleteRenderItem.d.ts +0 -11
- package/lib/frontend/app/ui/gallery/search/autocomplete.service.d.ts +0 -33
- package/lib/frontend/app/ui/gallery/search/query-builder/query-bulder.gallery.component.d.ts +0 -22
- package/lib/frontend/app/ui/gallery/search/query-enrty/query-entry.search.gallery.component.d.ts +0 -43
- package/lib/frontend/app/ui/gallery/search/search-field/search-field.gallery.component.d.ts +0 -31
- package/lib/frontend/app/ui/gallery/search/search-field-base/search-field-base.gallery.component.d.ts +0 -57
- package/lib/frontend/app/ui/gallery/search/search-query-parser.service.d.ts +0 -7
- package/lib/frontend/app/ui/gallery/search/search.gallery.component.d.ts +0 -39
- package/lib/frontend/app/ui/gallery/share/share.gallery.component.d.ts +0 -67
- package/lib/frontend/app/ui/gallery/share.service.d.ts +0 -35
- package/lib/frontend/app/ui/gallery/thumbnailLoader.service.d.ts +0 -41
- package/lib/frontend/app/ui/gallery/thumbnailManager.service.d.ts +0 -46
- package/lib/frontend/app/ui/gallery/uploader/uploader.gallery.component.d.ts +0 -15
- package/lib/frontend/app/ui/gallery/uploader/uploader.service.d.ts +0 -36
- package/lib/frontend/app/ui/gallery/wakelock.service.d.ts +0 -19
- package/lib/frontend/app/ui/language/language.component.d.ts +0 -10
- package/lib/frontend/app/ui/login/login.component.d.ts +0 -18
- package/lib/frontend/app/ui/settings/extension-installer/extension-installer.component.d.ts +0 -18
- package/lib/frontend/app/ui/settings/extension-installer/extension-installer.service.d.ts +0 -10
- package/lib/frontend/app/ui/settings/gallery-statistic/gallery-statistic.component.d.ts +0 -5
- package/lib/frontend/app/ui/settings/scheduled-jobs.service.d.ts +0 -41
- package/lib/frontend/app/ui/settings/settings.service.d.ts +0 -27
- package/lib/frontend/app/ui/settings/sharings-list/sharings-list.component.d.ts +0 -14
- package/lib/frontend/app/ui/settings/template/CustomSettingsEntries.d.ts +0 -57
- package/lib/frontend/app/ui/settings/template/ISettingsComponent.d.ts +0 -13
- package/lib/frontend/app/ui/settings/template/settings-entry/settings-entry.component.d.ts +0 -118
- package/lib/frontend/app/ui/settings/template/settings-entry/sorting-method/sorting-method.settings-entry.component.d.ts +0 -28
- package/lib/frontend/app/ui/settings/template/template.component.d.ts +0 -97
- package/lib/frontend/app/ui/settings/users/users.component.d.ts +0 -47
- package/lib/frontend/app/ui/settings/users/users.service.d.ts +0 -12
- package/lib/frontend/app/ui/settings/workflow/button/job-button.settings.component.d.ts +0 -32
- package/lib/frontend/app/ui/settings/workflow/progress/job-progress.settings.component.d.ts +0 -25
- package/lib/frontend/app/ui/settings/workflow/workflow.component.d.ts +0 -68
- package/lib/frontend/app/ui/sharelogin/share-login.component.d.ts +0 -16
- package/lib/frontend/app/ui/utils/grid-size-icon/grid-size-icon.component.d.ts +0 -5
- package/lib/frontend/app/ui/utils/sorting-method-icon/sorting-method-icon.component.d.ts +0 -13
- package/lib/frontend/app/ui/utils/timestamp-datepicker/datepicker.component.d.ts +0 -10
- package/lib/frontend/app/ui/utils/timestamp-timepicker/timepicker.component.d.ts +0 -11
- package/lib/frontend/environments/environment.d.ts +0 -3
- package/lib/frontend/environments/environment.prod.d.ts +0 -3
- package/lib/frontend/main.d.ts +0 -21
- package/lib/frontend/polyfills.d.ts +0 -60
- package/lib/frontend/test.d.ts +0 -1
|
@@ -6,7 +6,7 @@ import { ProjectPathClass } from '../../ProjectPath';
|
|
|
6
6
|
import { ILogger } from '../../Logger';
|
|
7
7
|
import { UserDTO, UserRoles } from '../../../common/entities/UserDTO';
|
|
8
8
|
import { ParamsDictionary } from 'express-serve-static-core';
|
|
9
|
-
import {
|
|
9
|
+
import { DataSource, Repository } from 'typeorm';
|
|
10
10
|
import { DynamicConfig } from '../../../common/entities/DynamicConfig';
|
|
11
11
|
import { MediaDTOWithThPath } from '../messenger/Messenger';
|
|
12
12
|
import { PhotoMetadata } from '../../../common/entities/PhotoDTO';
|
|
@@ -14,7 +14,7 @@ import { VideoMetadata } from '../../../common/entities/VideoDTO';
|
|
|
14
14
|
import { MediaRendererInput, SvgRendererInput } from '../fileaccess/PhotoWorker';
|
|
15
15
|
import { SearchQueryDTO } from '../../../common/entities/SearchQueryDTO';
|
|
16
16
|
import { CoverPhotoDTOWithID } from '../database/CoverManager';
|
|
17
|
-
import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
17
|
+
import { DirectoryPathDTO, ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
18
18
|
import { DirectoryScanSettings } from '../fileaccess/DiskManager';
|
|
19
19
|
import { SessionContext } from '../SessionContext';
|
|
20
20
|
import { IClientMediaButtonConfig, IMediaRequestBodyData } from '../../../common/entities/extension/IClientUIConfig';
|
|
@@ -50,7 +50,7 @@ export interface IExtensionEvents {
|
|
|
50
50
|
{
|
|
51
51
|
searchQuery: SearchQueryDTO;
|
|
52
52
|
}
|
|
53
|
-
], CoverPhotoDTOWithID>;
|
|
53
|
+
], CoverPhotoDTOWithID | null>;
|
|
54
54
|
getCoverForDirectory: IExtensionEvent<[
|
|
55
55
|
session: SessionContext,
|
|
56
56
|
{
|
|
@@ -58,19 +58,19 @@ export interface IExtensionEvents {
|
|
|
58
58
|
name: string;
|
|
59
59
|
path: string;
|
|
60
60
|
}
|
|
61
|
-
], CoverPhotoDTOWithID>;
|
|
61
|
+
], CoverPhotoDTOWithID | null>;
|
|
62
62
|
};
|
|
63
63
|
ProjectedCacheManager: {
|
|
64
64
|
/**
|
|
65
65
|
* Invalidates directory covers and caches for a given directory and every parent
|
|
66
66
|
*/
|
|
67
|
-
invalidateDirectoryCache: IExtensionEvent<[
|
|
67
|
+
invalidateDirectoryCache: IExtensionEvent<[DirectoryPathDTO], void>;
|
|
68
68
|
/**
|
|
69
69
|
* Returns the projected directory cache for a given directory
|
|
70
70
|
* ProjectedDirectoryCacheEntity contains information, like the number of photos, videos, etc..
|
|
71
71
|
*/
|
|
72
72
|
getCacheForDirectory: IExtensionEvent<[
|
|
73
|
-
connection:
|
|
73
|
+
connection: DataSource,
|
|
74
74
|
session: SessionContext,
|
|
75
75
|
dir: {
|
|
76
76
|
id: number;
|
|
@@ -126,34 +126,50 @@ export interface IMediaRequestBody {
|
|
|
126
126
|
data: IMediaRequestBodyData;
|
|
127
127
|
media: string;
|
|
128
128
|
}
|
|
129
|
+
type IdentifierStart = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | Uppercase<'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'> | '_' | '$';
|
|
130
|
+
type HasUnnamedParam<P extends string> = P extends `${string}${':' | '*'}${infer Rest}` ? Rest extends `${IdentifierStart}${string}` ? HasUnnamedParam<Rest> : true : false;
|
|
131
|
+
/**
|
|
132
|
+
* A REST api path, relative to the extension base endpoint, in Express 5 (path-to-regexp 8) syntax:
|
|
133
|
+
* `:name` for a param, `*name` for a wildcard (its param is the array of the path segments) and `{...}` for an optional part.
|
|
134
|
+
* The Express 4 syntax is rejected: regex params (`:id(\\d+)`), `:id?`, unnamed wildcards (`*`) and the reserved `()[]?+!` characters.
|
|
135
|
+
* See https://expressjs.com/en/guide/migrating-5.html#path-syntax
|
|
136
|
+
* At runtime, a path that Express 5 can't parse is logged and not registered.
|
|
137
|
+
*/
|
|
138
|
+
export type ExtensionRoutePath<P extends string> = P extends `${string}${'(' | ')' | '[' | ']' | '?' | '+' | '!'}${string}` ? 'Express 4 path syntax is not supported (no regex params, no ?, +, !, [ or ]); use {...} for optional parts' : HasUnnamedParam<P> extends true ? 'Every : and * needs a parameter name (e.g. *path), see the Express 5 path syntax' : P;
|
|
139
|
+
/**
|
|
140
|
+
* Checks every path of a route literal at compile time, see {@link ExtensionRoutePath}.
|
|
141
|
+
*/
|
|
142
|
+
export type ExtensionRoutePaths<P extends readonly string[]> = {
|
|
143
|
+
readonly [K in keyof P]: ExtensionRoutePath<P[K]>;
|
|
144
|
+
};
|
|
129
145
|
export interface IExtensionRESTRoute {
|
|
130
146
|
/**
|
|
131
147
|
* Looks for req.body.media for the media path and calls the callback with that media entry.
|
|
132
148
|
* Sends a pigallery2 standard JSON object with payload or error message back to the client.
|
|
133
|
-
* @param paths RESTapi
|
|
149
|
+
* @param paths RESTapi paths, relative to the extension base endpoint, see {@link ExtensionRoutePath}
|
|
134
150
|
* @param invalidateDirectory set to false to prevent invalidating the directory.
|
|
135
151
|
* Invalidation is resource-intensive and should be avoided if media or its directory is not changed.
|
|
136
152
|
* @param minRole set to null to omit auer check (ie make the endpoint public)
|
|
137
|
-
* @param cb function callback
|
|
153
|
+
* @param cb function callback. `body` is `{}` if the request has no JSON body.
|
|
138
154
|
* @return newly added REST api path
|
|
139
155
|
*/
|
|
140
|
-
mediaJsonResponse
|
|
156
|
+
mediaJsonResponse<const P extends readonly string[]>(paths: ExtensionRoutePaths<P>, minRole: UserRoles, invalidateDirectory: boolean, cb: (params: ParamsDictionary, body: IMediaRequestBody, user: UserDTO, media: MediaEntity, repository: Repository<MediaEntity>) => unknown): string;
|
|
141
157
|
/**
|
|
142
158
|
* Sends a pigallery2 standard JSON object with payload or error message back to the client.
|
|
143
|
-
* @param paths RESTapi
|
|
159
|
+
* @param paths RESTapi paths, relative to the extension base endpoint, see {@link ExtensionRoutePath}
|
|
144
160
|
* @param minRole set to null to omit auer check (ie make the endpoint public)
|
|
145
|
-
* @param cb function callback
|
|
161
|
+
* @param cb function callback. `body` is `{}` if the request has no JSON body.
|
|
146
162
|
* @return newly added REST api path
|
|
147
163
|
*/
|
|
148
|
-
jsonResponse
|
|
164
|
+
jsonResponse<const P extends readonly string[]>(paths: ExtensionRoutePaths<P>, minRole: UserRoles, cb: (params?: ParamsDictionary, body?: unknown, user?: UserDTO) => unknown): string;
|
|
149
165
|
/**
|
|
150
|
-
* Exposes a standard expressjs middleware
|
|
151
|
-
* @param paths RESTapi
|
|
166
|
+
* Exposes a standard expressjs (Express 5) middleware
|
|
167
|
+
* @param paths RESTapi paths, relative to the extension base endpoint, see {@link ExtensionRoutePath}
|
|
152
168
|
* @param minRole set to null to omit auer check (ie make the endpoint public)
|
|
153
|
-
* @param mw expressjs middleware
|
|
169
|
+
* @param mw expressjs middleware. `req.body` is `undefined` if the request has no JSON body.
|
|
154
170
|
* @return newly added REST api path
|
|
155
171
|
*/
|
|
156
|
-
rawMiddleware
|
|
172
|
+
rawMiddleware<const P extends readonly string[]>(paths: ExtensionRoutePaths<P>, minRole: UserRoles, mw: (req: Request, res: Response, next: NextFunction) => void | Promise<void>): string;
|
|
157
173
|
}
|
|
158
174
|
export interface IExtensionRESTApi {
|
|
159
175
|
use: IExtensionRESTRoute;
|
|
@@ -166,7 +182,7 @@ export interface IExtensionDB {
|
|
|
166
182
|
/**
|
|
167
183
|
* Returns with a typeorm SQL connection
|
|
168
184
|
*/
|
|
169
|
-
getSQLConnection(): Promise<
|
|
185
|
+
getSQLConnection(): Promise<DataSource>;
|
|
170
186
|
/**
|
|
171
187
|
* Adds SQL tables to typeorm
|
|
172
188
|
* @param tables
|
|
@@ -242,7 +258,7 @@ export interface IExtensionObject<C = void> {
|
|
|
242
258
|
*/
|
|
243
259
|
ui: IUIExtension<C>;
|
|
244
260
|
}
|
|
245
|
-
export interface IUIExtension<
|
|
261
|
+
export interface IUIExtension<_C> {
|
|
246
262
|
/**
|
|
247
263
|
* Adds a new button on to UI to all media (photo, video).
|
|
248
264
|
* Implement the server-side click action in the serverSB function.
|
|
@@ -281,3 +297,4 @@ export interface IServerExtensionConfig<C> {
|
|
|
281
297
|
*/
|
|
282
298
|
initConfig(extension: IExtensionConfigInit<C>): void;
|
|
283
299
|
}
|
|
300
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIExtension = void 0;
|
|
4
|
+
const UserDTO_1 = require("../../../common/entities/UserDTO");
|
|
5
|
+
const Logger_1 = require("../../Logger");
|
|
6
|
+
class UIExtension {
|
|
7
|
+
constructor(extensionObject) {
|
|
8
|
+
this.extensionObject = extensionObject;
|
|
9
|
+
this.buttonConfigs = [];
|
|
10
|
+
}
|
|
11
|
+
addMediaButton(buttonConfig, serverSB) {
|
|
12
|
+
this.buttonConfigs.push(buttonConfig);
|
|
13
|
+
// api path isn't set
|
|
14
|
+
if (!buttonConfig.apiPath) {
|
|
15
|
+
if (typeof serverSB === 'function') {
|
|
16
|
+
Logger_1.Logger.warn('[UIExtension]', `Button config ${buttonConfig.name} has no apiPath, but has callback function. This is not supported.`);
|
|
17
|
+
}
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
this.extensionObject.RESTApi.post.mediaJsonResponse([buttonConfig.apiPath], buttonConfig.minUserRole || UserDTO_1.UserRoles.LimitedGuest, !buttonConfig.skipDirectoryInvalidation, serverSB);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.UIExtension = UIExtension;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Stats } from 'fs';
|
|
1
|
+
import { Stats } from 'node:fs';
|
|
2
2
|
import { DirectoryPathDTO, ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO';
|
|
3
3
|
import { FileDTO } from '../../../common/entities/FileDTO';
|
|
4
4
|
export declare class DiskManager {
|
|
@@ -11,6 +11,8 @@ export declare class DiskManager {
|
|
|
11
11
|
name: string;
|
|
12
12
|
}): string;
|
|
13
13
|
static dirName(dirPath: string): string;
|
|
14
|
+
private static globToRegex;
|
|
15
|
+
static excludeFile(filename: string): boolean;
|
|
14
16
|
static excludeDir(dir: {
|
|
15
17
|
name: string;
|
|
16
18
|
parentDirRelativeName: string;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiskManager = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const path = tslib_1.__importStar(require("node:path"));
|
|
7
|
+
const ProjectPath_1 = require("../../ProjectPath");
|
|
8
|
+
const Config_1 = require("../../../common/config/private/Config");
|
|
9
|
+
const Logger_1 = require("../../Logger");
|
|
10
|
+
const VideoProcessing_1 = require("./fileprocessing/VideoProcessing");
|
|
11
|
+
const PhotoProcessing_1 = require("./fileprocessing/PhotoProcessing");
|
|
12
|
+
const Utils_1 = require("../../../common/Utils");
|
|
13
|
+
const GPXProcessing_1 = require("./fileprocessing/GPXProcessing");
|
|
14
|
+
const MetadataLoader_1 = require("./MetadataLoader");
|
|
15
|
+
const NotifocationManager_1 = require("../NotifocationManager");
|
|
16
|
+
const ExtensionDecorator_1 = require("../extension/ExtensionDecorator");
|
|
17
|
+
const SessionManager_1 = require("../database/SessionManager");
|
|
18
|
+
const LOG_TAG = '[DiskManager]';
|
|
19
|
+
/**
|
|
20
|
+
* Placeholder for the fields of a scanned DTO that are set later: the ids and parents when the directory is saved,
|
|
21
|
+
* the directory of the files by DirectoryDTOUtils.addReferences. Also the metadata of media scanned with noMetadata.
|
|
22
|
+
*/
|
|
23
|
+
const UNSET = null;
|
|
24
|
+
class DiskManager {
|
|
25
|
+
static calcLastModified(stat) {
|
|
26
|
+
return Math.max(stat.ctime.getTime(), stat.mtime.getTime());
|
|
27
|
+
}
|
|
28
|
+
static getDTOFromPath(relativeDirectoryName) {
|
|
29
|
+
return {
|
|
30
|
+
path: this.pathFromRelativeDirName(relativeDirectoryName),
|
|
31
|
+
name: DiskManager.dirName(relativeDirectoryName)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static normalizeDirPath(dirPath) {
|
|
35
|
+
return path.normalize(path.join('.' + path.sep, dirPath));
|
|
36
|
+
}
|
|
37
|
+
static pathFromRelativeDirName(relativeDirectoryName) {
|
|
38
|
+
return path.join(path.dirname(this.normalizeDirPath(relativeDirectoryName)), path.sep);
|
|
39
|
+
}
|
|
40
|
+
static pathFromParent(parent) {
|
|
41
|
+
return path.join(this.normalizeDirPath(path.join(parent.path, parent.name)), path.sep);
|
|
42
|
+
}
|
|
43
|
+
static dirName(dirPath) {
|
|
44
|
+
if (dirPath.trim().length === 0) {
|
|
45
|
+
return '.';
|
|
46
|
+
}
|
|
47
|
+
return path.basename(dirPath);
|
|
48
|
+
}
|
|
49
|
+
static globToRegex(glob) {
|
|
50
|
+
const regexStr = '^' + glob
|
|
51
|
+
.replace(/[.+^${}()|[\]\\]/g, '\\$&') // escape regex special chars (except * and ?)
|
|
52
|
+
.replace(/\*/g, '.*') // * matches any number of any chars
|
|
53
|
+
.replace(/\?/g, '.') + // ? matches exactly one char
|
|
54
|
+
'$';
|
|
55
|
+
return new RegExp(regexStr);
|
|
56
|
+
}
|
|
57
|
+
static excludeFile(filename) {
|
|
58
|
+
if (Config_1.Config.Indexing.excludeFilenameList.length === 0) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
for (const glob of Config_1.Config.Indexing.excludeFilenameList) {
|
|
62
|
+
if (DiskManager.globToRegex(glob).test(filename)) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
static async excludeDir(dir) {
|
|
69
|
+
if (Config_1.Config.Indexing.excludeFolderList.length === 0 &&
|
|
70
|
+
Config_1.Config.Indexing.excludeFileList.length === 0) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
const absoluteName = path.normalize(path.join(dir.parentDirAbsoluteName, dir.name));
|
|
74
|
+
const relativeName = path.normalize(path.join(dir.parentDirRelativeName, dir.name));
|
|
75
|
+
for (const exclude of Config_1.Config.Indexing.excludeFolderList) {
|
|
76
|
+
if (exclude.startsWith('/')) {
|
|
77
|
+
if (exclude === absoluteName) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else if (exclude.includes('/')) {
|
|
82
|
+
if (path.normalize(exclude) === relativeName) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
if (DiskManager.globToRegex(exclude).test(dir.name)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// exclude dirs that have the given files (like .ignore)
|
|
93
|
+
for (const exclude of Config_1.Config.Indexing.excludeFileList) {
|
|
94
|
+
try {
|
|
95
|
+
await node_fs_1.promises.access(path.join(absoluteName, exclude));
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// ignoring errors
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
static async scanDirectoryNoMetadata(relativeDirectoryName, settings = {}) {
|
|
105
|
+
settings.noMetadata = true;
|
|
106
|
+
return (await this.scanDirectory(relativeDirectoryName, settings));
|
|
107
|
+
}
|
|
108
|
+
static async scanDirectory(relativeDirectoryName, settings = {}) {
|
|
109
|
+
Logger_1.Logger.silly(LOG_TAG, 'scanning directory:', relativeDirectoryName);
|
|
110
|
+
relativeDirectoryName = this.normalizeDirPath(relativeDirectoryName);
|
|
111
|
+
if (!ProjectPath_1.ProjectPath.isInsideImageFolder(relativeDirectoryName)) {
|
|
112
|
+
throw new Error('Directory is outside of the image folder: ' + relativeDirectoryName);
|
|
113
|
+
}
|
|
114
|
+
const dto = this.getDTOFromPath(relativeDirectoryName);
|
|
115
|
+
const absoluteDirectoryName = path.join(ProjectPath_1.ProjectPath.ImageFolder, relativeDirectoryName);
|
|
116
|
+
const stat = await node_fs_1.promises.stat(path.join(ProjectPath_1.ProjectPath.ImageFolder, relativeDirectoryName));
|
|
117
|
+
const cache = {
|
|
118
|
+
projectionKey: SessionManager_1.SessionManager.NO_PROJECTION_KEY,
|
|
119
|
+
mediaCount: 0,
|
|
120
|
+
cover: null,
|
|
121
|
+
valid: false
|
|
122
|
+
};
|
|
123
|
+
const directory = {
|
|
124
|
+
id: UNSET,
|
|
125
|
+
parent: UNSET,
|
|
126
|
+
name: dto.name,
|
|
127
|
+
path: dto.path,
|
|
128
|
+
lastModified: this.calcLastModified(stat),
|
|
129
|
+
directories: [],
|
|
130
|
+
isPartial: settings.coverOnly === true,
|
|
131
|
+
media: [],
|
|
132
|
+
metaFile: [],
|
|
133
|
+
cache
|
|
134
|
+
};
|
|
135
|
+
if (!settings.coverOnly) {
|
|
136
|
+
directory.lastScanned = Date.now();
|
|
137
|
+
}
|
|
138
|
+
// nothing to scan, we are here for the empty dir
|
|
139
|
+
if (settings.noPhoto === true &&
|
|
140
|
+
settings.noMetaFile === true &&
|
|
141
|
+
settings.noVideo === true) {
|
|
142
|
+
return directory;
|
|
143
|
+
}
|
|
144
|
+
const list = await node_fs_1.promises.readdir(absoluteDirectoryName);
|
|
145
|
+
let count = 0;
|
|
146
|
+
for (const file of list) {
|
|
147
|
+
count++;
|
|
148
|
+
if (count % 1000 === 0) {
|
|
149
|
+
if (global.gc) {
|
|
150
|
+
Logger_1.Logger.silly(LOG_TAG, 'Triggering gc after scanning ', count, ' files in dir: ', relativeDirectoryName);
|
|
151
|
+
global.gc();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const fullFilePath = path.normalize(path.join(absoluteDirectoryName, file));
|
|
155
|
+
if ((await node_fs_1.promises.stat(fullFilePath)).isDirectory()) {
|
|
156
|
+
try {
|
|
157
|
+
if (settings.noDirectory === true ||
|
|
158
|
+
settings.coverOnly === true ||
|
|
159
|
+
(await DiskManager.excludeDir({
|
|
160
|
+
name: file,
|
|
161
|
+
parentDirRelativeName: relativeDirectoryName,
|
|
162
|
+
parentDirAbsoluteName: absoluteDirectoryName
|
|
163
|
+
}))) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
// create cover directory
|
|
167
|
+
const d = (await DiskManager.scanDirectory(path.join(relativeDirectoryName, file), {
|
|
168
|
+
coverOnly: true,
|
|
169
|
+
}));
|
|
170
|
+
directory.directories.push(d);
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
NotifocationManager_1.NotificationManager.warning('Unknown directory reading error, skipping: ' + path.join(relativeDirectoryName, file), String(err));
|
|
174
|
+
console.error(err);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (DiskManager.excludeFile(file)) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
else if (PhotoProcessing_1.PhotoProcessing.isPhoto(fullFilePath)) {
|
|
181
|
+
try {
|
|
182
|
+
if (settings.noPhoto === true) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
// the id is set when the photo is saved to the DB
|
|
186
|
+
const scannedPhoto = {
|
|
187
|
+
name: file,
|
|
188
|
+
directory: UNSET,
|
|
189
|
+
metadata: settings.noMetadata === true
|
|
190
|
+
? UNSET
|
|
191
|
+
: await MetadataLoader_1.MetadataLoader.loadPhotoMetadata(fullFilePath),
|
|
192
|
+
};
|
|
193
|
+
const photo = scannedPhoto;
|
|
194
|
+
if (!cache.cover) {
|
|
195
|
+
cache.cover = {
|
|
196
|
+
...Utils_1.Utils.clone(photo),
|
|
197
|
+
directory: {
|
|
198
|
+
path: directory.path,
|
|
199
|
+
name: directory.name,
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
// add the cover photo to the list of media, so it will be saved to the DB
|
|
204
|
+
// and can be queried to populate covers,
|
|
205
|
+
// otherwise we do not return media list that is only partial
|
|
206
|
+
directory.media.push(photo);
|
|
207
|
+
if (settings.coverOnly === true) {
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
catch (err) {
|
|
212
|
+
NotifocationManager_1.NotificationManager.warning('Media loading error, skipping: ' +
|
|
213
|
+
fullFilePath +
|
|
214
|
+
', reason: ' +
|
|
215
|
+
String(err));
|
|
216
|
+
console.error(err);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
else if (VideoProcessing_1.VideoProcessing.isVideo(fullFilePath)) {
|
|
220
|
+
try {
|
|
221
|
+
if (Config_1.Config.Media.Video.enabled === false ||
|
|
222
|
+
settings.noVideo === true ||
|
|
223
|
+
settings.coverOnly === true) {
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const video = {
|
|
227
|
+
name: file,
|
|
228
|
+
directory: UNSET,
|
|
229
|
+
metadata: settings.noMetadata === true
|
|
230
|
+
? UNSET
|
|
231
|
+
: await MetadataLoader_1.MetadataLoader.loadVideoMetadata(fullFilePath),
|
|
232
|
+
};
|
|
233
|
+
directory.media.push(video);
|
|
234
|
+
}
|
|
235
|
+
catch (e) {
|
|
236
|
+
Logger_1.Logger.warn('Media loading error, skipping: ' +
|
|
237
|
+
fullFilePath +
|
|
238
|
+
', reason: ' +
|
|
239
|
+
String(e));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
else if (GPXProcessing_1.GPXProcessing.isMetaFile(fullFilePath)) {
|
|
243
|
+
try {
|
|
244
|
+
if (!DiskManager.isEnabledMetaFile(fullFilePath) ||
|
|
245
|
+
settings.noMetaFile === true ||
|
|
246
|
+
settings.coverOnly === true) {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
const metaFile = {
|
|
250
|
+
name: file,
|
|
251
|
+
directory: UNSET,
|
|
252
|
+
};
|
|
253
|
+
directory.metaFile.push(metaFile);
|
|
254
|
+
}
|
|
255
|
+
catch (e) {
|
|
256
|
+
Logger_1.Logger.warn('Metafile loading error, skipping: ' +
|
|
257
|
+
fullFilePath +
|
|
258
|
+
', reason: ' +
|
|
259
|
+
String(e));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
cache.mediaCount = directory.media.length;
|
|
264
|
+
// TODO: cache is now calculated purely though DB after indexing of the directory is done.
|
|
265
|
+
// Delete is with caution (double check if it still indeed not used)
|
|
266
|
+
if (!directory.isPartial && !settings.noMetadata) {
|
|
267
|
+
let youngestMedia = Number.MAX_SAFE_INTEGER;
|
|
268
|
+
let oldestMedia = Number.MIN_SAFE_INTEGER;
|
|
269
|
+
directory.media.forEach((m) => {
|
|
270
|
+
const time = Utils_1.Utils.getTimeMS(m.metadata.creationDate, m.metadata.creationDateOffset, Config_1.Config.Gallery.ignoreTimestampOffset);
|
|
271
|
+
youngestMedia = Math.min(time, youngestMedia);
|
|
272
|
+
oldestMedia = Math.max(time, oldestMedia);
|
|
273
|
+
});
|
|
274
|
+
cache.youngestMedia = youngestMedia;
|
|
275
|
+
cache.oldestMedia = oldestMedia;
|
|
276
|
+
directory.metaFile.forEach(mf => {
|
|
277
|
+
if (DiskManager.isMarkdown(mf.name)) {
|
|
278
|
+
mf.date = youngestMedia;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
return directory;
|
|
283
|
+
}
|
|
284
|
+
static isEnabledMetaFile(fullPath) {
|
|
285
|
+
const extension = path.extname(fullPath).toLowerCase();
|
|
286
|
+
switch (extension) {
|
|
287
|
+
case '.gpx':
|
|
288
|
+
return Config_1.Config.MetaFile.gpx;
|
|
289
|
+
case '.md':
|
|
290
|
+
return Config_1.Config.MetaFile.markdown;
|
|
291
|
+
case '.pg2conf':
|
|
292
|
+
return Config_1.Config.MetaFile.pg2conf;
|
|
293
|
+
}
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
static isMarkdown(fullPath) {
|
|
297
|
+
const extension = path.extname(fullPath).toLowerCase();
|
|
298
|
+
return extension == '.md';
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
exports.DiskManager = DiskManager;
|
|
302
|
+
tslib_1.__decorate([
|
|
303
|
+
(0, ExtensionDecorator_1.ExtensionDecorator)(e => e.gallery.DiskManager.excludeDir),
|
|
304
|
+
tslib_1.__metadata("design:type", Function),
|
|
305
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
306
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
307
|
+
], DiskManager, "excludeDir", null);
|
|
308
|
+
tslib_1.__decorate([
|
|
309
|
+
(0, ExtensionDecorator_1.ExtensionDecorator)(e => e.gallery.DiskManager.scanDirectory),
|
|
310
|
+
tslib_1.__metadata("design:type", Function),
|
|
311
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
312
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
313
|
+
], DiskManager, "scanDirectory", null);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateTags = void 0;
|
|
4
|
+
//Interesting exiftool forums posts about some of these tags:
|
|
5
|
+
//https://exiftool.org/forum/index.php?topic=13170.msg71174#msg71174 - about the meaning of exif.DateTimeOriginal, exif.CreateDate/exif.DateTimeDigitized and exif.ModifyDate
|
|
6
|
+
//https://exiftool.org/forum/index.php?topic=15555.msg83536#msg83536
|
|
7
|
+
//This is the PRIORITIZED LIST of tags which Pigallery2 uses to determine the date of creation of pictures.
|
|
8
|
+
//The list is used for embedded picture metadata and xmp-sidecar files for both pictures and vidoes.
|
|
9
|
+
exports.DateTags = [
|
|
10
|
+
// Date tag Offset or time tag Type //Description
|
|
11
|
+
["exif.DateTimeOriginal", "exif.OffsetTimeOriginal", 'O'], //Date and time when the original image was taken - shutter close time
|
|
12
|
+
["exif.CreateDate", "exif.OffsetTimeDigitized", 'O'], //Date and time when the image was created
|
|
13
|
+
["exif.DateTimeDigitized", "exif.OffsetTimeDigitized", 'O'], //Same as exif.CreateDate but older and newer spec name
|
|
14
|
+
["ifd0.ModifyDate", undefined, undefined], //The date and time of image creation. In Exif standard, it is the date and time the file was changed.
|
|
15
|
+
["ihdr.Creation Time", undefined, undefined], //Time of original image creation for PNG files
|
|
16
|
+
["photoshop.DateCreated", undefined, undefined], //The date the intellectual content of the document was created. Used and set by LightRoom among others
|
|
17
|
+
["xmp.CreateDate", undefined, undefined], //Date and time when the image was created (XMP standard)
|
|
18
|
+
["iptc.DateCreated", "iptc.TimeCreated", 'T'], //Designates the date and optionally the time the content of the image was created rather than the date of the creation of the digital representation
|
|
19
|
+
["quicktime.CreationDate", undefined, undefined], //Date and time when the QuickTime movie was created"],
|
|
20
|
+
["quicktime.CreateDate", undefined, undefined], //Date and time when the QuickTime movie was created in UTC"],
|
|
21
|
+
["heic.ContentCreateDate", undefined, undefined], //Date and time when the HEIC image content was created"],
|
|
22
|
+
["heic.CreationDate", undefined, undefined], //Date and time when the HEIC image was created"],
|
|
23
|
+
["tiff.DateTime", undefined, undefined], //Date and time of image creation.
|
|
24
|
+
["exif.ModifyDate", "exif.OffsetTime", 'O'], //Modification date
|
|
25
|
+
["xmp.ModifyDate", undefined, undefined], //Date and time when the image was last modified (XMP standard)"]
|
|
26
|
+
["xmp.MetadataDate", undefined, undefined], //The date and time that any metadata for this resource was last changed. It should be the same as or more recent than xmp:ModifyDate.
|
|
27
|
+
];
|
|
@@ -2,6 +2,10 @@ import { PhotoMetadata } from '../../../common/entities/PhotoDTO';
|
|
|
2
2
|
import { VideoMetadata } from '../../../common/entities/VideoDTO';
|
|
3
3
|
export declare class MetadataLoader {
|
|
4
4
|
private static readonly EMPTY_METADATA;
|
|
5
|
+
/**
|
|
6
|
+
* True if exifr returned nothing but errors (with mergeOutput: false it reports them in an 'errors' section).
|
|
7
|
+
*/
|
|
8
|
+
private static isOnlyErrors;
|
|
5
9
|
static loadVideoMetadata(fullPath: string): Promise<VideoMetadata>;
|
|
6
10
|
static loadPhotoMetadata(fullPath: string): Promise<PhotoMetadata>;
|
|
7
11
|
private static mapMetadata;
|
|
@@ -17,4 +21,17 @@ export declare class MetadataLoader {
|
|
|
17
21
|
private static mapRating;
|
|
18
22
|
private static mapFaces;
|
|
19
23
|
private static mapExifReader;
|
|
24
|
+
/**
|
|
25
|
+
* Parse Apple MakerNote IFD to extract ContentIdentifier (tag 0x0011).
|
|
26
|
+
*
|
|
27
|
+
* Apple MakerNote format:
|
|
28
|
+
* - Header: "Apple iOS\0" (10 bytes) + 2-byte version
|
|
29
|
+
* - Byte order marker: "MM" (big-endian) or "II" (little-endian)
|
|
30
|
+
* - Standard TIFF IFD: 2-byte entry count, then 12-byte entries
|
|
31
|
+
* - Each IFD entry: tag(2) + type(2) + count(4) + value/offset(4)
|
|
32
|
+
*
|
|
33
|
+
* Tag reference: ExifTool Apple.pm by Phil Harvey
|
|
34
|
+
* (https://github.com/exiftool/exiftool)
|
|
35
|
+
*/
|
|
36
|
+
static parseAppleMakerNoteContentId(makerNote: unknown): string | undefined;
|
|
20
37
|
}
|