Navigation Menu

Skip to content

Commit

Permalink
feat: 1st torrent progress in title #166
Browse files Browse the repository at this point in the history
  • Loading branch information
WDaan committed Feb 28, 2021
1 parent 354fe4f commit 5faa248
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
@@ -1,6 +1,6 @@
import { formatBytes } from '@/helpers'

export class setDocumentTitle {
export class DocumentTitle {
static setDefault() {
this.set('VueTorrent')
}
Expand All @@ -12,7 +12,7 @@ export class setDocumentTitle {

static setFirstTorrentStatus(torrent) {
if (!torrent) return
this.set(`${torrent.state.toLowerCase()} - ${torrent.progress}% - ${torrent.name}`)
this.set(`[D: ${formatBytes(torrent.dlspeed)}/s, U: ${formatBytes(torrent.upspeed)}/s] ${torrent.progress}%`)
}

static updateTitle(mode, speeds, torrent) {
Expand Down
4 changes: 2 additions & 2 deletions src/actions/index.js
@@ -1,5 +1,5 @@
import { setDocumentTitle } from './setDocumentTitle'
import { DocumentTitle } from './DocumentTitle'

export {
setDocumentTitle
DocumentTitle
}
4 changes: 2 additions & 2 deletions src/store/mutations.js
Expand Up @@ -2,7 +2,7 @@ import Torrent from '../models/Torrent'
import Status from '../models/Status'
import qbit from '../services/qbit'
import { getHostName } from '@/helpers'
import { setDocumentTitle } from '@/actions'
import { DocumentTitle } from '@/actions'

export default {
SET_APP_VERSION(state, version) {
Expand Down Expand Up @@ -84,7 +84,7 @@ export default {
state.torrents = data.map(t => new Torrent(t))

// update document title
setDocumentTitle.updateTitle(
DocumentTitle.updateTitle(
state.webuiSettings.title,
[state.status.dlspeed, state.status.upspeed],
state.torrents ? state.torrents[0] : null
Expand Down

0 comments on commit 5faa248

Please sign in to comment.