- {$_('discover.streamingNow')}
+
+
+ Series page for id: {id}
- {#await fetchNowStreaming()}
-
- {:then props}
- {#each props as prop (prop.tmdbId)}
-
-
-
- {/each}
- {/await}
-
+
+
This is something
+
history.back()}>Go back
diff --git a/src/lib/selectable.ts b/src/lib/selectable.ts
index 7aa4c2f..086c9e4 100644
--- a/src/lib/selectable.ts
+++ b/src/lib/selectable.ts
@@ -66,12 +66,31 @@ export class Selectable {
this.children[get(this.focusIndex)]?.focus();
} else if (this.htmlElement) {
this.htmlElement.focus({ preventScroll: true });
- this.htmlElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
+ // this.htmlElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
+ this.scrollIntoView(50);
Selectable.focusedObject.set(this);
this.updateFocusIndex();
}
}
+ scrollIntoView(offset = 0, direction: Direction = 'left') {
+ if (this.htmlElement) {
+ const boundingRect = this.htmlElement.getBoundingClientRect();
+ const offsetParent = this.htmlElement.offsetParent as HTMLElement;
+
+ if (offsetParent) {
+ const left = this.htmlElement.offsetLeft - offset;
+
+ console.log(boundingRect);
+ console.log('Scrolling to left: ', left);
+ offsetParent.scrollTo({
+ left,
+ behavior: 'smooth'
+ });
+ }
+ }
+ }
+
updateFocusIndex(selectable?: Selectable) {
if (selectable) {
const index = this.children.indexOf(selectable);
@@ -191,7 +210,7 @@ export class Selectable {
}
_unmountContainer() {
- console.log('Unmounting selectable', this);
+ // console.log('Unmounting selectable', this);
const isFocusedWithin = get(this.hasFocusWithin);
if (this.htmlElement) {
@@ -214,7 +233,7 @@ export class Selectable {
const selectable = _selectable || new Selectable().setDirection(flowDirection);
return (htmlElement: HTMLElement) => {
- console.log('Registering', htmlElement, selectable);
+ // console.log('Registering', htmlElement, selectable);
selectable.setHtmlElement(htmlElement);
return {
@@ -274,6 +293,12 @@ export class Selectable {
private shouldFocusByDefault(): boolean {
return this.focusByDefault || this.parent?.shouldFocusByDefault() || false;
}
+
+ click() {
+ if (this.htmlElement) {
+ this.htmlElement.click();
+ }
+ }
}
export function handleKeyboardNavigation(event: KeyboardEvent) {
@@ -300,5 +325,7 @@ export function handleKeyboardNavigation(event: KeyboardEvent) {
if (Selectable.focusLeft()) event.preventDefault();
} else if (event.key === 'ArrowRight') {
if (Selectable.focusRight()) event.preventDefault();
+ } else if (event.key === 'Enter') {
+ currentlyFocusedObject.click();
}
}
diff --git a/src/lib/stores/settings.store.ts b/src/lib/stores/settings.store.ts
index 54914ce..89b6b9e 100644
--- a/src/lib/stores/settings.store.ts
+++ b/src/lib/stores/settings.store.ts
@@ -55,9 +55,9 @@ export const defaultSettings: SettingsValues = {
rootFolderPath: ''
},
jellyfin: {
- apiKey: null,
- baseUrl: null,
- userId: null
+ apiKey: 'ff526980723144a095f560fc2975657b',
+ baseUrl: 'http://192.168.0.129:8096',
+ userId: '75dcb061c9404115a7acdc893ea6bbbc'
}
};
diff --git a/tizen/.gitignore b/tizen/.gitignore
index d0d36e9..e397205 100644
--- a/tizen/.gitignore
+++ b/tizen/.gitignore
@@ -1,2 +1,3 @@
.sign/*
-*.wgt
\ No newline at end of file
+*.wgt
+.buildResult/
diff --git a/tsconfig.json b/tsconfig.json
index 4be2476..6507d24 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -14,9 +14,9 @@
"allowJs": true,
"checkJs": true,
"isolatedModules": true,
- "paths": {
- "$lib/*": ["src/lib/*"],
- }
+// "paths": {
+// "$lib/*": ["src/lib/*"],
+// }
},
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
"references": [{ "path": "./tsconfig.node.json" }]