Skip to content

Commit b312c33

Browse files
committed
Abort if all fallback playlist tracks have been played at least 100 times
1 parent b7b873a commit b312c33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

listeningSession/fallbackPlaylist.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func doFindNextFallbackTrack(playableTracks *[]spotify.FullTrack, session model.
118118
return "", nil
119119
}
120120

121-
for i := int64(0); i < 10_000; i++ {
121+
for i := int64(0); i < 100; i++ {
122122
fallbackTrack, err := findPossibleFallbackTrackFromPlayableTracks(*playableTracks, session.SimpleListeningSession, queue, i)
123123
if err != nil {
124124
return "", NewInternalError("could not find possible fallback tracks", err)
@@ -131,7 +131,7 @@ func doFindNextFallbackTrack(playableTracks *[]spotify.FullTrack, session model.
131131
session.FallbackPlaylistId = nil
132132
database.GetConnection().Save(session)
133133

134-
return "", NewInternalError(fmt.Sprintf("No track found in fallback playlist for session %d that has been played less than 10,000 times. Aborting and removing fallback playlist.", session.ID), nil)
134+
return "", NewInternalError(fmt.Sprintf("No track found in fallback playlist for session %d that has been played less than 100 times. Aborting and removing fallback playlist.", session.ID), nil)
135135
}
136136

137137
func findPossibleFallbackTrackFromPlayableTracks(playableTracks []spotify.FullTrack, session model.SimpleListeningSession, queue []model.SongRequest, maximumPlays int64) (possibleFallbackTrackId *string, err error) {

0 commit comments

Comments
 (0)