From 26ba0897a58654401d9154734362b898e415ee82 Mon Sep 17 00:00:00 2001 From: FinalDoom <7464170-FinalDoom@users.noreply.gitlab.com> Date: Sun, 20 Feb 2022 12:16:37 -0700 Subject: [PATCH] Prettier part 2, formatters fight! --- .../javascript/stores/TorrentFilterStore.ts | 10 ++-- server/services/taxonomyService.ts | 48 +++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/client/src/javascript/stores/TorrentFilterStore.ts b/client/src/javascript/stores/TorrentFilterStore.ts index d207fa618..f14648308 100644 --- a/client/src/javascript/stores/TorrentFilterStore.ts +++ b/client/src/javascript/stores/TorrentFilterStore.ts @@ -1,9 +1,9 @@ -import { computed, makeAutoObservable } from 'mobx'; -import jsonpatch, { Operation } from 'fast-json-patch'; -import { KeyboardEvent, MouseEvent, TouchEvent } from 'react'; +import {computed, makeAutoObservable} from 'mobx'; +import jsonpatch, {Operation} from 'fast-json-patch'; +import {KeyboardEvent, MouseEvent, TouchEvent} from 'react'; -import type { Taxonomy } from '@shared/types/Taxonomy'; -import torrentStatusMap, { TorrentStatus } from '@shared/constants/torrentStatusMap'; +import type {Taxonomy} from '@shared/types/Taxonomy'; +import torrentStatusMap, {TorrentStatus} from '@shared/constants/torrentStatusMap'; class TorrentFilterStore { locationFilter: Array = []; diff --git a/server/services/taxonomyService.ts b/server/services/taxonomyService.ts index 76925ff50..c531df2ea 100644 --- a/server/services/taxonomyService.ts +++ b/server/services/taxonomyService.ts @@ -1,25 +1,25 @@ -import jsonpatch, { Operation } from 'fast-json-patch'; +import jsonpatch, {Operation} from 'fast-json-patch'; import BaseService from './BaseService'; import torrentStatusMap from '../../shared/constants/torrentStatusMap'; -import type { Taxonomy, LocationTreeNode } from '../../shared/types/Taxonomy'; -import type { TorrentStatus } from '../../shared/constants/torrentStatusMap'; -import type { TorrentProperties, TorrentList } from '../../shared/types/Torrent'; +import type {Taxonomy, LocationTreeNode} from '../../shared/types/Taxonomy'; +import type {TorrentStatus} from '../../shared/constants/torrentStatusMap'; +import type {TorrentProperties, TorrentList} from '../../shared/types/Torrent'; interface TaxonomyServiceEvents { - TAXONOMY_DIFF_CHANGE: (payload: { id: number; diff: Operation[] }) => void; + TAXONOMY_DIFF_CHANGE: (payload: {id: number; diff: Operation[]}) => void; } class TaxonomyService extends BaseService { taxonomy: Taxonomy = { - locationCounts: { '': 0 }, + locationCounts: {'': 0}, locationSizes: {}, locationTree: [], - statusCounts: { '': 0 }, - tagCounts: { '': 0, untagged: 0 }, + statusCounts: {'': 0}, + tagCounts: {'': 0, untagged: 0}, tagSizes: {}, - trackerCounts: { '': 0 }, + trackerCounts: {'': 0}, trackerSizes: {}, }; @@ -33,7 +33,7 @@ class TaxonomyService extends BaseService { return; } - const { clientGatewayService } = this.services; + const {clientGatewayService} = this.services; clientGatewayService.on('PROCESS_TORRENT_LIST_START', this.handleProcessTorrentListStart); clientGatewayService.on('PROCESS_TORRENT_LIST_END', this.handleProcessTorrentListEnd); @@ -46,7 +46,7 @@ class TaxonomyService extends BaseService { return; } - const { clientGatewayService } = this.services; + const {clientGatewayService} = this.services; clientGatewayService.removeListener('PROCESS_TORRENT_LIST_START', this.handleProcessTorrentListStart); clientGatewayService.removeListener('PROCESS_TORRENT_LIST_END', this.handleProcessTorrentListEnd); @@ -64,27 +64,27 @@ class TaxonomyService extends BaseService { handleProcessTorrentListStart = () => { this.lastTaxonomy = { - locationCounts: { ...this.taxonomy.locationCounts }, - locationSizes: { ...this.taxonomy.locationCounts }, + locationCounts: {...this.taxonomy.locationCounts}, + locationSizes: {...this.taxonomy.locationCounts}, locationTree: [...this.taxonomy.locationTree], - statusCounts: { ...this.taxonomy.statusCounts }, - tagCounts: { ...this.taxonomy.tagCounts }, - tagSizes: { ...this.taxonomy.tagSizes }, - trackerCounts: { ...this.taxonomy.trackerCounts }, - trackerSizes: { ...this.taxonomy.trackerSizes }, + statusCounts: {...this.taxonomy.statusCounts}, + tagCounts: {...this.taxonomy.tagCounts}, + tagSizes: {...this.taxonomy.tagSizes}, + trackerCounts: {...this.taxonomy.trackerCounts}, + trackerSizes: {...this.taxonomy.trackerSizes}, }; torrentStatusMap.forEach((status) => { this.taxonomy.statusCounts[status] = 0; }); - this.taxonomy.locationCounts = { '': 0 }; + this.taxonomy.locationCounts = {'': 0}; this.taxonomy.locationSizes = {}; this.taxonomy.locationTree = []; this.taxonomy.statusCounts[''] = 0; - this.taxonomy.tagCounts = { '': 0, untagged: 0 }; + this.taxonomy.tagCounts = {'': 0, untagged: 0}; this.taxonomy.tagSizes = {}; - this.taxonomy.trackerCounts = { '': 0 }; + this.taxonomy.trackerCounts = {'': 0}; this.taxonomy.trackerSizes = {}; }; @@ -107,7 +107,7 @@ class TaxonomyService extends BaseService { this.taxonomy.locationTree = sortedLocations.reduce((tree, filter) => { const directory = filter.split(separator).slice(-1)[0]; const parentPath = filter.substring(0, filter.lastIndexOf(separator + directory)); - const location: LocationTreeNode = { directoryName: directory, fullPath: filter, children: [] }; + const location: LocationTreeNode = {directoryName: directory, fullPath: filter, children: []}; while (previousLocation) { // Move up the tree to a matching parent if (!previousLocation.parent || previousLocation.fullPath === parentPath) { @@ -137,8 +137,8 @@ class TaxonomyService extends BaseService { location.children.forEach(this.cleanLocationTree); }; - handleProcessTorrentListEnd = ({ torrents }: { torrents: TorrentList }) => { - const { length } = Object.keys(torrents); + handleProcessTorrentListEnd = ({torrents}: {torrents: TorrentList}) => { + const {length} = Object.keys(torrents); this.buildLocationTree(); this.taxonomy.locationTree.forEach(this.cleanLocationTree);