Use IndexedDB for storage
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
359b01950c
commit
3c9b817674
|
@ -9,6 +9,7 @@
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
|
"indexeddb-chunk-store": "^2.2.1",
|
||||||
"mitt": "^2.1.0",
|
"mitt": "^2.1.0",
|
||||||
"pretty-bytes": "^5.5.0",
|
"pretty-bytes": "^5.5.0",
|
||||||
"pretty-ms": "^7.0.1",
|
"pretty-ms": "^7.0.1",
|
||||||
|
@ -8666,6 +8667,15 @@
|
||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/idb-kv-store": {
|
||||||
|
"version": "4.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/idb-kv-store/-/idb-kv-store-4.5.0.tgz",
|
||||||
|
"integrity": "sha512-snvtAQRforYUI+C2+45L2LBJy/0/uQUffxv8/uwiS98fSUoXHVrFPClgzWZWxT0drwkLHJRm9inZcYzTR42GLA==",
|
||||||
|
"dependencies": {
|
||||||
|
"inherits": "^2.0.3",
|
||||||
|
"promisize": "^1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ieee754": {
|
"node_modules/ieee754": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||||
|
@ -8851,6 +8861,14 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/indexeddb-chunk-store": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/indexeddb-chunk-store/-/indexeddb-chunk-store-2.2.1.tgz",
|
||||||
|
"integrity": "sha1-+P7j8aztkWUADhl9K+dT8a31EHo=",
|
||||||
|
"dependencies": {
|
||||||
|
"idb-kv-store": "^4.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/indexes-of": {
|
"node_modules/indexes-of": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz",
|
||||||
|
@ -13034,6 +13052,11 @@
|
||||||
"integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
|
"integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/promisize": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/promisize/-/promisize-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-m0fiyyrkl+seutwsQZHWTRXJSdE="
|
||||||
|
},
|
||||||
"node_modules/proxy-addr": {
|
"node_modules/proxy-addr": {
|
||||||
"version": "2.0.6",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
|
||||||
|
@ -25268,6 +25291,15 @@
|
||||||
"postcss": "^7.0.14"
|
"postcss": "^7.0.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"idb-kv-store": {
|
||||||
|
"version": "4.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/idb-kv-store/-/idb-kv-store-4.5.0.tgz",
|
||||||
|
"integrity": "sha512-snvtAQRforYUI+C2+45L2LBJy/0/uQUffxv8/uwiS98fSUoXHVrFPClgzWZWxT0drwkLHJRm9inZcYzTR42GLA==",
|
||||||
|
"requires": {
|
||||||
|
"inherits": "^2.0.3",
|
||||||
|
"promisize": "^1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ieee754": {
|
"ieee754": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||||
|
@ -25388,6 +25420,14 @@
|
||||||
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
|
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"indexeddb-chunk-store": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/indexeddb-chunk-store/-/indexeddb-chunk-store-2.2.1.tgz",
|
||||||
|
"integrity": "sha1-+P7j8aztkWUADhl9K+dT8a31EHo=",
|
||||||
|
"requires": {
|
||||||
|
"idb-kv-store": "^4.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"indexes-of": {
|
"indexes-of": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz",
|
||||||
|
@ -28719,6 +28759,11 @@
|
||||||
"integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
|
"integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"promisize": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/promisize/-/promisize-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-m0fiyyrkl+seutwsQZHWTRXJSdE="
|
||||||
|
},
|
||||||
"proxy-addr": {
|
"proxy-addr": {
|
||||||
"version": "2.0.6",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
|
"indexeddb-chunk-store": "^2.2.1",
|
||||||
"mitt": "^2.1.0",
|
"mitt": "^2.1.0",
|
||||||
"pretty-bytes": "^5.5.0",
|
"pretty-bytes": "^5.5.0",
|
||||||
"pretty-ms": "^7.0.1",
|
"pretty-ms": "^7.0.1",
|
||||||
|
|
|
@ -56,9 +56,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { computed, inject, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
import { computed, inject, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||||
import { useToast } from 'primevue/usetoast'
|
import { useToast } from 'primevue/usetoast'
|
||||||
|
import WebTorrent from 'webtorrent/webtorrent.min.js'
|
||||||
|
import IndexedDBChunkStore from 'indexeddb-chunk-store'
|
||||||
import prettyBytes from 'pretty-bytes'
|
import prettyBytes from 'pretty-bytes'
|
||||||
import prettyMilliseconds from 'pretty-ms'
|
import prettyMilliseconds from 'pretty-ms'
|
||||||
import WebTorrent from 'webtorrent/webtorrent.min.js'
|
|
||||||
import updateWireStatistics from '@/helpers/wire-statistics'
|
import updateWireStatistics from '@/helpers/wire-statistics'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -153,7 +154,7 @@ export default {
|
||||||
|
|
||||||
// Utility functions.
|
// Utility functions.
|
||||||
const seedFile = (file) => {
|
const seedFile = (file) => {
|
||||||
webTorrent.seed(file, { announce: trackers }, torrent => {
|
webTorrent.seed(file, { announce: trackers, store: IndexedDBChunkStore }, torrent => {
|
||||||
torrent.on('error', () => {})
|
torrent.on('error', () => {})
|
||||||
torrent.on('warning', () => {})
|
torrent.on('warning', () => {})
|
||||||
torrent.on('wire', wire => {
|
torrent.on('wire', wire => {
|
||||||
|
|
|
@ -68,6 +68,7 @@ import { computed, inject, onBeforeMount, onBeforeUnmount, onMounted, reactive,
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { useToast } from 'primevue/usetoast'
|
import { useToast } from 'primevue/usetoast'
|
||||||
import WebTorrent from 'webtorrent/webtorrent.min.js'
|
import WebTorrent from 'webtorrent/webtorrent.min.js'
|
||||||
|
import IndexedDBChunkStore from 'indexeddb-chunk-store'
|
||||||
import prettyBytes from 'pretty-bytes'
|
import prettyBytes from 'pretty-bytes'
|
||||||
import prettyMilliseconds from 'pretty-ms'
|
import prettyMilliseconds from 'pretty-ms'
|
||||||
import updateWireStatistics from '@/helpers/wire-statistics'
|
import updateWireStatistics from '@/helpers/wire-statistics'
|
||||||
|
@ -158,7 +159,7 @@ export default {
|
||||||
|
|
||||||
// Utility functions.
|
// Utility functions.
|
||||||
const downloadVideo = (infoHash) => {
|
const downloadVideo = (infoHash) => {
|
||||||
webTorrent.add(infoHash, { announce: trackers }, torrent => {
|
webTorrent.add(infoHash, { announce: trackers, store: IndexedDBChunkStore }, torrent => {
|
||||||
torrent.on('error', () => {})
|
torrent.on('error', () => {})
|
||||||
torrent.on('warning', () => {})
|
torrent.on('warning', () => {})
|
||||||
torrent.on('wire', () => {
|
torrent.on('wire', () => {
|
||||||
|
|
Loading…
Reference in New Issue