removed pico, play button toggles

This commit is contained in:
Logan Jones
2025-04-08 19:11:17 -05:00
parent c66d1820aa
commit a0af1230cb
6 changed files with 36 additions and 39 deletions
@@ -0,0 +1,49 @@
import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { GetDir, SetDir } from '@go/library/Library.js';
import { DirectoryPicker } from '@go/frontendbindings/FrontendBindings.js';
@customElement('library-picker')
export class LibraryPicker extends LitElement {
@property({ type: String })
currentLibraryDirectoryText: string = "No Library Directory selected";
override render() {
return html`
<div>
<label>${this.currentLibraryDirectoryText}</label>
<button @click="${this.onSelectLibraryClick}">Choose Directory...</button>
</div>
`;
}
constructor() {
super();
GetDir().
then((result) => {
if (result.length === 0) { return; }
this.currentLibraryDirectoryText = result;
}).catch((err) => { console.error("error with getting current library directory: " + err) })
}
onSelectLibraryClick() {
try {
DirectoryPicker()
.then((result: string) => {
SetDir(result).then(() => {
this.currentLibraryDirectoryText = result;
}).catch((err: string) => {
console.error("error with saving selected directory: " + err);
});
})
.catch((err) => {
console.error("error with directory picker: " + err);
});
}
catch (err) {
console.error(err);
}
}
}