Skip to content

Commit

Permalink
Implement code suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: absidue <[email protected]>
  • Loading branch information
ChunkyProgrammer and absidue authored Jan 14, 2024
1 parent fb85cff commit acec20c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ export default defineComponent({

displayDuration: function () {
if (this.useDeArrowTitles && (this.duration === '' || this.duration === '0:00') && this.deArrowCache?.videoDuration) {
return formatDurationAsTimestamp(this.deArrowCache?.videoDuration)
return formatDurationAsTimestamp(this.deArrowCache.videoDuration)
}
return this.duration
},
Expand Down Expand Up @@ -468,7 +468,7 @@ export default defineComponent({
this.fetchDeArrowData()
}

if (this.useDeArrowThumbnails && this.deArrowCache && this.deArrowCache?.thumbnail == null) {
if (this.useDeArrowThumbnails && this.deArrowCache && this.deArrowCache.thumbnail == null) {
if (this.debounceGetDeArrowThumbnail == null) {
this.debounceGetDeArrowThumbnail = debounce(this.fetchDeArrowThumbnail, 1000)
}
Expand All @@ -480,10 +480,9 @@ export default defineComponent({
fetchDeArrowThumbnail: async function() {
if (this.thumbnailPreference === 'hidden') { return }
const videoId = this.id
const deArrowCacheClone = deepCopy(this.deArrowCache)

const thumbnail = await deArrowThumbnail(videoId, deArrowCacheClone.thumbnailTimestamp)
const thumbnail = await deArrowThumbnail(videoId, this.deArrowCache.thumbnailTimestamp)
if (thumbnail) {
const deArrowCacheClone = deepCopy(this.deArrowCache)
deArrowCacheClone.thumbnail = thumbnail
this.$store.commit('addThumbnailToDeArrowCache', deArrowCacheClone)
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/helpers/sponsorblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function deArrowThumbnail(videoId, timestamp) {
try {
const response = await fetch(requestUrl)

// 404 means that there are no segments registered for the video
// 404 means that there are no thumbnails found for the video
if (response.status === 404) {
return undefined
}
Expand Down

0 comments on commit acec20c

Please sign in to comment.