-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove podcast shortcuts on home #36
Conversation
Hey, first of all I wanted to say thanks for this. I took a look and I can't add a wait for If my Spotify is outdated, I may need to do that and take a look at the classes and integrate your changes in. |
Hi, I've tested it locally and it seems to work. I'm using the latest version (1.1.94.872.g7a9200fe). video of me, building and applying the pr changes: Spotify_2022-09-26_16-01-53.mp4
I think then it could be added to the |
Ohh, it looks like you've got the new UI in your Spotify. It's still in A/B testing and hasn't rolled out to me yet. I'm guessing it's got different structure/classes. I may need to wait until I've got the new UI before I can properly mess around and figure out the best way to handle it. |
Hey, I finally got around to fixing things for the new UI. I thought there was an issue about it being broken, but couldn't find it, so fixed the issue I had my own way. Could you give the latest release (2.5.2) a try, and let me know if your issue is still a problem? Again, sorry, I completely forgot it was a PR and not an issue. Happy to take another look if it's still broken for you. I also checked and I still don't have |
|
||
// remove podcast shortcuts on home | ||
document.querySelectorAll('.view-homeShortcutsGrid-name a[href^="/episode"]').forEach((selected) => { | ||
selected.parentNode.parentNode.parentNode.parentNode.parentNode.classList.add('podcast-item'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I have the .view-homeShortcutsGrid-grid
elements in my DOM now. I don't have a podcast item, but your code looks sound. I just cleaned it up a little. Was going to push up to this PR but my VS Code is being weird and creating a new branch on the main repo when I try and push, so I'll just put this here.
// remove podcast shortcuts on home | |
document.querySelectorAll('.view-homeShortcutsGrid-name a[href^="/episode"]').forEach((selected) => { | |
selected.parentNode.parentNode.parentNode.parentNode.parentNode.classList.add('podcast-item'); | |
}); | |
// Remove podcast shortcuts on home page | |
const podcastShortcutsOnHomepage = document.querySelectorAll('.view-homeShortcutsGrid-name a[href^="/episode"]'); | |
podcastShortcutsOnHomepage.forEach((itemLink) => { | |
const item = itemLink.closest('.view-homeShortcutsGrid-shortcut'); | |
if (item) item.classList.add('podcast-item'); | |
}); |
|
||
while (!Player || !Menu || !Platform || !mainElem) { | ||
while (!Player || !Menu || !Platform || !mainElem || !shortcutsElem) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't think we can put this here, since the app may not start on the homepage (and their Spotify may not even have it).
It might be a better idea to add a custom element to check for on the homepage down in the listenThenApply
function, like how it does for the /search
page.
if this can be better implemented, please modify it.