From 161c6db99163cbc34ed711b9c7e163b78514a793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Midb=C3=B8e?= Date: Mon, 13 Aug 2018 00:20:30 +0200 Subject: [PATCH] When adding a magnet, additional information name and tmdb id is also sent in request body. --- src/components/Movie.vue | 2 +- src/components/TorrentList.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Movie.vue b/src/components/Movie.vue index 752950c..fc7228d 100644 --- a/src/components/Movie.vue +++ b/src/components/Movie.vue @@ -99,7 +99,7 @@

torrents: {{ movie.title }}

- +
diff --git a/src/components/TorrentList.vue b/src/components/TorrentList.vue index cd0a98a..b5d52fc 100644 --- a/src/components/TorrentList.vue +++ b/src/components/TorrentList.vue @@ -23,7 +23,7 @@ {{ row.seed }} {{ row.size }} - + @@ -48,7 +48,7 @@ import storage from '../storage.js' let tablet = window.innerWidth < 768 ? true : false; export default { - props: ['query'], + props: ['query', 'tmdb_id', 'tmdb_type'], beforeRouteLeave (to, from, next) { if(from.name == 'search'){ eventHub.$emit('setSearchQuery', true); @@ -85,9 +85,9 @@ export default { this.listLoaded = true; }); }, - sendTorrent(magnet){ + sendTorrent(magnet, name){ axios.post(`https://api.kevinmidboe.com/api/v1/pirate/add`, { - magnet: magnet }, { headers: {authorization: storage.token} + magnet: magnet, name: name, tmdb_id: this.tmdb_id, type: this.tmdb_type }, { headers: {authorization: storage.token} }) .catch((resp) => { console.log('error:', resp.data) }) .then((resp) => { console.log('addTorrent resp: ', resp) })