Skip to content

Commit

Permalink
feat: show created by info #279
Browse files Browse the repository at this point in the history
  • Loading branch information
WDaan committed Aug 14, 2021
1 parent a18bded commit 7a7562e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion src/components/Modals/TorrentDetailModal/Tabs/Info.vue
Expand Up @@ -134,6 +134,14 @@
{{ torrent.tracker }}
</td>
</tr>
<tr v-if="createdBy">
<td :class="commonStyle">
Created By
</td>
<td>
{{ createdBy }}
</td>
</tr>
<tr v-if="torrent.comment">
<td :class="commonStyle">
Comments
Expand Down Expand Up @@ -213,6 +221,8 @@
<script>
import { mapGetters } from 'vuex'
import { FullScreenModal } from '@/mixins'
import qbit from '@/services/qbit'
export default {
name: 'Info',
mixins: [FullScreenModal],
Expand All @@ -221,14 +231,24 @@ export default {
},
data() {
return {
commonStyle: 'caption'
commonStyle: 'caption',
createdBy: null
}
},
computed: {
...mapGetters(['getTorrent']),
torrent() {
return this.getTorrent(this.hash)
}
},
mounted() {
this.getTorrentProperties()
},
methods: {
async getTorrentProperties() {
const props = await qbit.getTorrentProperties(this.hash)
this.createdBy = props.created_by || null
}
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/services/qbit.js
Expand Up @@ -145,7 +145,7 @@ class Qbit {
getTorrentProperties(hash) {
return this.axios.get('/torrents/properties', {
params: { hash }
})
}).then(res => res.data)
}

// Post
Expand Down

0 comments on commit 7a7562e

Please sign in to comment.