mirror of
https://github.com/Arcadia-Solutions/arcadia.git
synced 2026-01-07 01:59:37 -06:00
add lint fixes
This commit is contained in:
@@ -80,7 +80,7 @@ export default {
|
||||
this.new_comment.answers_to_comment_id = null
|
||||
data.created_by = {}
|
||||
data.created_by = useUserStore()
|
||||
// TODO: don't mutate the prop
|
||||
// eslint-disable-next-line vue/no-mutating-props -- TODO: don't mutate the prop
|
||||
this.comments.push(data)
|
||||
this.sending_comment = false
|
||||
})
|
||||
|
||||
@@ -235,13 +235,13 @@ export default {
|
||||
addCover() {
|
||||
this.editionGroupForm.covers.push('')
|
||||
},
|
||||
removeCover(index: Number) {
|
||||
removeCover(index: number) {
|
||||
this.editionGroupForm.covers.splice(index, 1)
|
||||
},
|
||||
addLink() {
|
||||
this.editionGroupForm.external_links.push('')
|
||||
},
|
||||
removeLink(index: Number) {
|
||||
removeLink(index: number) {
|
||||
this.editionGroupForm.external_links.splice(index, 1)
|
||||
},
|
||||
},
|
||||
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
torrent_requests: {},
|
||||
},
|
||||
methods: {
|
||||
bytesToReadable(bytes: Number) {
|
||||
bytesToReadable(bytes: number) {
|
||||
return bytesToReadable(bytes)
|
||||
},
|
||||
},
|
||||
|
||||
@@ -286,13 +286,13 @@ export default {
|
||||
addLink() {
|
||||
this.titleGroupForm.external_links.push('')
|
||||
},
|
||||
removeLink(index: Number) {
|
||||
removeLink(index: number) {
|
||||
this.titleGroupForm.external_links.splice(index, 1)
|
||||
},
|
||||
addCover() {
|
||||
this.titleGroupForm.covers.push('')
|
||||
},
|
||||
removeCover(index: Number) {
|
||||
removeCover(index: number) {
|
||||
this.titleGroupForm.covers.splice(index, 1)
|
||||
},
|
||||
},
|
||||
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
return { titleGroupStore }
|
||||
},
|
||||
methods: {
|
||||
getExternalDatabaseData(item_id: string | Number, database: string) {
|
||||
getExternalDatabaseData(item_id: string | number, database: string) {
|
||||
this.gettingExternalDatabaseData = true
|
||||
getExternalDatabaseData(item_id, database).then((data) => {
|
||||
data.title_group.original_release_date = new Date(data.title_group.original_release_date)
|
||||
@@ -204,7 +204,7 @@ export default {
|
||||
this.gettingExternalDatabaseData = false
|
||||
})
|
||||
},
|
||||
async sendTitleGroup(titleGroupForm: Object) {
|
||||
async sendTitleGroup(titleGroupForm: object) {
|
||||
if (this.action == 'select') {
|
||||
this.gettingTitleGroupInfo = true
|
||||
if (!this.titleGroupStore.id) {
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Image } from 'primevue'
|
||||
export default {
|
||||
components: { Image },
|
||||
props: {
|
||||
title_group: {},
|
||||
},
|
||||
|
||||
@@ -179,9 +179,11 @@ export default {
|
||||
const reportedTorrent = this.title_group.edition_groups
|
||||
.flatMap((edition_group) => edition_group.torrents)
|
||||
.find((torrent) => torrent.id == torrentReport.reported_torrent_id)
|
||||
reportedTorrent.reports
|
||||
? reportedTorrent.reports.push(torrentReport)
|
||||
: (reportedTorrent.reports = [torrentReport])
|
||||
if (reportedTorrent.reports) {
|
||||
reportedTorrent.reports.push(torrentReport)
|
||||
} else {
|
||||
reportedTorrent.reports = [torrentReport]
|
||||
}
|
||||
},
|
||||
reportTorrent(id: number) {
|
||||
this.reportingTorrentId = id
|
||||
@@ -197,13 +199,13 @@ export default {
|
||||
timeAgo(date: string) {
|
||||
return timeAgo(date)
|
||||
},
|
||||
bytesToReadable(bytes: Number) {
|
||||
bytesToReadable(bytes: number) {
|
||||
return bytesToReadable(bytes)
|
||||
},
|
||||
purifyHtml(html: string) {
|
||||
return DOMPurify.sanitize(html)
|
||||
},
|
||||
downloadTorrent(torrentId: Number) {
|
||||
downloadTorrent(torrentId: number) {
|
||||
downloadTorrent(torrentId)
|
||||
},
|
||||
},
|
||||
@@ -218,9 +220,9 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
getEditionGroupSlug() {
|
||||
return (id: Number) => {
|
||||
return (id: number) => {
|
||||
return getEditionGroupSlug(
|
||||
this.title_group.edition_groups.find((group: Object) => group.id === id),
|
||||
this.title_group.edition_groups.find((group: object) => group.id === id),
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from './api.ts'
|
||||
|
||||
export const getArtist = async (id: string | Number) => {
|
||||
export const getArtist = async (id: string | number) => {
|
||||
try {
|
||||
return (await api.get('/artist?id=' + id)).data
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from './api.ts'
|
||||
|
||||
export const login = async (form: Object) => {
|
||||
export const login = async (form: object) => {
|
||||
try {
|
||||
return (await api.post('/login', form)).data
|
||||
} catch (error) {
|
||||
@@ -9,7 +9,7 @@ export const login = async (form: Object) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const register = async (form: Object) => {
|
||||
export const register = async (form: object) => {
|
||||
try {
|
||||
return (await api.post('/register', form)).data
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from './api.ts'
|
||||
|
||||
export const getExternalDatabaseData = async (item_id: string | Number, database: string) => {
|
||||
export const getExternalDatabaseData = async (item_id: string | number, database: string) => {
|
||||
try {
|
||||
switch (database) {
|
||||
case 'openlibrary': {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from './api.ts'
|
||||
|
||||
export const subscribeToItem = async (item_id: string | Number, item: string) => {
|
||||
export const subscribeToItem = async (item_id: string | number, item: string) => {
|
||||
try {
|
||||
return (await api.post('/subscription?item=' + item + '&item_id=' + item_id)).data
|
||||
} catch (error) {
|
||||
@@ -8,7 +8,7 @@ export const subscribeToItem = async (item_id: string | Number, item: string) =>
|
||||
throw error
|
||||
}
|
||||
}
|
||||
export const unsubscribeToItem = async (item_id: string | Number, item: string) => {
|
||||
export const unsubscribeToItem = async (item_id: string | number, item: string) => {
|
||||
try {
|
||||
return (await api.delete('/subscription?item=' + item + '&item_id=' + item_id)).data
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from './api.ts'
|
||||
|
||||
export const getSeries = async (id: string | Number) => {
|
||||
export const getSeries = async (id: string | number) => {
|
||||
try {
|
||||
return (await api.get('/series?id=' + id)).data
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from './api.ts'
|
||||
|
||||
export const getTitleGroup = async (id: string | Number) => {
|
||||
export const getTitleGroup = async (id: string | number) => {
|
||||
try {
|
||||
return (await api.get('/title-group?id=' + id)).data
|
||||
} catch (error) {
|
||||
@@ -8,7 +8,7 @@ export const getTitleGroup = async (id: string | Number) => {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
export const getTitleGroupLite = async (id: string | Number) => {
|
||||
export const getTitleGroupLite = async (id: string | number) => {
|
||||
try {
|
||||
return (await api.get('/title-group/lite?id=' + id)).data
|
||||
} catch (error) {
|
||||
@@ -52,7 +52,7 @@ export const uploadTorrent = async (torrentForm: object) => {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
export const downloadTorrent = async (torrentId: Number | string) => {
|
||||
export const downloadTorrent = async (torrentId: number | string) => {
|
||||
try {
|
||||
const response = await api.get('/torrent?id=' + torrentId, {
|
||||
responseType: 'blob',
|
||||
|
||||
@@ -35,7 +35,7 @@ export default class MediainfoParser {
|
||||
return result
|
||||
}
|
||||
|
||||
extractFields({ sectionName, sectionBody }) {
|
||||
extractFields({ sectionName: _sectionName, sectionBody }) {
|
||||
const result = {}
|
||||
const lines = splitIntoLines(sectionBody)
|
||||
for (const line of lines) {
|
||||
|
||||
@@ -8,7 +8,7 @@ export const timeAgo = (date: string) => {
|
||||
? `${Math.floor(diff / 3600)}h ago`
|
||||
: `${Math.floor(diff / 86400)}d ago`
|
||||
}
|
||||
export const bytesToReadable = (bytes: Number) => {
|
||||
export const bytesToReadable = (bytes: number) => {
|
||||
const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB']
|
||||
let size = bytes
|
||||
let unitIndex = 0
|
||||
@@ -69,7 +69,7 @@ export const isValidUrl = (url: string) => {
|
||||
try {
|
||||
new URL(url)
|
||||
return true
|
||||
} catch (_) {
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,14 @@
|
||||
/>
|
||||
</div>
|
||||
</ContentContainer>
|
||||
<TitleGroupPreviewTable
|
||||
v-for="title_group in title_groups"
|
||||
:key="title_group.id"
|
||||
:title_group="title_group"
|
||||
v-if="title_group_preview_mode == 'table'"
|
||||
class="preview-table"
|
||||
/>
|
||||
<div v-if="title_group_preview_mode == 'table'">
|
||||
<TitleGroupPreviewTable
|
||||
v-for="title_group in title_groups"
|
||||
:key="title_group.id"
|
||||
:title_group="title_group"
|
||||
class="preview-table"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<ArtistSidebar :artist />
|
||||
</div>
|
||||
|
||||
@@ -22,13 +22,14 @@
|
||||
/>
|
||||
</div>
|
||||
</ContentContainer>
|
||||
<TitleGroupPreviewTable
|
||||
v-for="title_group in title_groups"
|
||||
:key="title_group.id"
|
||||
:title_group="title_group"
|
||||
v-if="title_group_preview_mode == 'table'"
|
||||
class="preview-table"
|
||||
/>
|
||||
<div v-if="title_group_preview_mode == 'table'">
|
||||
<TitleGroupPreviewTable
|
||||
v-for="title_group in title_groups"
|
||||
:key="title_group.id"
|
||||
:title_group="title_group"
|
||||
class="preview-table"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<SeriesSidebar :series />
|
||||
</div>
|
||||
|
||||
@@ -15,13 +15,14 @@
|
||||
/>
|
||||
</div>
|
||||
</ContentContainer>
|
||||
<TitleGroupPreviewTable
|
||||
v-for="title_group in search_results.title_groups"
|
||||
:key="title_group.id"
|
||||
:title_group="title_group"
|
||||
v-if="title_group_preview_mode == 'table'"
|
||||
class="preview-table"
|
||||
/>
|
||||
<div v-if="title_group_preview_mode == 'table'">
|
||||
<TitleGroupPreviewTable
|
||||
v-for="title_group in search_results.title_groups"
|
||||
:key="title_group.id"
|
||||
:title_group="title_group"
|
||||
class="preview-table"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user