Skip to content

Commit

Permalink
Make the extraction more tolerant to missing info
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Dec 12, 2022
1 parent 17fe6eb commit 61e7a52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/renderer/components/playlist-info/playlist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ export default Vue.extend({
this.infoSource = this.data.infoSource

// Causes errors if not put inside of a check
if (typeof (this.data.viewCount) !== 'undefined') {
if (typeof (this.data.viewCount) !== 'undefined' && !isNaN(this.data.viewCount)) {
this.viewCount = this.hideViews ? null : Intl.NumberFormat(this.currentLocale).format(this.data.viewCount)
}

if (typeof (this.data.videoCount) !== 'undefined') {
if (typeof (this.data.videoCount) !== 'undefined' && !isNaN(this.data.videoCount)) {
this.videoCount = Intl.NumberFormat(this.currentLocale).format(this.data.videoCount)
}

Expand Down
6 changes: 3 additions & 3 deletions src/renderer/views/Playlist/Playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export default Vue.extend({
viewCount: extractNumberFromString(result.info.views),
videoCount: extractNumberFromString(result.info.total_items),
lastUpdated: result.info.last_updated ?? '',
channelName: result.info.author.name ?? '',
channelThumbnail: result.info.author.best_thumbnail?.url ?? '',
channelId: result.info.author.id,
channelName: result.info.author?.name ?? '',
channelThumbnail: result.info.author?.best_thumbnail?.url ?? '',
channelId: result.info.author?.id,
infoSource: 'local'
}

Expand Down

0 comments on commit 61e7a52

Please sign in to comment.