Skip to content

Commit

Permalink
fix: detect new style of "your episodes" in sidebar (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
theRealPadster committed Jan 12, 2024
1 parent 21fd683 commit f85c25e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export const getPageLoadedSelector = (t: TFunction, pathname: string) => {
export const tagPodcasts = (t: TFunction) => {
console.debug('=== Tagging podcasts ===');

t('search.podcastsCardTitle');

const yourEpisodesInSidebar = document.querySelector('a[href="/collection/episodes"]')?.parentElement;
const yourEpisodesInSidebar =
// Old style?
document.querySelector('a[href="/collection/episodes"]')?.parentElement ||
// New style?
document.querySelector('#listrow-title-spotify:collection:your-episodes')?.closest('li');
if (yourEpisodesInSidebar) {
console.debug('Tagging yourEpisodesInSidebar:', yourEpisodesInSidebar);
yourEpisodesInSidebar.classList.add('podcast-item');
Expand Down

0 comments on commit f85c25e

Please sign in to comment.