diff --git a/client/components/cards/PersonCard.vue b/client/components/cards/PersonCard.vue new file mode 100644 index 00000000..7ea81316 --- /dev/null +++ b/client/components/cards/PersonCard.vue @@ -0,0 +1,56 @@ + + + \ No newline at end of file diff --git a/client/components/cards/SearchAuthorCard.vue b/client/components/cards/SearchAuthorCard.vue new file mode 100644 index 00000000..62c68750 --- /dev/null +++ b/client/components/cards/SearchAuthorCard.vue @@ -0,0 +1,73 @@ + + + \ No newline at end of file diff --git a/client/components/modals/EditModal.vue b/client/components/modals/EditModal.vue index 48b1e654..e51ce44a 100644 --- a/client/components/modals/EditModal.vue +++ b/client/components/modals/EditModal.vue @@ -44,11 +44,11 @@ export default { title: 'Cover', component: 'modals-edit-tabs-cover' }, - { - id: 'tracks', - title: 'Tracks', - component: 'modals-edit-tabs-tracks' - }, + // { + // id: 'tracks', + // title: 'Tracks', + // component: 'modals-edit-tabs-tracks' + // }, { id: 'chapters', title: 'Chapters', @@ -69,6 +69,11 @@ export default { title: 'Match', component: 'modals-edit-tabs-match' } + // { + // id: 'authors', + // title: 'Authors', + // component: 'modals-edit-tabs-authors' + // } ] } }, @@ -130,8 +135,8 @@ export default { if (!this.userCanUpdate && !this.userCanDownload) return [] return this.tabs.filter((tab) => { if (tab.id === 'download' && this.isMissing) return false - if ((tab.id === 'download' || tab.id === 'tracks') && this.userCanDownload) return true - if (tab.id !== 'download' && tab.id !== 'tracks' && this.userCanUpdate) return true + if ((tab.id === 'download' || tab.id === 'files' || tab.id === 'authors') && this.userCanDownload) return true + if (tab.id !== 'download' && tab.id !== 'files' && tab.id !== 'authors' && this.userCanUpdate) return true if (tab.id === 'match' && this.userCanUpdate && this.showExperimentalFeatures) return true return false }) diff --git a/client/components/modals/edit-tabs/Authors.vue b/client/components/modals/edit-tabs/Authors.vue new file mode 100644 index 00000000..3dafa049 --- /dev/null +++ b/client/components/modals/edit-tabs/Authors.vue @@ -0,0 +1,201 @@ + + + + + \ No newline at end of file diff --git a/client/components/modals/edit-tabs/Files.vue b/client/components/modals/edit-tabs/Files.vue index 39393cff..3897b4c1 100644 --- a/client/components/modals/edit-tabs/Files.vue +++ b/client/components/modals/edit-tabs/Files.vue @@ -1,5 +1,48 @@ @@ -13,9 +56,60 @@ export default { } }, data() { - return {} + return { + tracks: null, + showFullPath: false + } }, - computed: {}, - methods: {} + watch: { + audiobook: { + immediate: true, + handler(newVal) { + if (newVal) this.init() + } + } + }, + computed: { + audiobookPath() { + return this.audiobook.path + }, + tracksCleaned() { + return this.tracks.map((track) => { + var trackPath = track.path.replace(/\\/g, '/') + var audiobookPath = this.audiobookPath.replace(/\\/g, '/') + + return { + ...track, + relativePath: trackPath + .replace(audiobookPath + '/', '') + .replace(/%/g, '%25') + .replace(/#/g, '%23') + } + }) + }, + userToken() { + return this.$store.getters['user/getToken'] + }, + userCanUpdate() { + return this.$store.getters['user/getUserCanUpdate'] + }, + userCanDownload() { + return this.$store.getters['user/getUserCanDownload'] + }, + isMissing() { + return this.audiobook.isMissing + }, + showDownload() { + return this.userCanDownload && !this.isMissing + }, + hasTracks() { + return this.audiobook.tracks.length + } + }, + methods: { + init() { + this.tracks = this.audiobook.tracks + } + } } \ No newline at end of file diff --git a/client/components/tables/AllFilesTable.vue b/client/components/tables/AllFilesTable.vue index 7071aa40..bb47abd3 100644 --- a/client/components/tables/AllFilesTable.vue +++ b/client/components/tables/AllFilesTable.vue @@ -1,7 +1,7 @@