]> git.r.bdr.sh - rbdr/lyricli/blobdiff - Sources/lyricli/sources/spotify_source.swift
Merge branch 'release/1.0.0'
[rbdr/lyricli] / Sources / lyricli / sources / spotify_source.swift
index 2cd66f53bf35ba012e157fa446ce935cc1770c99..9c516c4d4e96b550e3967f960cccbb51cbb19ad0 100644 (file)
@@ -20,8 +20,14 @@ class SpotifySource: Source {
     var currentTrack: Track? {
 
         if let spotify: SpotifyApplication = SBApplication(bundleIdentifier: "com.spotify.client") {
+            if let application = spotify as? SBApplication {
+              if !application.isRunning {
+                return nil
+              }
+            }
 
             // Attempt to fetch the title from a song
+
             if let currentTrack = spotify.currentTrack {
                 if let track = currentTrack {
                     if let name = track.name {