Skip to content

Commit

Permalink
Use ESM import for thumbnail_placeholder.svg instead of require (#6174)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Nov 17, 2024
1 parent f9736fb commit 9c127ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/renderer/components/ft-list-playlist/ft-list-playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineComponent } from 'vue'
import FtIconButton from '../ft-icon-button/ft-icon-button.vue'
import { mapActions } from 'vuex'
import { showToast } from '../../helpers/utils'
import thumbnailPlaceholder from '../../assets/img/thumbnail_placeholder.svg'

export default defineComponent({
name: 'FtListPlaylist',
Expand All @@ -28,7 +29,7 @@ export default defineComponent({
playlistId: '',
channelId: '',
title: 'Pop Music Playlist - Timeless Pop Songs (Updated Weekly 2020)',
thumbnail: require('../../assets/img/thumbnail_placeholder.svg'),
thumbnail: thumbnailPlaceholder,
channelName: '#RedMusic: Just Hits',
videoCount: 200,
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '../../helpers/utils'
import { deArrowData, deArrowThumbnail } from '../../helpers/sponsorblock'
import debounce from 'lodash.debounce'
import thumbnailPlaceholder from '../../assets/img/thumbnail_placeholder.svg'

export default defineComponent({
name: 'FtListVideo',
Expand Down Expand Up @@ -334,7 +335,7 @@ export default defineComponent({

thumbnail: function () {
if (this.thumbnailPreference === 'hidden') {
return require('../../assets/img/thumbnail_placeholder.svg')
return thumbnailPlaceholder
}

if (this.useDeArrowThumbnails && this.deArrowCache?.thumbnail != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineComponent } from 'vue'
import FtIconButton from '../ft-icon-button/ft-icon-button.vue'
import { mapActions } from 'vuex'
import thumbnailPlaceholder from '../../assets/img/thumbnail_placeholder.svg'

export default defineComponent({
name: 'FtPlaylistSelector',
Expand Down Expand Up @@ -37,7 +38,7 @@ export default defineComponent({
data: function () {
return {
title: '',
thumbnail: require('../../assets/img/thumbnail_placeholder.svg'),
thumbnail: thumbnailPlaceholder,
videoCount: 0,

videoPresenceCountInPlaylistTextShouldBeVisible: false,
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/playlist-info/playlist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
showSaveDialog,
} from '../../helpers/utils'
import debounce from 'lodash.debounce'
import thumbnailPlaceholder from '../../assets/img/thumbnail_placeholder.svg'

export default defineComponent({
name: 'PlaylistInfo',
Expand Down Expand Up @@ -202,7 +203,7 @@ export default defineComponent({

thumbnail: function () {
if (this.thumbnailPreference === 'hidden' || !this.firstVideoIdExists) {
return require('../../assets/img/thumbnail_placeholder.svg')
return thumbnailPlaceholder
}

let baseUrl = 'https://i.ytimg.com'
Expand Down

0 comments on commit 9c127ef

Please sign in to comment.