diff --git a/Dockerfile b/Dockerfile index 0d4629f84d..4e110a6194 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,5 +46,10 @@ RUN apk del make python3 g++ EXPOSE 80 +ENV PORT=80 +ENV CONFIG_PATH="/config" +ENV METADATA_PATH="/metadata" +ENV SOURCE="docker" + ENTRYPOINT ["tini", "--"] CMD ["node", "index.js"] diff --git a/client/components/app/MediaPlayerContainer.vue b/client/components/app/MediaPlayerContainer.vue index 989fc062da..61b10ba85c 100644 --- a/client/components/app/MediaPlayerContainer.vue +++ b/client/components/app/MediaPlayerContainer.vue @@ -55,7 +55,7 @@ @showPlayerQueueItems="showPlayerQueueItemsModal = true" /> - + diff --git a/client/components/modals/BookmarksModal.vue b/client/components/modals/BookmarksModal.vue index 08d800f0d2..5c43d024bb 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) }} + {{ this.$secondsToTimestamp(currentTime / playbackRate) }}

- +
add
@@ -45,6 +47,7 @@ export default { default: 0 }, libraryItemId: String, + playbackRate: Number, hideCreate: Boolean }, data() { @@ -57,6 +60,7 @@ export default { watch: { show(newVal) { if (newVal) { + this.selectedBookmark = null this.showBookmarkTitleInput = false this.newBookmarkTitle = '' } @@ -72,7 +76,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 +106,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..538d3115f3 100644 --- a/client/components/modals/bookmarks/BookmarkItem.vue +++ b/client/components/modals/bookmarks/BookmarkItem.vue @@ -1,8 +1,8 @@ diff --git a/client/components/modals/podcast/EditEpisode.vue b/client/components/modals/podcast/EditEpisode.vue index b87f89c7d8..9702ce3805 100644 --- a/client/components/modals/podcast/EditEpisode.vue +++ b/client/components/modals/podcast/EditEpisode.vue @@ -170,6 +170,12 @@ export default { this.show = false } }, + libraryItemUpdated(libraryItem) { + const episode = libraryItem.media.episodes.find((e) => e.id === this.selectedEpisodeId) + if (episode) { + this.episodeItem = episode + } + }, hotkey(action) { if (action === this.$hotkeys.Modal.NEXT_PAGE) { this.goNextEpisode() @@ -178,9 +184,15 @@ export default { } }, registerListeners() { + if (this.libraryItem) { + this.$eventBus.$on(`${this.libraryItem.id}_updated`, this.libraryItemUpdated) + } this.$eventBus.$on('modal-hotkey', this.hotkey) }, unregisterListeners() { + if (this.libraryItem) { + this.$eventBus.$on(`${this.libraryItem.id}_updated`, this.libraryItemUpdated) + } this.$eventBus.$off('modal-hotkey', this.hotkey) } }, diff --git a/client/components/modals/podcast/tabs/EpisodeDetails.vue b/client/components/modals/podcast/tabs/EpisodeDetails.vue index 2084ddee68..9a2eb77d28 100644 --- a/client/components/modals/podcast/tabs/EpisodeDetails.vue +++ b/client/components/modals/podcast/tabs/EpisodeDetails.vue @@ -11,7 +11,7 @@
- +
@@ -145,11 +145,18 @@ export default { return null } + // Check pubdate is valid if it is being updated. Cannot be set to null in the web client + if (this.newEpisode.pubDate === null && this.$refs.pubdate?.$refs?.input?.isInvalidDate) { + this.$toast.error(this.$strings.ToastDateTimeInvalidOrIncomplete) + return null + } + const updatedDetails = this.getUpdatePayload() if (!Object.keys(updatedDetails).length) { this.$toast.info(this.$strings.ToastNoUpdatesNecessary) return false } + return this.updateDetails(updatedDetails) }, async updateDetails(updatedDetails) { @@ -163,13 +170,10 @@ export default { this.isProcessing = false if (updateResult) { - if (updateResult) { - this.$toast.success(this.$strings.ToastItemUpdateSuccess) - return true - } else { - this.$toast.info(this.$strings.MessageNoUpdatesWereNecessary) - } + this.$toast.success(this.$strings.ToastItemUpdateSuccess) + return true } + return false } }, diff --git a/client/components/player/PlayerUi.vue b/client/components/player/PlayerUi.vue index d4fdb8f729..31267c7a03 100644 --- a/client/components/player/PlayerUi.vue +++ b/client/components/player/PlayerUi.vue @@ -4,7 +4,7 @@
- + diff --git a/client/components/stats/Heatmap.vue b/client/components/stats/Heatmap.vue index 4e49162100..4fc8ca0483 100644 --- a/client/components/stats/Heatmap.vue +++ b/client/components/stats/Heatmap.vue @@ -63,9 +63,6 @@ export default { dayOfWeekToday() { return new Date().getDay() }, - firstWeekStart() { - return this.$addDaysToToday(-this.daysToShow) - }, dayLabels() { return [ { @@ -198,12 +195,25 @@ export default { let minValue = 0 const dates = [] - for (let i = 0; i < this.daysToShow + 1; i++) { - const date = i === 0 ? this.firstWeekStart : this.$addDaysToDate(this.firstWeekStart, i) + + const numDaysInTheLastYear = 52 * 7 + this.dayOfWeekToday + const firstDay = this.$addDaysToToday(-numDaysInTheLastYear) + for (let i = 0; i < numDaysInTheLastYear + 1; i++) { + const date = i === 0 ? firstDay : this.$addDaysToDate(firstDay, i) const dateString = this.$formatJsDate(date, 'yyyy-MM-dd') + + if (this.daysListening[dateString] > 0) { + this.daysListenedInTheLastYear++ + } + + const visibleDayIndex = i - (numDaysInTheLastYear - this.daysToShow) + if (visibleDayIndex < 0) { + continue + } + const dateObj = { - col: Math.floor(i / 7), - row: i % 7, + col: Math.floor(visibleDayIndex / 7), + row: visibleDayIndex % 7, date, dateString, datePretty: this.$formatJsDate(date, 'MMM d, yyyy'), @@ -215,7 +225,6 @@ export default { dates.push(dateObj) if (dateObj.value > 0) { - this.daysListenedInTheLastYear++ if (dateObj.value > maxValue) maxValue = dateObj.value if (!minValue || dateObj.value < minValue) minValue = dateObj.value } diff --git a/client/components/tables/podcast/LazyEpisodeRow.vue b/client/components/tables/podcast/LazyEpisodeRow.vue index 20e6b9f986..8709b1ad69 100644 --- a/client/components/tables/podcast/LazyEpisodeRow.vue +++ b/client/components/tables/podcast/LazyEpisodeRow.vue @@ -96,7 +96,7 @@ export default { return this.episode?.title || '' }, episodeSubtitle() { - return this.episode?.subtitle || '' + return this.episode?.subtitle || this.episode?.description || '' }, episodeType() { return this.episode?.episodeType || '' diff --git a/client/components/tables/podcast/LazyEpisodesTable.vue b/client/components/tables/podcast/LazyEpisodesTable.vue index 0dae11b36b..8821ccef19 100644 --- a/client/components/tables/podcast/LazyEpisodesTable.vue +++ b/client/components/tables/podcast/LazyEpisodesTable.vue @@ -30,7 +30,7 @@
-
+