From 645bcc53c689604efdf33c782855bc8b42f89bce Mon Sep 17 00:00:00 2001 From: MediaCowboy Date: Tue, 26 Apr 2022 21:28:24 -0500 Subject: [PATCH 01/18] Update readme.md Removed the --rm from the docker install command and added Docker Update section --- readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index c567a393..8f4a204f 100644 --- a/readme.md +++ b/readme.md @@ -74,7 +74,15 @@ docker run -d \ -v :/config \ -v :/metadata \ --name audiobookshelf \ - --rm ghcr.io/advplyr/audiobookshelf + ghcr.io/advplyr/audiobookshelf +``` + +### Docker Update + +```bash +docker stop audiobookshelf +docker pull advplyr/audiobookshelf +docker start audiobookshelf ``` ### Running with Docker Compose From adfe50a84104f24dc2fef4a662981d449d7e734d Mon Sep 17 00:00:00 2001 From: MediaCowboy Date: Wed, 27 Apr 2022 22:26:44 -0500 Subject: [PATCH 02/18] Update readme.md Updated the pull command to reflect the new docker repo. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 8f4a204f..f92508cd 100644 --- a/readme.md +++ b/readme.md @@ -81,7 +81,7 @@ docker run -d \ ```bash docker stop audiobookshelf -docker pull advplyr/audiobookshelf +docker pull ghcr.io/advplyr/audiobookshelf docker start audiobookshelf ``` From e220b2818a3baadd96b69de7ad89fcc80d23aed9 Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 28 Apr 2022 18:40:29 -0500 Subject: [PATCH 03/18] Add docker-build workflow --- .github/workflows/docker-build.yml | 62 ++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..10c8f719 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,62 @@ +--- + +name: Build and Push Docker Image + +on: + push: + branches: [master] + tags: + - 'v*.*.*' + # Only build when files in these directories have been changed + paths: + - client/** + - server/** + release: + types: [published, edited] + # Allows you to run workflow manually from Actions tab + workflow_dispatch: + +jobs: + build: + if: "!contains(github.event.head_commit.message, 'skip ci')" + runs-on: ubuntu-20.04 + + steps: + - name: Check out + uses: actions/checkout@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: advplyr/audiobookshelf,ghcr.io/${{ github.repository_owner }}/audiobookshelf + tags: | + type=edge,branch=master + type=semver,pattern={{version}} + + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Dockerhub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to ghcr + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GHCR_PASSWORD }} + + - name: Build image + uses: docker/build-push-action@v2 + with: + tags: ${{ steps.meta.outputs.tags }} + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true From 2a919012b679caee5047bb4374b11704a4070211 Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 28 Apr 2022 18:43:00 -0500 Subject: [PATCH 04/18] Version bump 2.0.4 --- client/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/package.json b/client/package.json index 76ff1905..6cd3b9e1 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "2.0.3", + "version": "2.0.4", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/package.json b/package.json index 567edb57..eeb93a8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "2.0.3", + "version": "2.0.4", "description": "Self-hosted audiobook server for managing and playing audiobooks", "main": "index.js", "scripts": { From 8942dca31da4f04eb8018c65d5826b1bab000db2 Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 29 Apr 2022 09:48:00 -0500 Subject: [PATCH 05/18] Update docker-build workflow --- .github/workflows/docker-build.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 10c8f719..4c08d612 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -11,6 +11,8 @@ on: paths: - client/** - server/** + - index.js + - package.json release: types: [published, edited] # Allows you to run workflow manually from Actions tab @@ -29,16 +31,23 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: advplyr/audiobookshelf,ghcr.io/${{ github.repository_owner }}/audiobookshelf + images: advplyr/audiobookshelf-dev,ghcr.io/${{ github.repository_owner }}/audiobookshelf-dev tags: | type=edge,branch=master type=semver,pattern={{version}} - - name: Setup QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- - name: Login to Dockerhub uses: docker/login-action@v1 @@ -60,3 +69,10 @@ jobs: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache From 1a230019552d06a1eb5f066f05548948851e5cfb Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 29 Apr 2022 12:20:51 -0500 Subject: [PATCH 06/18] Update version check to use releases from gh api instead of tags, add 5 minute buffer between checking for new releases --- client/layouts/default.vue | 31 ++++++++++++++++++++----------- client/plugins/version.js | 12 +++++++----- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/client/layouts/default.vue b/client/layouts/default.vue index 388cec16..96f16840 100644 --- a/client/layouts/default.vue +++ b/client/layouts/default.vue @@ -485,6 +485,25 @@ export default { }, resize() { this.$store.commit('globals/updateWindowSize', { width: window.innerWidth, height: window.innerHeight }) + }, + checkVersionUpdate() { + // Version check is only run if time since last check was 5 minutes + const VERSION_CHECK_BUFF = 1000 * 60 * 5 // 5 minutes + var lastVerCheck = localStorage.getItem('lastVerCheck') || 0 + if (Date.now() - Number(lastVerCheck) > VERSION_CHECK_BUFF) { + this.$store + .dispatch('checkForUpdate') + .then((res) => { + localStorage.setItem('lastVerCheck', Date.now()) + if (res && res.hasUpdate) this.showUpdateToast(res) + }) + .catch((err) => console.error(err)) + + if (this.$route.query.error) { + this.$toast.error(this.$route.query.error) + this.$router.replace(this.$route.path) + } + } } }, beforeMount() { @@ -503,17 +522,7 @@ export default { this.$store.commit('setExperimentalFeatures', true) } - this.$store - .dispatch('checkForUpdate') - .then((res) => { - if (res && res.hasUpdate) this.showUpdateToast(res) - }) - .catch((err) => console.error(err)) - - if (this.$route.query.error) { - this.$toast.error(this.$route.query.error) - this.$router.replace(this.$route.path) - } + this.checkVersionUpdate() }, beforeDestroy() { window.removeEventListener('resize', this.resize) diff --git a/client/plugins/version.js b/client/plugins/version.js index d09b7afc..225c5bff 100644 --- a/client/plugins/version.js +++ b/client/plugins/version.js @@ -33,11 +33,12 @@ export async function checkForUpdate() { return } var largestVer = null - await axios.get(`https://api.github.com/repos/advplyr/audiobookshelf/tags`).then((res) => { - var tags = res.data - if (tags && tags.length) { - tags.forEach((tag) => { - var verObj = parseSemver(tag.name) + await axios.get(`https://api.github.com/repos/advplyr/audiobookshelf/releases`).then((res) => { + var releases = res.data + if (releases && releases.length) { + releases.forEach((release) => { + var tagName = release.tag_name + var verObj = parseSemver(tagName) if (verObj) { if (!largestVer || largestVer.total < verObj.total) { largestVer = verObj @@ -50,6 +51,7 @@ export async function checkForUpdate() { console.error('No valid version tags to compare with') return } + return { hasUpdate: largestVer.total > currVerObj.total, latestVersion: largestVer.version, From a467637cb5749e83796738e54cc1510a7f954b9a Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 29 Apr 2022 12:59:35 -0500 Subject: [PATCH 07/18] Version bump v2.0.5 --- client/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/package.json b/client/package.json index 6cd3b9e1..a4f8d00d 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "2.0.4", + "version": "2.0.5", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/package.json b/package.json index eeb93a8c..7b555b14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "2.0.4", + "version": "2.0.5", "description": "Self-hosted audiobook server for managing and playing audiobooks", "main": "index.js", "scripts": { From 5cca2d0155623b113aa5a7a4163d77246d4c5b30 Mon Sep 17 00:00:00 2001 From: advplyr <67830747+advplyr@users.noreply.github.com> Date: Fri, 29 Apr 2022 13:01:12 -0500 Subject: [PATCH 08/18] Update docker-build.yml --- .github/workflows/docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 4c08d612..7a96afe0 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -31,7 +31,7 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: advplyr/audiobookshelf-dev,ghcr.io/${{ github.repository_owner }}/audiobookshelf-dev + images: advplyr/audiobookshelf,ghcr.io/${{ github.repository_owner }}/audiobookshelf tags: | type=edge,branch=master type=semver,pattern={{version}} From 3a2594cde9f6d2e27dc2c413621f6225c233d72f Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 29 Apr 2022 13:13:54 -0500 Subject: [PATCH 09/18] Version bump v2.0.6 --- client/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/package.json b/client/package.json index a4f8d00d..6da7f859 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "2.0.5", + "version": "2.0.6", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/package.json b/package.json index 7b555b14..9f3af81f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "2.0.5", + "version": "2.0.6", "description": "Self-hosted audiobook server for managing and playing audiobooks", "main": "index.js", "scripts": { From 8abda14e0f067d0d160a108bd095d21ec40434b4 Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 29 Apr 2022 13:16:29 -0500 Subject: [PATCH 10/18] Version bump v2.0.7 --- client/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/package.json b/client/package.json index 6da7f859..b60329a2 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "2.0.6", + "version": "2.0.7", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/package.json b/package.json index 9f3af81f..64eaf8b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "2.0.6", + "version": "2.0.7", "description": "Self-hosted audiobook server for managing and playing audiobooks", "main": "index.js", "scripts": { From 4185807da44705681b2dc4f8a9ab7bb8a8cbaef6 Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 29 Apr 2022 16:42:40 -0500 Subject: [PATCH 11/18] Add:Check for new episodes manual check and update last check time, Update:Adding new podcasts and downloading podcast episodes restricted to admin users --- client/components/app/SideRail.vue | 5 +- .../components/modals/item/tabs/Episodes.vue | 47 ++++++++++++++++--- client/pages/item/_id/index.vue | 6 ++- client/store/user.js | 1 + server/controllers/PodcastController.js | 2 +- server/managers/PodcastManager.js | 23 ++++++++- server/objects/settings/ServerSettings.js | 2 +- server/objects/user/User.js | 3 ++ 8 files changed, 76 insertions(+), 13 deletions(-) diff --git a/client/components/app/SideRail.vue b/client/components/app/SideRail.vue index 38d0d36d..73cf3a11 100644 --- a/client/components/app/SideRail.vue +++ b/client/components/app/SideRail.vue @@ -52,7 +52,7 @@
- +

Search

@@ -82,6 +82,9 @@ export default { showExperimentalFeatures() { return this.$store.state.showExperimentalFeatures }, + userIsAdminOrUp() { + return this.$store.getters['user/getIsAdminOrUp'] + }, paramId() { return this.$route.params ? this.$route.params.id || '' : '' }, diff --git a/client/components/modals/item/tabs/Episodes.vue b/client/components/modals/item/tabs/Episodes.vue index 38f7a532..c4f6723f 100644 --- a/client/components/modals/item/tabs/Episodes.vue +++ b/client/components/modals/item/tabs/Episodes.vue @@ -1,11 +1,11 @@