Skip to content

Commit

Permalink
feat(media proxy): check if user is premium
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jan 6, 2023
1 parent 1e47868 commit 867519d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/pages/posts/post/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
computed: {
...mapGetters('user', ['getUserSettings']),
...mapGetters('booru', ['getActiveBooru']),
...mapGetters('premium', ['isUserPremium']),
isImage() {
return this.post.data.media_type === 'image'
Expand Down Expand Up @@ -498,7 +499,7 @@
}
// Proxy URL
else if (!this.media.retryLogic.tried.proxy) {
else if (this.isUserPremium && !this.media.retryLogic.tried.proxy) {
console.info('Proxying media...')
event.target.src = ProxyHelper.proxyUrl(this.mediaFile[0].url)
Expand All @@ -513,7 +514,7 @@
}
// Proxy URL with extra slash
else if (!this.media.retryLogic.tried.proxyWithExtraSlash) {
else if (this.isUserPremium && !this.media.retryLogic.tried.proxyWithExtraSlash) {
console.info('Proxying media with extra slash...')
event.target.src = ProxyHelper.proxyUrl(
Expand Down

0 comments on commit 867519d

Please sign in to comment.