diff --git a/android/app/build.gradle b/android/app/build.gradle index 2d364b1e..c95fe6b1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.audiobookshelf.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 6 - versionName "0.2.2-beta" + versionCode 7 + versionName "0.3.0-beta" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/components/modals/FilterModal.vue b/components/modals/FilterModal.vue index ef0031e4..da2b2a15 100644 --- a/components/modals/FilterModal.vue +++ b/components/modals/FilterModal.vue @@ -31,13 +31,13 @@
  • - No {{ sublist }} + No {{ sublist }} items
  • @@ -75,6 +75,11 @@ export default { text: 'Series', value: 'series', sublist: true + }, + { + text: 'Authors', + value: 'authors', + sublist: true } ] } @@ -108,7 +113,7 @@ export default { return this.selected && this.selected.includes('.') ? this.selected.split('.')[0] : false }, genres() { - return this.$store.state.audiobooks.genres + return this.$store.getters['audiobooks/getGenresUsed'] }, tags() { return this.$store.state.audiobooks.tags @@ -116,8 +121,16 @@ export default { series() { return this.$store.state.audiobooks.series }, + authors() { + return this.$store.getters['audiobooks/getUniqueAuthors'] + }, sublistItems() { - return this[this.sublist] || [] + return (this[this.sublist] || []).map((item) => { + return { + text: item, + value: this.$encode(item) + } + }) } }, methods: { @@ -126,15 +139,6 @@ export default { this.show = false this.$nextTick(() => this.$emit('change', 'all')) }, - snakeToNormal(kebab) { - if (!kebab) { - return 'err' - } - return String(kebab) - .split('_') - .map((t) => t.slice(0, 1).toUpperCase() + t.slice(1)) - .join(' ') - }, clickedSublistOption(item) { this.clickedOption({ value: `${this.sublist}.${item}` }) }, diff --git a/components/modals/SearchModal.vue b/components/modals/SearchModal.vue new file mode 100644 index 00000000..3ed2efb9 --- /dev/null +++ b/components/modals/SearchModal.vue @@ -0,0 +1,100 @@ + + + \ No newline at end of file diff --git a/components/ui/TextInput.vue b/components/ui/TextInput.vue index bfa7b215..d86bf121 100644 --- a/components/ui/TextInput.vue +++ b/components/ui/TextInput.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/layouts/default.vue b/layouts/default.vue index 47a41980..dceeecc2 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -67,11 +67,11 @@ export default { } this.$store.commit('setAppUpdateInfo', result) - if (result.updateAvailability === 2) { - setTimeout(() => { - this.showUpdateToast(result.availableVersion, !!result.immediateUpdateAllowed) - }, 5000) - } + // if (result.updateAvailability === 2) { + // setTimeout(() => { + // this.showUpdateToast(result.availableVersion, !!result.immediateUpdateAllowed) + // }, 5000) + // } } // parseSemver(ver) { // if (!ver) return null diff --git a/package.json b/package.json index 5a5c00c0..c3c5bd1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-app", - "version": "v0.2.2-beta", + "version": "v0.3.0-beta", "author": "advplyr", "scripts": { "dev": "nuxt --hostname localhost --port 1337", diff --git a/pages/account.vue b/pages/account.vue index 82fbbe58..d680e749 100644 --- a/pages/account.vue +++ b/pages/account.vue @@ -22,7 +22,7 @@

    {{ $config.version }}

    - Version {{ availableVersion }} is available! {{ immediateUpdateAllowed ? 'Update now' : 'Get update from app store' }} + Version {{ availableVersion }} is available! Open App Store @@ -68,11 +68,7 @@ export default { this.$router.push('/connect') }, async clickUpdate() { - if (this.immediateUpdateAllowed) { - await AppUpdate.performImmediateUpdate() - } else { - await AppUpdate.openAppStore() - } + await AppUpdate.openAppStore() } }, mounted() {} diff --git a/pages/index.vue b/pages/index.vue index be736e21..6774366f 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -2,7 +2,9 @@
    + search

    {{ numAudiobooks }} Audiobooks

    +
    filter_alt sort @@ -12,6 +14,7 @@ +
    @@ -21,6 +24,7 @@ export default { return { showSortModal: false, showFilterModal: false, + showSearchModal: false, settings: {} } }, diff --git a/plugins/init.client.js b/plugins/init.client.js index 3161b7e1..5d703eae 100644 --- a/plugins/init.client.js +++ b/plugins/init.client.js @@ -38,7 +38,6 @@ Vue.prototype.$secondsToTimestamp = (seconds) => { return `${_hours}:${_minutes.toString().padStart(2, '0')}:${_seconds.toString().padStart(2, '0')}` } - function isClickedOutsideEl(clickEvent, elToCheckOutside, ignoreSelectors = [], ignoreElems = []) { const isDOMElement = (element) => { return element instanceof Element || element instanceof HTMLDocument @@ -74,4 +73,14 @@ Vue.directive('click-outside', { document.removeEventListener('click', el['__click_outside__'], false) delete el['__click_outside__'] } -}) \ No newline at end of file +}) + +const encode = (text) => encodeURIComponent(Buffer.from(text).toString('base64')) +Vue.prototype.$encode = encode +const decode = (text) => Buffer.from(decodeURIComponent(text), 'base64').toString() +Vue.prototype.$decode = decode + +export { + encode, + decode +} \ No newline at end of file diff --git a/store/audiobooks.js b/store/audiobooks.js index d8103cff..5bec9894 100644 --- a/store/audiobooks.js +++ b/store/audiobooks.js @@ -1,4 +1,5 @@ import { sort } from '@/assets/fastSort' +import { decode } from '@/plugins/init.client' const STANDARD_GENRES = ['adventure', 'autobiography', 'biography', 'childrens', 'comedy', 'crime', 'dystopian', 'fantasy', 'fiction', 'health', 'history', 'horror', 'mystery', 'new_adult', 'nonfiction', 'philosophy', 'politics', 'religion', 'romance', 'sci-fi', 'self-help', 'short_story', 'technology', 'thriller', 'true_crime', 'western', 'young_adult'] @@ -19,7 +20,7 @@ export const getters = { var searchGroups = ['genres', 'tags', 'series', 'authors'] var group = searchGroups.find(_group => filterBy.startsWith(_group + '.')) if (group) { - var filter = filterBy.replace(`${group}.`, '') + var filter = decode(filterBy.replace(`${group}.`, '')) if (group === 'genres') filtered = filtered.filter(ab => ab.book && ab.book.genres.includes(filter)) else if (group === 'tags') filtered = filtered.filter(ab => ab.tags.includes(filter)) else if (group === 'series') filtered = filtered.filter(ab => ab.book && ab.book.series === filter) @@ -40,6 +41,11 @@ export const getters = { getUniqueAuthors: (state) => { var _authors = state.audiobooks.filter(ab => !!(ab.book && ab.book.author)).map(ab => ab.book.author) return [...new Set(_authors)] + }, + getGenresUsed: (state) => { + var _genres = [] + state.audiobooks.filter(ab => !!(ab.book && ab.book.genres)).forEach(ab => _genres = _genres.concat(ab.book.genres)) + return [...new Set(_genres)].sort((a, b) => a.toLowerCase() < b.toLowerCase() ? -1 : 1) } }