Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Addon } from "./src/addon-wrapper";
import { QueueManager } from "./src/queue/queue-manager";
import { QueueItem, typeQueue, HandleAction, HandleActions } from "./src/queue/queueManager";
import VirtualDrive from "./src/virtual-drive";
import { Addon } from "@/addon-wrapper";
import { QueueManager } from "@/queue/queue-manager";
import { QueueItem, typeQueue, HandleAction, HandleActions } from "@/queue/queueManager";
import { Callbacks } from "@/types/callbacks.type";
import { PinState, SyncState } from "@/types/placeholder.type";
import VirtualDrive from "@/virtual-drive";

export { Addon, VirtualDrive, QueueItem, typeQueue, HandleAction, HandleActions, QueueManager };
export { Addon, VirtualDrive, QueueItem, typeQueue, HandleAction, HandleActions, QueueManager, Callbacks, PinState, SyncState };
5 changes: 0 additions & 5 deletions src/addon-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,4 @@ export class Addon {
const result = await addon.hydrateFile(path);
return this.parseAddonZod("hydrateFile", result);
}

getPlaceholderAttribute({ path }: { path: string }) {
const result = addon.getPlaceholderAttribute(path);
return this.parseAddonZod("getPlaceholderAttribute", result);
}
}
1 change: 0 additions & 1 deletion src/addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type TAddon = {
path: string,
): any;
hydrateFile(path: string): Promise<z.infer<typeof addonZod.hydrateFile>>;
getPlaceholderAttribute(path: string): z.infer<typeof addonZod.getPlaceholderAttribute>;
dehydrateFile(path: string): z.infer<typeof addonZod.dehydrateFile>;
connectSyncRoot(path: string, callbacks: InputSyncCallbacks): z.infer<typeof addonZod.connectSyncRoot>;
convertToPlaceholder(path: string, id: string): z.infer<typeof addonZod.convertToPlaceholder>;
Expand Down
5 changes: 0 additions & 5 deletions src/addon/addon-zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ export const addonZod = {
convertToPlaceholder: z.boolean(),
dehydrateFile: z.boolean(),
getFileIdentity: z.string(),
getPlaceholderAttribute: z.object({ attribute: z.union([z.literal(0), z.literal(1), z.literal(2)]) }).transform(({ attribute }) => {
if (attribute === 1) return "NOT_PINNED";
if (attribute === 2) return "PINNED";
return "OTHER";
}),
getPlaceholderState: z.object({ pinState: z.nativeEnum(PinState), syncState: z.nativeEnum(SyncState) }),
getPlaceholderWithStatePending: z.array(z.string()),
hydrateFile: z.undefined(),
Expand Down
4 changes: 0 additions & 4 deletions src/virtual-drive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,6 @@ class VirtualDrive {
async hydrateFile(itemPath: string): Promise<void> {
return addon.hydrateFile({ path: this.fixPath(itemPath) });
}

getPlaceholderAttribute(itemPath: string) {
return addon.getPlaceholderAttribute({ path: this.fixPath(itemPath) });
}
}

export default VirtualDrive;
2 changes: 0 additions & 2 deletions src/watcher/detect-context-menu-action.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ export class DetectContextMenuActionService {
const { prev, curr } = details;

const status = self.addon.getPlaceholderState({ path });
const attribute = self.addon.getPlaceholderAttribute({ path });
const itemId = self.addon.getFileIdentity({ path });
const isInDevice = self.fileInDevice.has(path);

self.logger.info({
event: "onRaw",
path,
status,
attribute,
itemId,
isInDevice,
prev: {
Expand Down