mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-03-14 12:10:18 +03:00
fix: capitalization #740
This commit is contained in:
parent
1f774ee9ae
commit
54b4f578d1
9 changed files with 67 additions and 100 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -2,17 +2,16 @@
|
|||
|
||||
## [1.5.2](https://github.com/WDaan/VueTorrent/compare/v1.5.1...v1.5.2) (2023-03-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Missing state filters ([#718](https://github.com/WDaan/VueTorrent/issues/718)) ([74cfeca](https://github.com/WDaan/VueTorrent/commit/74cfecace0a46abc4fbe843b15131ce85e8fbb79))
|
||||
* state glitching [#724](https://github.com/WDaan/VueTorrent/issues/724) ([260c1c6](https://github.com/WDaan/VueTorrent/commit/260c1c6960dcd7e505e8643db9f362b0acc3cbc7))
|
||||
* translation of properties ([3e95230](https://github.com/WDaan/VueTorrent/commit/3e95230ae822673d6340874518e7557e0e20bf52))
|
||||
|
||||
- Missing state filters ([#718](https://github.com/WDaan/VueTorrent/issues/718)) ([74cfeca](https://github.com/WDaan/VueTorrent/commit/74cfecace0a46abc4fbe843b15131ce85e8fbb79))
|
||||
- state glitching [#724](https://github.com/WDaan/VueTorrent/issues/724) ([260c1c6](https://github.com/WDaan/VueTorrent/commit/260c1c6960dcd7e505e8643db9f362b0acc3cbc7))
|
||||
- translation of properties ([3e95230](https://github.com/WDaan/VueTorrent/commit/3e95230ae822673d6340874518e7557e0e20bf52))
|
||||
|
||||
### Improvements
|
||||
|
||||
* Progress component sizing on Desktop ([#720](https://github.com/WDaan/VueTorrent/issues/720)) ([c991417](https://github.com/WDaan/VueTorrent/commit/c9914172b55ac1f3e1cdf89a01caec2666f153e3))
|
||||
- Progress component sizing on Desktop ([#720](https://github.com/WDaan/VueTorrent/issues/720))
|
||||
([c991417](https://github.com/WDaan/VueTorrent/commit/c9914172b55ac1f3e1cdf89a01caec2666f153e3))
|
||||
|
||||
## [1.5.1](https://github.com/WDaan/VueTorrent/compare/v1.5.0...v1.5.1) (2023-03-19)
|
||||
|
||||
|
|
|
@ -87,32 +87,14 @@
|
|||
<v-row no-gutters class="flex-gap">
|
||||
<v-col>
|
||||
<div class="d-flex flex-column align-center">
|
||||
<p class="subtitle-1 mb-1">{{ $t('enums.contentLayout.title') }}</p>
|
||||
<v-select
|
||||
v-model="contentLayout"
|
||||
flat
|
||||
solo
|
||||
dense
|
||||
hide-details
|
||||
background-color="background"
|
||||
class="rounded-xl"
|
||||
:items="contentLayoutOptions"
|
||||
/>
|
||||
<p class="subtitle-1 mb-1">{{ $t('enums.contentLayout.title') }}</p>
|
||||
<v-select v-model="contentLayout" flat solo dense hide-details background-color="background" class="rounded-xl" :items="contentLayoutOptions" />
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<div class="d-flex flex-column align-center">
|
||||
<p class="subtitle-1 mb-1">{{ $t('enums.stopCondition.title') }}</p>
|
||||
<v-select
|
||||
v-model="stopCondition"
|
||||
flat
|
||||
solo
|
||||
dense
|
||||
hide-details
|
||||
background-color="background"
|
||||
class="rounded-xl"
|
||||
:items="stopConditionOptions"
|
||||
/>
|
||||
<v-select v-model="stopCondition" flat solo dense hide-details background-color="background" class="rounded-xl" :items="stopConditionOptions" />
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
|
|
@ -40,7 +40,7 @@ export default defineComponent({
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
matchingArticles: [] as { type: string, value?: string }[],
|
||||
matchingArticles: [] as { type: string; value?: string }[],
|
||||
mdiClose
|
||||
}
|
||||
},
|
||||
|
@ -53,14 +53,13 @@ export default defineComponent({
|
|||
const articles = await qbit.getMatchingArticles(this.ruleName)
|
||||
for (const feedName in articles) {
|
||||
const feedArticles = articles[feedName]
|
||||
if (this.matchingArticles.length > 0)
|
||||
this.matchingArticles.push({ type: 'divider' })
|
||||
if (this.matchingArticles.length > 0) this.matchingArticles.push({ type: 'divider' })
|
||||
|
||||
this.matchingArticles.push({type: 'subheader', value: feedName})
|
||||
this.matchingArticles.push({ type: 'subheader', value: feedName })
|
||||
|
||||
for (const i in feedArticles) {
|
||||
const article = feedArticles[i]
|
||||
this.matchingArticles.push({type: 'item', value: article})
|
||||
this.matchingArticles.push({ type: 'item', value: article })
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -41,31 +41,13 @@
|
|||
<v-col>
|
||||
<div class="d-flex flex-column align-center">
|
||||
<p class="subtitle-1 mb-1">{{ $t('modals.newRule.def.addPaused.title') }}</p>
|
||||
<v-select
|
||||
v-model="rule.addPaused"
|
||||
flat
|
||||
solo
|
||||
dense
|
||||
hide-details
|
||||
background-color="background"
|
||||
class="rounded-xl"
|
||||
:items="addPausedOptions"
|
||||
/>
|
||||
<v-select v-model="rule.addPaused" flat solo dense hide-details background-color="background" class="rounded-xl" :items="addPausedOptions" />
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<div class="d-flex flex-column align-center">
|
||||
<p class="subtitle-1 mb-1">{{ $t('enums.contentLayout.title') }}</p>
|
||||
<v-select
|
||||
v-model="rule.torrentContentLayout"
|
||||
flat
|
||||
solo
|
||||
dense
|
||||
hide-details
|
||||
background-color="background"
|
||||
class="rounded-xl"
|
||||
:items="contentLayoutOptions"
|
||||
/>
|
||||
<v-select v-model="rule.torrentContentLayout" flat solo dense hide-details background-color="background" class="rounded-xl" :items="contentLayoutOptions" />
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
@ -101,8 +83,8 @@ import qbit from '@/services/qbit'
|
|||
import { Modal } from '@/mixins'
|
||||
import { mdiClose } from '@mdi/js'
|
||||
import i18n from '@/plugins/i18n'
|
||||
import {AppPreferences} from '@/enums/qbit'
|
||||
import {Category} from "@/types/vuetorrent";
|
||||
import { AppPreferences } from '@/enums/qbit'
|
||||
import { Category } from '@/types/vuetorrent'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RuleForm',
|
||||
|
@ -142,12 +124,13 @@ export default defineComponent({
|
|||
computed: {
|
||||
...mapGetters(['getFeeds', 'getCategories']),
|
||||
lastMatch() {
|
||||
if (this.rule.lastMatch === '')
|
||||
return i18n.t('modals.newRule.def.lastMatch.unknownValue').toString()
|
||||
if (this.rule.lastMatch === '') return i18n.t('modals.newRule.def.lastMatch.unknownValue').toString()
|
||||
|
||||
const delta = new Date().getTime() - new Date(this.rule.lastMatch).getTime()
|
||||
return i18n.t('modals.newRule.def.lastMatch.knownValue').toString()
|
||||
.replace('%1', Math.floor(delta / (1000 * 60 * 60 * 24)).toString())
|
||||
return i18n
|
||||
.t('modals.newRule.def.lastMatch.knownValue')
|
||||
.toString()
|
||||
.replace('%1', Math.floor(delta / (1000 * 60 * 60 * 24)).toString())
|
||||
},
|
||||
availableFeeds() {
|
||||
// @ts-expect-error: TS2349: This expression is not callable. Type 'never' has no call signatures.
|
||||
|
@ -164,7 +147,7 @@ export default defineComponent({
|
|||
created() {
|
||||
this.$store.commit('FETCH_RULES')
|
||||
if (this.hasInitialRule) {
|
||||
this.rule = {...this.initialRule}
|
||||
this.rule = { ...this.initialRule }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -2,27 +2,13 @@
|
|||
<v-card flat>
|
||||
<v-subheader>{{ $t('modals.settings.pageDownloads.subHeaderWhenAddTorrent') }}</v-subheader>
|
||||
<v-list-item>
|
||||
<v-select
|
||||
v-model="settings.torrent_content_layout"
|
||||
:label="$t('enums.contentLayout.title')"
|
||||
outlined
|
||||
dense
|
||||
small-chips
|
||||
:items="contentLayoutOptions"
|
||||
/>
|
||||
<v-select v-model="settings.torrent_content_layout" :label="$t('enums.contentLayout.title')" outlined dense small-chips :items="contentLayoutOptions" />
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<v-checkbox v-model="settings.start_paused_enabled" hide-details class="ma-0 pa-0" :label="$t('modals.settings.pageDownloads.whenAddTorrent.donotAutoStart')" />
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<v-select
|
||||
v-model="settings.torrent_stop_condition"
|
||||
:label="$t('enums.stopCondition.title')"
|
||||
outlined
|
||||
dense
|
||||
small-chips
|
||||
:items="stopConditionOptions"
|
||||
/>
|
||||
<v-select v-model="settings.torrent_stop_condition" :label="$t('enums.stopCondition.title')" outlined dense small-chips :items="stopConditionOptions" />
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<v-checkbox v-model="settings.auto_delete_mode" hide-details class="ma-0 pa-0" :label="$t('modals.settings.pageDownloads.whenAddTorrent.autoDeleteMode')" />
|
||||
|
|
|
@ -71,10 +71,10 @@ export default {
|
|||
this.createModal('RuleForm')
|
||||
},
|
||||
editRule(item) {
|
||||
this.createModal('RuleForm', {initialRule: item})
|
||||
this.createModal('RuleForm', { initialRule: item })
|
||||
},
|
||||
previewMatchingArticles(ruleName) {
|
||||
this.createModal('MatchingArticles', {ruleName})
|
||||
this.createModal('MatchingArticles', { ruleName })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,19 +3,19 @@
|
|||
<v-list-item link @click="resume">
|
||||
<v-icon>{{ mdiPlay }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.resume') | titleCase }}
|
||||
{{ $t('rightClick.resume') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item link @click="forceResume">
|
||||
<v-icon>{{ mdiFastForward }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.forceResume') | titleCase }}
|
||||
{{ $t('rightClick.forceResume') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item link @click="pause">
|
||||
<v-icon>{{ mdiPause }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('pause') | titleCase }}
|
||||
{{ $t('pause') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
{{ mdiDelete }}
|
||||
</v-icon>
|
||||
<v-list-item-title class="ml-2 red--text list-item__title">
|
||||
{{ $t('delete') | titleCase }}
|
||||
{{ $t('delete') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-divider />
|
||||
|
@ -34,7 +34,7 @@
|
|||
<v-list-item link v-on="on">
|
||||
<v-icon>{{ mdiHeadCog }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.advanced') | titleCase }}
|
||||
{{ $t('rightClick.advanced.advanced') | capitalize }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-action>
|
||||
<v-icon>{{ mdiChevronRight }}</v-icon>
|
||||
|
@ -45,25 +45,25 @@
|
|||
<v-list-item link @click="location">
|
||||
<v-icon>{{ mdiFolder }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.changeLocation') | titleCase }}
|
||||
{{ $t('rightClick.advanced.changeLocation') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!multiple" link @click="rename">
|
||||
<v-icon>{{ mdiRenameBox }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.rename') | titleCase }}
|
||||
{{ $t('rightClick.advanced.rename') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item link @click="recheck">
|
||||
<v-icon>{{ mdiPlaylistCheck }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.forceRecheck') | titleCase }}
|
||||
{{ $t('rightClick.advanced.forceRecheck') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item link @click="reannounce">
|
||||
<v-icon>{{ mdiBullhorn }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.forceReannounce') | titleCase }}
|
||||
{{ $t('rightClick.advanced.forceReannounce') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!multiple" link @click="toggleSeq">
|
||||
|
@ -71,7 +71,7 @@
|
|||
{{ torrent.seq_dl ? mdiCheckboxMarked : mdiCheckboxBlankOutline }}
|
||||
</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.sequentialDownload') | titleCase }}
|
||||
{{ $t('rightClick.advanced.sequentialDownload') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!multiple" link @click="toggleFL">
|
||||
|
@ -79,7 +79,7 @@
|
|||
{{ torrent.f_l_piece_prio ? mdiCheckboxMarked : mdiCheckboxBlankOutline }}
|
||||
</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.firstLastPriority') | titleCase }}
|
||||
{{ $t('rightClick.advanced.firstLastPriority') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!multiple" link @click="toggleAutoTMM">
|
||||
|
@ -87,7 +87,7 @@
|
|||
{{ torrent.auto_tmm ? mdiCheckboxMarked : mdiCheckboxBlankOutline }}
|
||||
</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.advanced.automaticTorrentManagement') | titleCase }}
|
||||
{{ $t('rightClick.advanced.automaticTorrentManagement') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
|
@ -97,7 +97,7 @@
|
|||
<v-list-item link v-on="on">
|
||||
<v-icon>{{ mdiPriorityHigh }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.prio.prio') | titleCase }}
|
||||
{{ $t('rightClick.prio.prio') | capitalize }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-action>
|
||||
<v-icon>{{ mdiChevronRight }}</v-icon>
|
||||
|
@ -108,7 +108,7 @@
|
|||
<v-list-item v-for="(item, index) in priority_options" :key="index" link @click="setPriority(item.action)">
|
||||
<v-icon>{{ item.icon }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.prio.' + item.name) | titleCase }}
|
||||
{{ $t('rightClick.prio.' + item.name) | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
|
@ -125,7 +125,7 @@
|
|||
<v-list-item link v-on="on">
|
||||
<v-icon>{{ mdiTag }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.tags') | titleCase }}
|
||||
{{ $t('rightClick.tags') | capitalize }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-action>
|
||||
<v-icon>{{ mdiChevronRight }}</v-icon>
|
||||
|
@ -146,7 +146,7 @@
|
|||
<v-list-item v-else>
|
||||
<v-icon>{{ mdiTagOff }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.notags') | titleCase }}
|
||||
{{ $t('rightClick.notags') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-menu
|
||||
|
@ -161,7 +161,7 @@
|
|||
<v-list-item link v-on="on">
|
||||
<v-icon>{{ mdiLabel }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.category') | titleCase }}
|
||||
{{ $t('rightClick.category') | capitalize }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-action>
|
||||
<v-icon>{{ mdiChevronRight }}</v-icon>
|
||||
|
@ -179,7 +179,7 @@
|
|||
<v-list-item v-else>
|
||||
<v-icon>{{ mdiLabelOff }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.nocategory') | titleCase }}
|
||||
{{ $t('rightClick.nocategory') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-menu v-if="!multiple" :open-on-hover="!touchmode" top offset-x :transition="isRightside ? 'slide-x-reverse-transition' : 'slide-x-transition'" :left="isRightside">
|
||||
|
@ -187,7 +187,7 @@
|
|||
<v-list-item link v-on="on">
|
||||
<v-icon>{{ mdiSpeedometerSlow }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.limit') | titleCase }}
|
||||
{{ $t('rightClick.limit') | capitalize }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-action>
|
||||
<v-icon>{{ mdiChevronRight }}</v-icon>
|
||||
|
@ -220,7 +220,7 @@
|
|||
<v-list-item link v-on="on">
|
||||
<v-icon>{{ mdiContentCopy }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.copy') | titleCase }}
|
||||
{{ $t('rightClick.copy') | capitalize }}
|
||||
</v-list-item-title>
|
||||
<v-list-item-action>
|
||||
<v-icon>{{ mdiChevronRight }}</v-icon>
|
||||
|
@ -251,14 +251,14 @@
|
|||
<v-list-item link @click="exportTorrents">
|
||||
<v-icon>{{ multiple ? mdiDownloadMultiple : mdiDownload }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $tc('rightClick.export', multiple ? 2 : 1) | titleCase }}
|
||||
{{ $tc('rightClick.export', multiple ? 2 : 1) | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-divider v-if="!multiple" />
|
||||
<v-list-item v-if="!multiple" link @click="showInfo">
|
||||
<v-icon>{{ mdiInformation }}</v-icon>
|
||||
<v-list-item-title class="ml-2 list-item__title">
|
||||
{{ $t('rightClick.info') | titleCase }}
|
||||
{{ $t('rightClick.info') | capitalize }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
|
|
|
@ -94,6 +94,16 @@ export function titleCase(str: string): string {
|
|||
|
||||
Vue.filter('titleCase', titleCase)
|
||||
|
||||
export function capitalize(str: string): string {
|
||||
if (str.length == 0) return str
|
||||
|
||||
str = str.toLowerCase()
|
||||
|
||||
return str.charAt(0).toUpperCase() + str.slice(1)
|
||||
}
|
||||
|
||||
Vue.filter('capitalize', capitalize)
|
||||
|
||||
export function limitToValue(value: number): string {
|
||||
if (value === -2) {
|
||||
return 'global'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, it, expect } from 'vitest'
|
||||
import { titleCase } from '@/filters'
|
||||
import { titleCase, capitalize } from '@/filters'
|
||||
|
||||
describe('Filters', () => {
|
||||
it('titleCase', () => {
|
||||
|
@ -9,4 +9,12 @@ describe('Filters', () => {
|
|||
expect(titleCase('test')).toEqual('Test')
|
||||
expect(titleCase('hello there')).toEqual('Hello There')
|
||||
})
|
||||
|
||||
it('capitaliza', () => {
|
||||
expect(capitalize('')).toEqual('')
|
||||
expect(capitalize('-')).toEqual('-')
|
||||
expect(capitalize('test')).toEqual('Test')
|
||||
expect(capitalize('hello There')).toEqual('Hello there')
|
||||
expect(capitalize('i like vuetorrent')).toEqual('I like vuetorrent')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue