Skip to content

Commit

Permalink
Fix hashtag handling in title and description
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Sep 17, 2022
1 parent 984901b commit 3d8fe26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export default Vue.extend({
}
try {
// workaround for title localization
this.videoTitle = result.response.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer.title.runs[0].text
this.videoTitle = result.response.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer.title.runs.map(run => run.text).join('')
} catch (err) {
console.error('Failed to extract localised video title, falling back to the standard one.', err)
// if the workaround for localization fails, this sets the title to the potentially non-localized value
Expand Down Expand Up @@ -802,7 +802,7 @@ export default Vue.extend({
processDescriptionPart(part, fallbackDescription) {
const timestampRegex = /^([0-9]+:)?[0-9]+:[0-9]+$/

if (typeof part.navigationEndpoint === 'undefined' || part.navigationEndpoint === null) {
if (typeof part.navigationEndpoint === 'undefined' || part.navigationEndpoint === null || part.text.startsWith('#')) {
return part.text
}

Expand Down

0 comments on commit 3d8fe26

Please sign in to comment.