From 2463c62bbf1f8acf0db0e9a3e2d82fe2725218f4 Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 16 Jan 2025 16:56:56 -0600 Subject: [PATCH 1/2] Update bookmark modal scrollable with create always visible, make UI consistent, hide create when bookmark already exists --- client/components/modals/BookmarksModal.vue | 41 +++++++------------ .../modals/bookmarks/BookmarkItem.vue | 20 ++++++--- client/strings/bg.json | 1 - client/strings/bn.json | 1 - client/strings/ca.json | 1 - client/strings/cs.json | 1 - client/strings/da.json | 1 - client/strings/de.json | 1 - client/strings/en-us.json | 1 - client/strings/es.json | 1 - client/strings/et.json | 1 - client/strings/fr.json | 1 - client/strings/he.json | 1 - client/strings/hr.json | 1 - client/strings/hu.json | 1 - client/strings/it.json | 1 - client/strings/lt.json | 1 - client/strings/nl.json | 1 - client/strings/no.json | 1 - client/strings/pl.json | 1 - client/strings/pt-br.json | 1 - client/strings/ru.json | 1 - client/strings/sl.json | 1 - client/strings/sv.json | 1 - client/strings/uk.json | 1 - client/strings/vi-vn.json | 1 - client/strings/zh-cn.json | 1 - client/strings/zh-tw.json | 1 - 28 files changed, 29 insertions(+), 58 deletions(-) diff --git a/client/components/modals/BookmarksModal.vue b/client/components/modals/BookmarksModal.vue index 08d800f0d2..ad0d7343e1 100644 --- a/client/components/modals/BookmarksModal.vue +++ b/client/components/modals/BookmarksModal.vue @@ -5,24 +5,26 @@

{{ $strings.LabelYourBookmarks }}

-
-
+
+
-
-

{{ $strings.MessageNoBookmarks }}

-
-
-
-
+
+
+

{{ $strings.MessageNoBookmarks }}

+
+ +
+ +

{{ this.$secondsToTimestamp(currentTime) }}

- +
add
@@ -44,8 +46,7 @@ export default { type: Number, default: 0 }, - libraryItemId: String, - hideCreate: Boolean + libraryItemId: String }, data() { return { @@ -57,6 +58,7 @@ export default { watch: { show(newVal) { if (newVal) { + this.selectedBookmark = null this.showBookmarkTitleInput = false this.newBookmarkTitle = '' } @@ -72,7 +74,7 @@ export default { } }, canCreateBookmark() { - return !this.bookmarks.find((bm) => bm.time === this.currentTime) + return !this.bookmarks.find((bm) => Math.abs(this.currentTime - bm.time) < 1) }, dateFormat() { return this.$store.state.serverSettings.dateFormat @@ -102,19 +104,6 @@ export default { clickBookmark(bm) { this.$emit('select', bm) }, - submitUpdateBookmark(updatedBookmark) { - var bookmark = { ...updatedBookmark } - this.$axios - .$patch(`/api/me/item/${this.libraryItemId}/bookmark`, bookmark) - .then(() => { - this.$toast.success(this.$strings.ToastBookmarkUpdateSuccess) - }) - .catch((error) => { - this.$toast.error(this.$strings.ToastFailedToUpdate) - console.error(error) - }) - this.show = false - }, submitCreateBookmark() { if (!this.newBookmarkTitle) { this.newBookmarkTitle = this.$formatDatetime(Date.now(), this.dateFormat, this.timeFormat) diff --git a/client/components/modals/bookmarks/BookmarkItem.vue b/client/components/modals/bookmarks/BookmarkItem.vue index 1be3894a4c..c4035bc867 100644 --- a/client/components/modals/bookmarks/BookmarkItem.vue +++ b/client/components/modals/bookmarks/BookmarkItem.vue @@ -1,5 +1,5 @@ -
+

{{ $strings.MessageNoBookmarks }}

-
+

- {{ this.$secondsToTimestamp(currentTime) }} + {{ this.$secondsToTimestamp(currentTime / playbackRate) }}

@@ -46,7 +46,9 @@ export default { type: Number, default: 0 }, - libraryItemId: String + libraryItemId: String, + playbackRate: Number, + hideCreate: Boolean }, data() { return { diff --git a/client/components/modals/bookmarks/BookmarkItem.vue b/client/components/modals/bookmarks/BookmarkItem.vue index c4035bc867..538d3115f3 100644 --- a/client/components/modals/bookmarks/BookmarkItem.vue +++ b/client/components/modals/bookmarks/BookmarkItem.vue @@ -2,7 +2,7 @@

- {{ this.$secondsToTimestamp(bookmark.time) }} + {{ this.$secondsToTimestamp(bookmark.time / playbackRate) }}

@@ -35,7 +35,8 @@ export default { type: Object, default: () => {} }, - highlight: Boolean + highlight: Boolean, + playbackRate: Number }, data() { return { diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue index 139794e555..a0cadc1d48 100644 --- a/client/pages/item/_id/index.vue +++ b/client/pages/item/_id/index.vue @@ -141,7 +141,7 @@
- +