remove phantom file + update rspc bindings

A PR must have been merged incorrect introducing this file which is not used.
This commit is contained in:
Oscar Beaumont 2022-08-30 10:50:08 +08:00
parent c7441d1d64
commit fdfb2f00d5
3 changed files with 148 additions and 241 deletions

View file

@ -2,116 +2,116 @@
export type Operations = {
queries:
{ key: ["files.readMetadata", LibraryArgs<number>], result: null } |
{ key: ["jobs.getHistory", LibraryArgs<null>], result: Array<JobReport> } |
{ key: ["library.getStatistics", LibraryArgs<null>], result: Statistics } |
{ key: ["jobs.getRunning", LibraryArgs<null>], result: Array<JobReport> } |
{ key: ["library.get"], result: Array<LibraryConfigWrapped> } |
{ key: ["locations.getExplorerDir", LibraryArgs<GetExplorerDirArgs>], result: DirectoryWithContents } |
{ key: ["locations.getById", LibraryArgs<number>], result: Location | null } |
{ key: ["getNode"], result: NodeState } |
{ key: ["version"], result: string } |
{ key: ["files.readMetadata", LibraryArgs<number>], result: null } |
{ key: ["locations.getExplorerDir", LibraryArgs<GetExplorerDirArgs>], result: DirectoryWithContents } |
{ key: ["jobs.getHistory", LibraryArgs<null>], result: Array<JobReport> } |
{ key: ["library.get"], result: Array<LibraryConfigWrapped> } |
{ key: ["volumes.get"], result: Array<Volume> } |
{ key: ["tags.getFilesForTag", LibraryArgs<number>], result: Tag | null } |
{ key: ["locations.get", LibraryArgs<null>], result: Array<Location> } |
{ key: ["locations.getById", LibraryArgs<number>], result: Location | null } |
{ key: ["tags.get", LibraryArgs<null>], result: Array<Tag> } |
{ key: ["library.getStatistics", LibraryArgs<null>], result: Statistics } |
{ key: ["locations.get", LibraryArgs<null>], result: Array<Location> },
{ key: ["getNode"], result: NodeState },
mutations:
{ key: ["tags.create", LibraryArgs<TagCreateArgs>], result: Tag } |
{ key: ["files.setFavorite", LibraryArgs<SetFavoriteArgs>], result: null } |
{ key: ["jobs.identifyUniqueFiles", LibraryArgs<IdentifyUniqueFilesArgs>], result: null } |
{ key: ["files.delete", LibraryArgs<number>], result: null } |
{ key: ["library.edit", EditLibraryArgs], result: null } |
{ key: ["library.delete", string], result: null } |
{ key: ["jobs.generateThumbsForLocation", LibraryArgs<GenerateThumbsForLocationArgs>], result: null } |
{ key: ["files.setNote", LibraryArgs<SetNoteArgs>], result: null } |
{ key: ["library.create", string], result: null } |
{ key: ["library.delete", string], result: null } |
{ key: ["files.setFavorite", LibraryArgs<SetFavoriteArgs>], result: null } |
{ key: ["locations.update", LibraryArgs<LocationUpdateArgs>], result: null } |
{ key: ["locations.quickRescan", LibraryArgs<null>], result: null } |
{ key: ["locations.delete", LibraryArgs<number>], result: null } |
{ key: ["tags.update", LibraryArgs<TagUpdateArgs>], result: null } |
{ key: ["tags.assign", LibraryArgs<TagAssignArgs>], result: null } |
{ key: ["tags.delete", LibraryArgs<number>], result: null } |
{ key: ["library.edit", EditLibraryArgs], result: null } |
{ key: ["jobs.identifyUniqueFiles", LibraryArgs<IdentifyUniqueFilesArgs>], result: null } |
{ key: ["locations.create", LibraryArgs<string>], result: Location } |
{ key: ["locations.quickRescan", LibraryArgs<null>], result: null } |
{ key: ["files.delete", LibraryArgs<number>], result: null } |
{ key: ["locations.delete", LibraryArgs<number>], result: null } |
{ key: ["locations.update", LibraryArgs<LocationUpdateArgs>], result: null } |
{ key: ["locations.fullRescan", LibraryArgs<number>], result: null } |
{ key: ["tags.create", LibraryArgs<TagCreateArgs>], result: Tag },
{ key: ["tags.delete", LibraryArgs<number>], result: null },
subscriptions:
{ key: ["jobs.newThumbnail", LibraryArgs<null>], result: string } |
{ key: ["invalidateQuery"], result: InvalidateOperationEvent }
};
export interface GenerateThumbsForLocationArgs { id: number, path: string }
export interface SyncEvent { id: number, node_id: number, timestamp: string, record_id: Array<number>, kind: number, column: string | null, value: string, node: Node | null }
export interface TagCreateArgs { name: string, color: string }
export interface Location { id: number, pub_id: Array<number>, node_id: number | null, name: string | null, local_path: string | null, total_capacity: number | null, available_capacity: number | null, filesystem: string | null, disk_type: number | null, is_removable: boolean | null, is_online: boolean, date_created: string, node: Node | null | null, file_paths: Array<FilePath> | null }
export interface TagAssignArgs { file_id: number, tag_id: number }
export interface Key { id: number, checksum: string, name: string | null, date_created: string | null, algorithm: number | null, files: Array<File> | null, file_paths: Array<FilePath> | null }
export interface DirectoryWithContents { directory: FilePath, contents: Array<FilePath> }
export interface ConfigMetadata { version: string | null }
export interface TagUpdateArgs { id: number, name: string | null, color: string | null }
export interface LibraryConfig { version: string | null, name: string, description: string }
export interface IdentifyUniqueFilesArgs { id: number, path: string }
export interface FilePath { id: number, is_dir: boolean, location_id: number | null, materialized_path: string, name: string, extension: string | null, file_id: number | null, parent_id: number | null, key_id: number | null, date_created: string, date_modified: string, date_indexed: string, file: File | null | null, location: Location | null | null, key: Key | null | null }
export interface Album { id: number, pub_id: Array<number>, name: string, is_hidden: boolean, date_created: string, date_modified: string, files: Array<FileInAlbum> | null }
export interface SetFavoriteArgs { id: number, favorite: boolean }
export interface LocationUpdateArgs { id: number, name: string | null }
export interface Job { id: Array<number>, name: string, node_id: number, action: number, status: number, data: Array<number> | null, task_count: number, completed_task_count: number, date_created: string, date_modified: string, seconds_elapsed: number, nodes: Node | null }
export interface Statistics { id: number, date_captured: string, total_file_count: number, library_db_size: string, total_bytes_used: string, total_bytes_capacity: string, total_unique_bytes: string, total_bytes_free: string, preview_media_bytes: string }
export interface MediaData { id: number, pixel_width: number | null, pixel_height: number | null, longitude: number | null, latitude: number | null, fps: number | null, capture_device_make: string | null, capture_device_model: string | null, capture_device_software: string | null, duration_seconds: number | null, codecs: string | null, streams: number | null, files: File | null | null }
export interface NodeConfig { version: string | null, id: string, name: string, p2p_port: number | null }
export interface TagCreateArgs { name: string, color: string }
export interface FileInAlbum { date_created: string, album_id: number, album: Album | null, file_id: number, file: File | null }
export interface Label { id: number, pub_id: Array<number>, name: string | null, date_created: string, date_modified: string, label_files: Array<LabelOnFile> | null }
export interface LabelOnFile { date_created: string, label_id: number, label: Label | null, file_id: number, file: File | null }
export interface File { id: number, cas_id: string, integrity_checksum: string | null, kind: number, size_in_bytes: string, key_id: number | null, hidden: boolean, favorite: boolean, important: boolean, has_thumbnail: boolean, has_thumbstrip: boolean, has_video_preview: boolean, ipfs_id: string | null, note: string | null, date_created: string, date_modified: string, date_indexed: string, tags: Array<TagOnFile> | null, labels: Array<LabelOnFile> | null, albums: Array<FileInAlbum> | null, spaces: Array<FileInSpace> | null, paths: Array<FilePath> | null, comments: Array<Comment> | null, media_data: MediaData | null | null, key: Key | null | null }
export interface EditLibraryArgs { id: string, name: string | null, description: string | null }
export interface LibraryArgs<T> { library_id: string, arg: T }
export interface NodeConfig { version: string | null, id: string, name: string, p2p_port: number | null }
export interface MediaData { id: number, pixel_width: number | null, pixel_height: number | null, longitude: number | null, latitude: number | null, fps: number | null, capture_device_make: string | null, capture_device_model: string | null, capture_device_software: string | null, duration_seconds: number | null, codecs: string | null, streams: number | null, files: File | null | null }
export interface Space { id: number, pub_id: Array<number>, name: string | null, description: string | null, date_created: string, date_modified: string, files: Array<FileInSpace> | null }
export interface Comment { id: number, pub_id: Array<number>, content: string, date_created: string, date_modified: string, file_id: number | null, file: File | null | null }
export interface Album { id: number, pub_id: Array<number>, name: string, is_hidden: boolean, date_created: string, date_modified: string, files: Array<FileInAlbum> | null }
export interface GetExplorerDirArgs { location_id: number, path: string, limit: number }
export type JobStatus = "Queued" | "Running" | "Completed" | "Canceled" | "Failed" | "Paused"
export interface LabelOnFile { date_created: string, label_id: number, label: Label | null, file_id: number, file: File | null }
export interface JobReport { id: string, name: string, data: Array<number> | null, date_created: string, date_modified: string, status: JobStatus, task_count: number, completed_task_count: number, message: string, seconds_elapsed: number }
export interface Tag { id: number, pub_id: Array<number>, name: string | null, color: string | null, total_files: number | null, redundancy_goal: number | null, date_created: string, date_modified: string, tag_files: Array<TagOnFile> | null }
export interface FilePath { id: number, is_dir: boolean, location_id: number | null, materialized_path: string, name: string, extension: string | null, file_id: number | null, parent_id: number | null, key_id: number | null, date_created: string, date_modified: string, date_indexed: string, file: File | null | null, location: Location | null | null, key: Key | null | null }
export interface LibraryConfigWrapped { uuid: string, config: LibraryConfig }
export interface LocationUpdateArgs { id: number, name: string | null }
export interface FileInSpace { date_created: string, space_id: number, space: Space | null, file_id: number, file: File | null }
export interface InvalidateOperationEvent { key: string, arg: any }
export interface TagOnFile { date_created: string, tag_id: number, tag: Tag | null, file_id: number, file: File | null }
export interface NodeState { version: string | null, id: string, name: string, p2p_port: number | null, data_path: string }
export interface LibraryArgs<T> { library_id: string, arg: T }
export type JobStatus = "Queued" | "Running" | "Completed" | "Canceled" | "Failed" | "Paused"
export interface Node { id: number, pub_id: Array<number>, name: string, platform: number, version: string | null, last_seen: string, timezone: string | null, date_created: string, sync_events: Array<SyncEvent> | null, jobs: Array<Job> | null, Location: Array<Location> | null }
export interface File { id: number, cas_id: string, integrity_checksum: string | null, kind: number, size_in_bytes: string, key_id: number | null, hidden: boolean, favorite: boolean, important: boolean, has_thumbnail: boolean, has_thumbstrip: boolean, has_video_preview: boolean, ipfs_id: string | null, note: string | null, date_created: string, date_modified: string, date_indexed: string, tags: Array<TagOnFile> | null, labels: Array<LabelOnFile> | null, albums: Array<FileInAlbum> | null, spaces: Array<FileInSpace> | null, paths: Array<FilePath> | null, comments: Array<Comment> | null, media_data: MediaData | null | null, key: Key | null | null }
export interface Key { id: number, checksum: string, name: string | null, date_created: string | null, algorithm: number | null, files: Array<File> | null, file_paths: Array<FilePath> | null }
export interface SyncEvent { id: number, node_id: number, timestamp: string, record_id: Array<number>, kind: number, column: string | null, value: string, node: Node | null }
export interface SetFavoriteArgs { id: number, favorite: boolean }
export interface InvalidateOperationEvent { key: string, arg: any }
export interface NodeState { version: string | null, id: string, name: string, p2p_port: number | null, data_path: string }
export interface ConfigMetadata { version: string | null }
export interface Volume { name: string, mount_point: string, total_capacity: bigint, available_capacity: bigint, is_removable: boolean, disk_type: string | null, file_system: string | null, is_root_filesystem: boolean }
export interface FileInAlbum { date_created: string, album_id: number, album: Album | null, file_id: number, file: File | null }
export interface Comment { id: number, pub_id: Array<number>, content: string, date_created: string, date_modified: string, file_id: number | null, file: File | null | null }
export interface LibraryConfig { version: string | null, name: string, description: string }
export interface TagUpdateArgs { id: number, name: string | null, color: string | null }
export interface TagAssignArgs { file_id: number, tag_id: number }
export interface Statistics { id: number, date_captured: string, total_file_count: number, library_db_size: string, total_bytes_used: string, total_bytes_capacity: string, total_unique_bytes: string, total_bytes_free: string, preview_media_bytes: string }
export interface GenerateThumbsForLocationArgs { id: number, path: string }
export interface SetNoteArgs { id: number, note: string | null }
export interface Job { id: Array<number>, name: string, node_id: number, action: number, status: number, data: Array<number> | null, task_count: number, completed_task_count: number, date_created: string, date_modified: string, seconds_elapsed: number, nodes: Node | null }
export interface GetExplorerDirArgs { location_id: number, path: string, limit: number }
export interface Label { id: number, pub_id: Array<number>, name: string | null, date_created: string, date_modified: string, label_files: Array<LabelOnFile> | null }
export interface LibraryConfigWrapped { uuid: string, config: LibraryConfig }
export interface TagOnFile { date_created: string, tag_id: number, tag: Tag | null, file_id: number, file: File | null }
export interface Tag { id: number, pub_id: Array<number>, name: string | null, color: string | null, total_files: number | null, redundancy_goal: number | null, date_created: string, date_modified: string, tag_files: Array<TagOnFile> | null }
export interface IdentifyUniqueFilesArgs { id: number, path: string }
export interface DirectoryWithContents { directory: FilePath, contents: Array<FilePath> }
export interface FileInSpace { date_created: string, space_id: number, space: Space | null, file_id: number, file: File | null }

View file

@ -2,116 +2,116 @@
export type Operations = {
queries:
{ key: ["files.readMetadata", LibraryArgs<number>], result: null } |
{ key: ["jobs.getHistory", LibraryArgs<null>], result: Array<JobReport> } |
{ key: ["library.getStatistics", LibraryArgs<null>], result: Statistics } |
{ key: ["jobs.getRunning", LibraryArgs<null>], result: Array<JobReport> } |
{ key: ["library.get"], result: Array<LibraryConfigWrapped> } |
{ key: ["locations.getExplorerDir", LibraryArgs<GetExplorerDirArgs>], result: DirectoryWithContents } |
{ key: ["locations.getById", LibraryArgs<number>], result: Location | null } |
{ key: ["getNode"], result: NodeState } |
{ key: ["version"], result: string } |
{ key: ["files.readMetadata", LibraryArgs<number>], result: null } |
{ key: ["locations.getExplorerDir", LibraryArgs<GetExplorerDirArgs>], result: DirectoryWithContents } |
{ key: ["jobs.getHistory", LibraryArgs<null>], result: Array<JobReport> } |
{ key: ["library.get"], result: Array<LibraryConfigWrapped> } |
{ key: ["volumes.get"], result: Array<Volume> } |
{ key: ["tags.getFilesForTag", LibraryArgs<number>], result: Tag | null } |
{ key: ["locations.get", LibraryArgs<null>], result: Array<Location> } |
{ key: ["locations.getById", LibraryArgs<number>], result: Location | null } |
{ key: ["tags.get", LibraryArgs<null>], result: Array<Tag> } |
{ key: ["library.getStatistics", LibraryArgs<null>], result: Statistics } |
{ key: ["locations.get", LibraryArgs<null>], result: Array<Location> },
{ key: ["getNode"], result: NodeState },
mutations:
{ key: ["tags.create", LibraryArgs<TagCreateArgs>], result: Tag } |
{ key: ["files.setFavorite", LibraryArgs<SetFavoriteArgs>], result: null } |
{ key: ["jobs.identifyUniqueFiles", LibraryArgs<IdentifyUniqueFilesArgs>], result: null } |
{ key: ["files.delete", LibraryArgs<number>], result: null } |
{ key: ["library.edit", EditLibraryArgs], result: null } |
{ key: ["library.delete", string], result: null } |
{ key: ["jobs.generateThumbsForLocation", LibraryArgs<GenerateThumbsForLocationArgs>], result: null } |
{ key: ["files.setNote", LibraryArgs<SetNoteArgs>], result: null } |
{ key: ["library.create", string], result: null } |
{ key: ["library.delete", string], result: null } |
{ key: ["files.setFavorite", LibraryArgs<SetFavoriteArgs>], result: null } |
{ key: ["locations.update", LibraryArgs<LocationUpdateArgs>], result: null } |
{ key: ["locations.quickRescan", LibraryArgs<null>], result: null } |
{ key: ["locations.delete", LibraryArgs<number>], result: null } |
{ key: ["tags.update", LibraryArgs<TagUpdateArgs>], result: null } |
{ key: ["tags.assign", LibraryArgs<TagAssignArgs>], result: null } |
{ key: ["tags.delete", LibraryArgs<number>], result: null } |
{ key: ["library.edit", EditLibraryArgs], result: null } |
{ key: ["jobs.identifyUniqueFiles", LibraryArgs<IdentifyUniqueFilesArgs>], result: null } |
{ key: ["locations.create", LibraryArgs<string>], result: Location } |
{ key: ["locations.quickRescan", LibraryArgs<null>], result: null } |
{ key: ["files.delete", LibraryArgs<number>], result: null } |
{ key: ["locations.delete", LibraryArgs<number>], result: null } |
{ key: ["locations.update", LibraryArgs<LocationUpdateArgs>], result: null } |
{ key: ["locations.fullRescan", LibraryArgs<number>], result: null } |
{ key: ["tags.create", LibraryArgs<TagCreateArgs>], result: Tag },
{ key: ["tags.delete", LibraryArgs<number>], result: null },
subscriptions:
{ key: ["jobs.newThumbnail", LibraryArgs<null>], result: string } |
{ key: ["invalidateQuery"], result: InvalidateOperationEvent }
};
export interface GenerateThumbsForLocationArgs { id: number, path: string }
export interface SyncEvent { id: number, node_id: number, timestamp: string, record_id: Array<number>, kind: number, column: string | null, value: string, node: Node | null }
export interface TagCreateArgs { name: string, color: string }
export interface Location { id: number, pub_id: Array<number>, node_id: number | null, name: string | null, local_path: string | null, total_capacity: number | null, available_capacity: number | null, filesystem: string | null, disk_type: number | null, is_removable: boolean | null, is_online: boolean, date_created: string, node: Node | null | null, file_paths: Array<FilePath> | null }
export interface TagAssignArgs { file_id: number, tag_id: number }
export interface Key { id: number, checksum: string, name: string | null, date_created: string | null, algorithm: number | null, files: Array<File> | null, file_paths: Array<FilePath> | null }
export interface DirectoryWithContents { directory: FilePath, contents: Array<FilePath> }
export interface ConfigMetadata { version: string | null }
export interface TagUpdateArgs { id: number, name: string | null, color: string | null }
export interface LibraryConfig { version: string | null, name: string, description: string }
export interface IdentifyUniqueFilesArgs { id: number, path: string }
export interface FilePath { id: number, is_dir: boolean, location_id: number | null, materialized_path: string, name: string, extension: string | null, file_id: number | null, parent_id: number | null, key_id: number | null, date_created: string, date_modified: string, date_indexed: string, file: File | null | null, location: Location | null | null, key: Key | null | null }
export interface Album { id: number, pub_id: Array<number>, name: string, is_hidden: boolean, date_created: string, date_modified: string, files: Array<FileInAlbum> | null }
export interface SetFavoriteArgs { id: number, favorite: boolean }
export interface LocationUpdateArgs { id: number, name: string | null }
export interface Job { id: Array<number>, name: string, node_id: number, action: number, status: number, data: Array<number> | null, task_count: number, completed_task_count: number, date_created: string, date_modified: string, seconds_elapsed: number, nodes: Node | null }
export interface Statistics { id: number, date_captured: string, total_file_count: number, library_db_size: string, total_bytes_used: string, total_bytes_capacity: string, total_unique_bytes: string, total_bytes_free: string, preview_media_bytes: string }
export interface MediaData { id: number, pixel_width: number | null, pixel_height: number | null, longitude: number | null, latitude: number | null, fps: number | null, capture_device_make: string | null, capture_device_model: string | null, capture_device_software: string | null, duration_seconds: number | null, codecs: string | null, streams: number | null, files: File | null | null }
export interface NodeConfig { version: string | null, id: string, name: string, p2p_port: number | null }
export interface TagCreateArgs { name: string, color: string }
export interface FileInAlbum { date_created: string, album_id: number, album: Album | null, file_id: number, file: File | null }
export interface Label { id: number, pub_id: Array<number>, name: string | null, date_created: string, date_modified: string, label_files: Array<LabelOnFile> | null }
export interface LabelOnFile { date_created: string, label_id: number, label: Label | null, file_id: number, file: File | null }
export interface File { id: number, cas_id: string, integrity_checksum: string | null, kind: number, size_in_bytes: string, key_id: number | null, hidden: boolean, favorite: boolean, important: boolean, has_thumbnail: boolean, has_thumbstrip: boolean, has_video_preview: boolean, ipfs_id: string | null, note: string | null, date_created: string, date_modified: string, date_indexed: string, tags: Array<TagOnFile> | null, labels: Array<LabelOnFile> | null, albums: Array<FileInAlbum> | null, spaces: Array<FileInSpace> | null, paths: Array<FilePath> | null, comments: Array<Comment> | null, media_data: MediaData | null | null, key: Key | null | null }
export interface EditLibraryArgs { id: string, name: string | null, description: string | null }
export interface LibraryArgs<T> { library_id: string, arg: T }
export interface NodeConfig { version: string | null, id: string, name: string, p2p_port: number | null }
export interface MediaData { id: number, pixel_width: number | null, pixel_height: number | null, longitude: number | null, latitude: number | null, fps: number | null, capture_device_make: string | null, capture_device_model: string | null, capture_device_software: string | null, duration_seconds: number | null, codecs: string | null, streams: number | null, files: File | null | null }
export interface Space { id: number, pub_id: Array<number>, name: string | null, description: string | null, date_created: string, date_modified: string, files: Array<FileInSpace> | null }
export interface Comment { id: number, pub_id: Array<number>, content: string, date_created: string, date_modified: string, file_id: number | null, file: File | null | null }
export interface Album { id: number, pub_id: Array<number>, name: string, is_hidden: boolean, date_created: string, date_modified: string, files: Array<FileInAlbum> | null }
export interface GetExplorerDirArgs { location_id: number, path: string, limit: number }
export type JobStatus = "Queued" | "Running" | "Completed" | "Canceled" | "Failed" | "Paused"
export interface LabelOnFile { date_created: string, label_id: number, label: Label | null, file_id: number, file: File | null }
export interface JobReport { id: string, name: string, data: Array<number> | null, date_created: string, date_modified: string, status: JobStatus, task_count: number, completed_task_count: number, message: string, seconds_elapsed: number }
export interface Tag { id: number, pub_id: Array<number>, name: string | null, color: string | null, total_files: number | null, redundancy_goal: number | null, date_created: string, date_modified: string, tag_files: Array<TagOnFile> | null }
export interface FilePath { id: number, is_dir: boolean, location_id: number | null, materialized_path: string, name: string, extension: string | null, file_id: number | null, parent_id: number | null, key_id: number | null, date_created: string, date_modified: string, date_indexed: string, file: File | null | null, location: Location | null | null, key: Key | null | null }
export interface LibraryConfigWrapped { uuid: string, config: LibraryConfig }
export interface LocationUpdateArgs { id: number, name: string | null }
export interface FileInSpace { date_created: string, space_id: number, space: Space | null, file_id: number, file: File | null }
export interface InvalidateOperationEvent { key: string, arg: any }
export interface TagOnFile { date_created: string, tag_id: number, tag: Tag | null, file_id: number, file: File | null }
export interface NodeState { version: string | null, id: string, name: string, p2p_port: number | null, data_path: string }
export interface LibraryArgs<T> { library_id: string, arg: T }
export type JobStatus = "Queued" | "Running" | "Completed" | "Canceled" | "Failed" | "Paused"
export interface Node { id: number, pub_id: Array<number>, name: string, platform: number, version: string | null, last_seen: string, timezone: string | null, date_created: string, sync_events: Array<SyncEvent> | null, jobs: Array<Job> | null, Location: Array<Location> | null }
export interface File { id: number, cas_id: string, integrity_checksum: string | null, kind: number, size_in_bytes: string, key_id: number | null, hidden: boolean, favorite: boolean, important: boolean, has_thumbnail: boolean, has_thumbstrip: boolean, has_video_preview: boolean, ipfs_id: string | null, note: string | null, date_created: string, date_modified: string, date_indexed: string, tags: Array<TagOnFile> | null, labels: Array<LabelOnFile> | null, albums: Array<FileInAlbum> | null, spaces: Array<FileInSpace> | null, paths: Array<FilePath> | null, comments: Array<Comment> | null, media_data: MediaData | null | null, key: Key | null | null }
export interface Key { id: number, checksum: string, name: string | null, date_created: string | null, algorithm: number | null, files: Array<File> | null, file_paths: Array<FilePath> | null }
export interface SyncEvent { id: number, node_id: number, timestamp: string, record_id: Array<number>, kind: number, column: string | null, value: string, node: Node | null }
export interface SetFavoriteArgs { id: number, favorite: boolean }
export interface InvalidateOperationEvent { key: string, arg: any }
export interface NodeState { version: string | null, id: string, name: string, p2p_port: number | null, data_path: string }
export interface ConfigMetadata { version: string | null }
export interface Volume { name: string, mount_point: string, total_capacity: bigint, available_capacity: bigint, is_removable: boolean, disk_type: string | null, file_system: string | null, is_root_filesystem: boolean }
export interface FileInAlbum { date_created: string, album_id: number, album: Album | null, file_id: number, file: File | null }
export interface Comment { id: number, pub_id: Array<number>, content: string, date_created: string, date_modified: string, file_id: number | null, file: File | null | null }
export interface LibraryConfig { version: string | null, name: string, description: string }
export interface TagUpdateArgs { id: number, name: string | null, color: string | null }
export interface TagAssignArgs { file_id: number, tag_id: number }
export interface Statistics { id: number, date_captured: string, total_file_count: number, library_db_size: string, total_bytes_used: string, total_bytes_capacity: string, total_unique_bytes: string, total_bytes_free: string, preview_media_bytes: string }
export interface GenerateThumbsForLocationArgs { id: number, path: string }
export interface SetNoteArgs { id: number, note: string | null }
export interface Job { id: Array<number>, name: string, node_id: number, action: number, status: number, data: Array<number> | null, task_count: number, completed_task_count: number, date_created: string, date_modified: string, seconds_elapsed: number, nodes: Node | null }
export interface GetExplorerDirArgs { location_id: number, path: string, limit: number }
export interface Label { id: number, pub_id: Array<number>, name: string | null, date_created: string, date_modified: string, label_files: Array<LabelOnFile> | null }
export interface LibraryConfigWrapped { uuid: string, config: LibraryConfig }
export interface TagOnFile { date_created: string, tag_id: number, tag: Tag | null, file_id: number, file: File | null }
export interface Tag { id: number, pub_id: Array<number>, name: string | null, color: string | null, total_files: number | null, redundancy_goal: number | null, date_created: string, date_modified: string, tag_files: Array<TagOnFile> | null }
export interface IdentifyUniqueFilesArgs { id: number, path: string }
export interface DirectoryWithContents { directory: FilePath, contents: Array<FilePath> }
export interface FileInSpace { date_created: string, space_id: number, space: Space | null, file_id: number, file: File | null }

View file

@ -1,93 +0,0 @@
use crate::{
encode::THUMBNAIL_CACHE_DIR_NAME,
file::{DirectoryWithContents, FileError, FilePath},
library::LibraryContext,
prisma::file_path,
sys::get_location,
};
use log::info;
use std::path::Path;
pub async fn open_dir(
ctx: &LibraryContext,
location_id: i32,
path: impl AsRef<Path>,
) -> Result<DirectoryWithContents, FileError> {
// get location
let location = get_location(ctx, location_id).await?;
let path_str = path.as_ref().to_string_lossy().to_string();
let directory = ctx
.db
.file_path()
.find_first(vec![
file_path::location_id::equals(Some(location.id)),
file_path::materialized_path::equals(path_str),
file_path::is_dir::equals(true),
])
.exec()
.await?
.ok_or_else(|| FileError::DirectoryNotFound(path.as_ref().to_path_buf()))?;
info!("DIRECTORY: {:?}", directory);
let mut file_paths: Vec<FilePath> = ctx
.db
.file_path()
.find_many(vec![
file_path::location_id::equals(Some(location.id)),
file_path::parent_id::equals(Some(directory.id)),
])
.with(file_path::file::fetch())
.exec()
.await?
.into_iter()
.map(Into::into)
.collect();
for file_path in &mut file_paths {
if let Some(file) = &mut file_path.file {
let thumb_path = ctx
.config()
.data_directory()
.join(THUMBNAIL_CACHE_DIR_NAME)
.join(location.id.to_string())
.join(&file.cas_id)
.with_extension("webp");
file.has_thumbnail = thumb_path.exists();
}
}
Ok(DirectoryWithContents {
directory: directory.into(),
contents: file_paths,
})
}
// pub async fn open_tag(ctx: &LibraryContext, tag_id: i32) -> Result<TagWithFiles, TagError> {
// let tag: Tag = ctx
// .db
// .tag()
// .find_unique(tag::id::equals(tag_id))
// .exec()
// .await?
// .ok_or(TagError::TagNotFound(tag_id))?
// .into();
//
// let files_with_tag: Vec<TagOnFile> = ctx
// .db
// .tag_on_file()
// .find_many(vec![tag_on_file::tag_id::equals(tag_id)])
// .exec()
// .await?
// .into_iter()
// .map(Into::into)
// .collect();
//
// Ok(TagWithFiles {
// tag,
// files_with_tag,
// })
// }