Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Commit bd0078e

Browse files
committed
update skipOrPlayLikedSongs.js
1 parent a224969 commit bd0078e

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 📦 Archiving this extensions repo due to time constraints. Feel free to fork and continue the development! 🍴
22

3+
## Edit (31st may 2025): Thanks to [Jordan](https://open.spotify.com/user/31anolqptv7j6z4oe3spjnjn64nq) for sponcering me to update the [Skip or Play Liked Songs](https://github.com/Tetrax-10/Spicetify-Extensions/tree/master/Skip-or-Play-Liked-Songs) extension.
4+
35
# Spicetify-Extensions
46

57
Some Use Full Extension Developed by a Music Lover.

Skip-or-Play-Liked-Songs/skipOrPlayLikedSongs.js

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
// DESCRIPTION: Skip or Play liked songs only
66

77
/// <reference path="../dev/globals.d.ts" />
8-
let skipOrPlayLikedSongsCount = 0
98
;(async function skipOrPlayLikedSongs() {
10-
if (!(Spicetify.Platform && Spicetify.LocalStorage && Spicetify.Player.data) && skipOrPlayLikedSongsCount < 200) {
11-
setTimeout(skipOrPlayLikedSongs, 300)
12-
skipOrPlayLikedSongsCount++
13-
return
9+
while (!(Spicetify?.Platform && Spicetify?.LocalStorage && Spicetify?.Player?.data)) {
10+
await new Promise((resolve) => setTimeout(resolve, 10))
1411
}
1512

1613
let skipLikedSongsKey = "SkipLikedSongs"
@@ -26,7 +23,7 @@ let skipOrPlayLikedSongsCount = 0
2623
if (getLocalStorageDataFromKey(skipLikedSongsKey) == null) {
2724
Spicetify.showNotification("Only Liked Songs will be Played as default")
2825
setTimeout(() => {
29-
Spicetify.showNotification("You can Change it in Context Menu Located on Top under User Profile", false, 3000)
26+
Spicetify.showNotification("You can Change it in Context Menu Located on Top under User Profile", false, 5000)
3027
}, 5000)
3128
setLocalStorageDataWithKey(skipLikedSongsKey, false)
3229
}
@@ -42,62 +39,51 @@ let skipOrPlayLikedSongsCount = 0
4239

4340
function main() {
4441
let count = 0
42+
4543
function isLiked() {
46-
if (Spicetify.Player.data.track.metadata["collection.in_collection"] == "true") {
44+
if (Spicetify.Player.data.item.metadata["collection.in_collection"] == "true") {
4745
return true
4846
} else {
4947
return false
5048
}
5149
}
5250

5351
function playLikedOnly() {
54-
if (count <= 49) {
52+
if (count <= 79) {
5553
if (!isLiked()) {
5654
Spicetify.Player.next()
5755
} else {
5856
count = 0
5957
}
6058
}
61-
if (count == 50) {
62-
Spicetify.showNotification("Skiped 50 Songs, So 1 min Cooldown to avoid Crash")
59+
if (count == 80) {
60+
Spicetify.showNotification("Skiped 80 Songs, So 1 min Cooldown to avoid Crash, please avoid skipping songs for a min", false, 6000)
6361
setTimeout(() => {
6462
count = 0
6563
Spicetify.showNotification("You can Start Skiping Songs Now")
6664
}, 60000)
6765
}
68-
if (count == 79) {
69-
Spicetify.showNotification("Stop skipping Songs for that 1 min To Avoid Crash")
70-
}
71-
if (count == 85) {
72-
Spicetify.showNotification("Just wait for that 1m, you will get a Message after that 1 min")
73-
}
7466
if (count == 95) {
7567
Spicetify.showNotification("5 More Skips to Crash!")
7668
}
7769
count++
7870
}
7971

8072
function skipLiked() {
81-
if (count <= 49) {
73+
if (count <= 79) {
8274
if (isLiked()) {
8375
Spicetify.Player.next()
8476
} else {
8577
count = 0
8678
}
8779
}
88-
if (count == 50) {
89-
Spicetify.showNotification("Skiped 50 Songs, So 1 min Cooldown to avoid Crash")
80+
if (count == 80) {
81+
Spicetify.showNotification("Skiped 80 Songs, So 1 min Cooldown to avoid Crash, please avoid skipping songs for a min", false, 6000)
9082
setTimeout(() => {
9183
count = 0
9284
Spicetify.showNotification("You can Start Skiping Songs Now")
9385
}, 60000)
9486
}
95-
if (count == 79) {
96-
Spicetify.showNotification("Stop skipping Songs for that 1 min To Avoid Crash")
97-
}
98-
if (count == 85) {
99-
Spicetify.showNotification("Just wait for that 1m, you will get a Message after that 1 min")
100-
}
10187
if (count == 95) {
10288
Spicetify.showNotification("5 More Skips to Crash!")
10389
}

0 commit comments

Comments
 (0)