From 11d7330c5db8c22ecdc465aab77830ce76eb8dc2 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 6 Sep 2021 14:13:01 -0500 Subject: [PATCH] Update user audiobook progress model, add mark as read/not read, download individual tracks --- client/assets/app.css | 6 +- client/components/cards/BookCard.vue | 5 +- client/components/modals/EditModal.vue | 11 +- client/components/modals/edit-tabs/Cover.vue | 2 +- .../components/modals/edit-tabs/Details.vue | 154 +++++++++++------- .../components/modals/edit-tabs/Download.vue | 14 +- client/components/modals/edit-tabs/Match.vue | 2 +- client/components/modals/edit-tabs/Tracks.vue | 6 +- client/components/tables/TracksTable.vue | 4 + client/components/ui/IconBtn.vue | 49 ++++++ client/components/ui/ReadIconBtn.vue | 82 ++++++++++ client/components/ui/Tooltip.vue | 14 ++ client/package.json | 2 +- client/pages/audiobook/_id/index.vue | 77 +++++++-- client/store/index.js | 10 ++ docker-template.xml | 2 +- package.json | 2 +- server/ApiController.js | 12 +- server/StreamManager.js | 4 +- server/objects/AudiobookProgress.js | 91 +++++++++++ server/objects/User.js | 47 ++++-- 21 files changed, 496 insertions(+), 100 deletions(-) create mode 100644 client/components/ui/IconBtn.vue create mode 100644 client/components/ui/ReadIconBtn.vue create mode 100644 server/objects/AudiobookProgress.js diff --git a/client/assets/app.css b/client/assets/app.css index 2a3e048b..b24e0d22 100644 --- a/client/assets/app.css +++ b/client/assets/app.css @@ -83,6 +83,10 @@ box-shadow: 2px 8px 6px #111111aa; } +.box-shadow-md-up { + box-shadow: 0px -8px 8px #11111144; +} + .box-shadow-lg-up { box-shadow: 0px -12px 8px #111111ee; } @@ -93,4 +97,4 @@ .box-shadow-book { box-shadow: 4px 1px 8px #11111166, -4px 1px 8px #11111166, 1px -4px 8px #11111166; -} \ No newline at end of file +} diff --git a/client/components/cards/BookCard.vue b/client/components/cards/BookCard.vue index 18e15fad..5446c9d8 100644 --- a/client/components/cards/BookCard.vue +++ b/client/components/cards/BookCard.vue @@ -26,7 +26,7 @@ {{ selected ? 'radio_button_checked' : 'radio_button_unchecked' }} -
+
@@ -125,6 +125,9 @@ export default { userProgressPercent() { return this.userProgress ? this.userProgress.progress || 0 : 0 }, + userIsRead() { + return this.userProgress ? !!this.userProgress.isRead : false + }, showError() { return this.hasMissingParts || this.hasInvalidParts }, diff --git a/client/components/modals/EditModal.vue b/client/components/modals/EditModal.vue index 71fdb1d2..469dd41b 100644 --- a/client/components/modals/EditModal.vue +++ b/client/components/modals/EditModal.vue @@ -10,7 +10,7 @@
{{ tab.title }}
-
+
@@ -22,7 +22,6 @@ export default { data() { return { - selectedTab: 'details', processing: false, audiobook: null, fetchOnShow: false, @@ -79,6 +78,14 @@ export default { this.$store.commit('setShowEditModal', val) } }, + selectedTab: { + get() { + return this.$store.state.editModalTab + }, + set(val) { + this.$store.commit('setEditModalTab', val) + } + }, height() { var maxHeightAllowed = window.innerHeight - 150 return Math.min(maxHeightAllowed, 650) diff --git a/client/components/modals/edit-tabs/Cover.vue b/client/components/modals/edit-tabs/Cover.vue index 08135412..3397f5e8 100644 --- a/client/components/modals/edit-tabs/Cover.vue +++ b/client/components/modals/edit-tabs/Cover.vue @@ -1,5 +1,5 @@