From 1ebcbe8e487f165ed236a44663431d3832d1881d Mon Sep 17 00:00:00 2001 From: Greg Lorenzen Date: Sat, 3 Aug 2024 18:53:36 +0000 Subject: [PATCH] Add options for title field visibility --- .../components/content/LibraryItemDetails.vue | 19 +++--- .../modals/ItemFieldVisibilityModal.vue | 62 +++++++++++++++++++ client/pages/item/_id/index.vue | 18 ++++++ client/store/user.js | 13 +++- client/strings/en-us.json | 3 +- 5 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 client/components/modals/ItemFieldVisibilityModal.vue diff --git a/client/components/content/LibraryItemDetails.vue b/client/components/content/LibraryItemDetails.vue index 78abc2d98d..45ec81cbcd 100644 --- a/client/components/content/LibraryItemDetails.vue +++ b/client/components/content/LibraryItemDetails.vue @@ -1,6 +1,6 @@ -
+
{{ $strings.LabelPublishYear }}
@@ -19,7 +19,7 @@ {{ publishedYear }}
-
+
{{ $strings.LabelPublisher }}
@@ -35,7 +35,7 @@ {{ podcastType }}
-
+
{{ $strings.LabelGenres }}
@@ -46,7 +46,7 @@
-
+
{{ $strings.LabelTags }}
@@ -57,7 +57,7 @@
-
+
{{ $strings.LabelLanguage }}
@@ -65,7 +65,7 @@ {{ language }}
-
+
{{ $strings.LabelDuration }}
@@ -73,7 +73,7 @@ {{ durationPretty }}
-
+
{{ $strings.LabelSize }}
@@ -160,6 +160,9 @@ export default { }, podcastType() { return this.mediaMetadata.type + }, + fieldVisibility() { + return this.$store.getters['user/getUserSetting']('fieldVisibility') } }, methods: {}, diff --git a/client/components/modals/ItemFieldVisibilityModal.vue b/client/components/modals/ItemFieldVisibilityModal.vue new file mode 100644 index 0000000000..b6410053fe --- /dev/null +++ b/client/components/modals/ItemFieldVisibilityModal.vue @@ -0,0 +1,62 @@ + + + \ No newline at end of file diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue index 57a1ae7435..5a41032d8a 100644 --- a/client/pages/item/_id/index.vue +++ b/client/pages/item/_id/index.vue @@ -1,5 +1,10 @@ @@ -180,6 +186,7 @@ export default { episodesDownloading: [], episodeDownloadsQueued: [], showBookmarksModal: false, + showFieldVisibilityModal: false, isDescriptionClamped: false, showFullDescription: false } @@ -429,6 +436,12 @@ export default { }) } + return items + }, + globalItemSettingsContextMenuItems() { + const items = [] + items.push({ text: this.$strings.LabelFieldVisibility, action: 'fieldVisibility' }) + return items } }, @@ -759,6 +772,11 @@ export default { this.$store.commit('setSelectedLibraryItem', this.libraryItem) this.$store.commit('globals/setShareModal', this.mediaItemShare) } + }, + globalItemSettingsContextMenuAction({ action, data }) { + if (action === 'fieldVisibility') { + this.showFieldVisibilityModal = true + } } }, mounted() { diff --git a/client/store/user.js b/client/store/user.js index 10dc8ef662..dab86bc197 100644 --- a/client/store/user.js +++ b/client/store/user.js @@ -16,7 +16,18 @@ export const state = () => ({ authorSortBy: 'name', authorSortDesc: false, jumpForwardAmount: 10, - jumpBackwardAmount: 10 + jumpBackwardAmount: 10, + fieldVisibility: { + narrators: true, + publishYear: true, + publisher: true, + genres: true, + tags: true, + language: true, + duration: true, + releaseDate: true, + size: true + } } }) diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 6da92f6f64..d00e4bbc7c 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -136,6 +136,7 @@ "HeaderEpisodes": "Episodes", "HeaderEreaderDevices": "Ereader Devices", "HeaderEreaderSettings": "Ereader Settings", + "HeaderFields": "Fields", "HeaderFiles": "Files", "HeaderFindChapters": "Find Chapters", "HeaderIgnoredFiles": "Ignored Files", @@ -318,6 +319,7 @@ "LabelExportOPML": "Export OPML", "LabelFeedURL": "Feed URL", "LabelFetchingMetadata": "Fetching Metadata", + "LabelFieldVisibility": "Field Visibility", "LabelFile": "File", "LabelFileBirthtime": "File Birthtime", "LabelFileBornDate": "Born {0}", @@ -407,7 +409,6 @@ "LabelMore": "More", "LabelMoreInfo": "More Info", "LabelName": "Name", - "LabelNarrator": "Narrator", "LabelNarrators": "Narrators", "LabelNew": "New", "LabelNewPassword": "New Password",