Skip to content

Commit c839deb

Browse files
committed
fixed console spam when nothing playing
1 parent cc7fb67 commit c839deb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/dev/codeman/smtc4j/SMTC4J.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public static MediaInfo parsedMediaInfo() {
103103

104104
String info = getMediaInfo();
105105

106+
if (info.equals("{}"))
107+
return new MediaInfo("", "", "", 0, "", "");
108+
106109
if (info.contains("\"error\":")) {
107110
System.out.println("Error retrieving media info: " + info);
108111
return new MediaInfo("", "", "", 0, "", "");
@@ -121,6 +124,9 @@ public static PlaybackState parsedPlaybackState() {
121124

122125
String state = getPlaybackState();
123126

127+
if (state.equals("{}"))
128+
return new PlaybackState(-1, 0);
129+
124130
if (state.contains("\"error\":")) {
125131
System.out.println("Error retrieving playback state: " + state);
126132
return new PlaybackState(-1, 0);

0 commit comments

Comments
 (0)