Add resolving of files when a path is selected
Signed-off-by: trivernis <trivernis@protonmail.com>pull/4/head
parent
b5dcc17723
commit
d9fc378a1b
@ -0,0 +1,7 @@
|
|||||||
|
export type FileOsMetadata = {
|
||||||
|
name: string,
|
||||||
|
path: string,
|
||||||
|
mime_type: string,
|
||||||
|
created_at: Date,
|
||||||
|
modified_at: Date,
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ImportService } from './import.service';
|
||||||
|
|
||||||
|
describe('ImportService', () => {
|
||||||
|
let service: ImportService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(ImportService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,15 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import {FileOsMetadata} from "../../models/FileOsMetadata";
|
||||||
|
import {invoke} from "@tauri-apps/api/tauri";
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ImportService {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
public async resolvePathsToFiles(paths: string[]): Promise<FileOsMetadata[]> {
|
||||||
|
return await invoke<FileOsMetadata[]>("plugin:mediarepo|resolve_paths_to_files", {paths});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue