Skip to content

Commit

Permalink
Fix author for album playlists on the playlist page (#3838)
Browse files Browse the repository at this point in the history
* Fix author for album playlists on the playlist page

* Only show artists
  • Loading branch information
absidue committed Aug 4, 2023
1 parent 8025945 commit e0fceed
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/playlist-info/playlist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineComponent({
title: '',
channelThumbnail: '',
channelName: '',
channelId: '',
channelId: null,
videoCount: 0,
viewCount: 0,
lastUpdated: '',
Expand Down
11 changes: 11 additions & 0 deletions src/renderer/components/playlist-info/playlist-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
class="channelShareWrapper"
>
<router-link
v-if="channelId"
class="playlistChannel"
:to="`/channel/${channelId}`"
>
Expand All @@ -55,6 +56,16 @@
{{ channelName }}
</h3>
</router-link>
<div
v-else
class="playlistChannel"
>
<h3
class="channelName"
>
{{ channelName }}
</h3>
</div>

<ft-share-button
v-if="!hideSharingActions"
Expand Down
13 changes: 12 additions & 1 deletion src/renderer/views/Playlist/Playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ export default defineComponent({
this.isLoading = true

getLocalPlaylist(this.playlistId).then((result) => {
let channelName

if (result.info.author) {
channelName = result.info.author.name
} else {
const subtitle = result.info.subtitle.toString()

const index = subtitle.lastIndexOf('•')
channelName = subtitle.substring(0, index).trim()
}

this.infoData = {
id: this.playlistId,
title: result.info.title,
Expand All @@ -92,7 +103,7 @@ export default defineComponent({
viewCount: extractNumberFromString(result.info.views),
videoCount: extractNumberFromString(result.info.total_items),
lastUpdated: result.info.last_updated ?? '',
channelName: result.info.author?.name ?? '',
channelName,
channelThumbnail: result.info.author?.best_thumbnail?.url ?? '',
channelId: result.info.author?.id,
infoSource: 'local'
Expand Down

0 comments on commit e0fceed

Please sign in to comment.