From 408775a25a7af220fbe744ff1003e84eeca033bb Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 3 Mar 2022 19:03:34 -0600 Subject: [PATCH] Add:Library media type selection and library icons --- client/components/icons/audiobooks-svg.vue | 23 ++++ client/components/icons/books-svg.vue | 16 +++ client/components/icons/comics-svg.vue | 16 +++ client/components/icons/database-svg.vue | 16 +++ client/components/icons/podcasts-svg.vue | 19 ++++ .../modals/libraries/EditLibrary.vue | 18 ++- .../modals/libraries/LibraryItem.vue | 4 +- client/components/ui/LibrariesDropdown.vue | 2 +- client/components/ui/MediaTypePicker.vue | 104 ++++++++++++++++++ client/components/widgets/LibraryIcon.vue | 19 +++- server/objects/Library.js | 13 +++ 11 files changed, 235 insertions(+), 15 deletions(-) create mode 100644 client/components/icons/audiobooks-svg.vue create mode 100644 client/components/icons/books-svg.vue create mode 100644 client/components/icons/comics-svg.vue create mode 100644 client/components/icons/database-svg.vue create mode 100644 client/components/icons/podcasts-svg.vue create mode 100644 client/components/ui/MediaTypePicker.vue diff --git a/client/components/icons/audiobooks-svg.vue b/client/components/icons/audiobooks-svg.vue new file mode 100644 index 00000000..905c83cc --- /dev/null +++ b/client/components/icons/audiobooks-svg.vue @@ -0,0 +1,23 @@ + + + \ No newline at end of file diff --git a/client/components/icons/books-svg.vue b/client/components/icons/books-svg.vue new file mode 100644 index 00000000..b2e459a4 --- /dev/null +++ b/client/components/icons/books-svg.vue @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/client/components/icons/comics-svg.vue b/client/components/icons/comics-svg.vue new file mode 100644 index 00000000..30903253 --- /dev/null +++ b/client/components/icons/comics-svg.vue @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/client/components/icons/database-svg.vue b/client/components/icons/database-svg.vue new file mode 100644 index 00000000..10929b16 --- /dev/null +++ b/client/components/icons/database-svg.vue @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/client/components/icons/podcasts-svg.vue b/client/components/icons/podcasts-svg.vue new file mode 100644 index 00000000..d025ab0d --- /dev/null +++ b/client/components/icons/podcasts-svg.vue @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/client/components/modals/libraries/EditLibrary.vue b/client/components/modals/libraries/EditLibrary.vue index 9c437712..2e275b9f 100644 --- a/client/components/modals/libraries/EditLibrary.vue +++ b/client/components/modals/libraries/EditLibrary.vue @@ -6,11 +6,14 @@
-
-
+
+
-
+
+ +
+
@@ -18,7 +21,6 @@

Folders

- folder close @@ -60,6 +62,7 @@ export default { return { name: '', provider: '', + mediaType: '', folders: [], showDirectoryPicker: false, disableWatcher: false @@ -80,7 +83,7 @@ export default { var newfolderpaths = this.folderPaths.join(',') var origfolderpaths = this.library.folders.map((f) => f.fullPath).join(',') - return newfolderpaths === origfolderpaths && this.name === this.library.name && this.provider === this.library.provider && this.disableWatcher === this.library.disableWatcher + return newfolderpaths === origfolderpaths && this.name === this.library.name && this.provider === this.library.provider && this.disableWatcher === this.library.disableWatcher && this.mediaType === this.library.mediaType }, providers() { return this.$store.state.scanners.providers @@ -103,6 +106,7 @@ export default { this.provider = this.library ? this.library.provider : '' this.folders = this.library ? this.library.folders.map((p) => ({ ...p })) : [] this.disableWatcher = this.library ? !!this.library.disableWatcher : false + this.mediaType = this.library ? this.library.mediaType : 'default' this.showDirectoryPicker = false }, selectFolder(fullPath) { @@ -129,6 +133,8 @@ export default { name: this.name, provider: this.provider, folders: this.folders, + mediaType: this.mediaType, + icon: this.mediaType, disableWatcher: this.disableWatcher } @@ -163,6 +169,8 @@ export default { name: this.name, provider: this.provider, folders: this.folders, + mediaType: this.mediaType, + icon: this.mediaType, disableWatcher: this.disableWatcher } diff --git a/client/components/modals/libraries/LibraryItem.vue b/client/components/modals/libraries/LibraryItem.vue index 6f6b5e8a..d6ce9a04 100644 --- a/client/components/modals/libraries/LibraryItem.vue +++ b/client/components/modals/libraries/LibraryItem.vue @@ -1,9 +1,7 @@