Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
RayPS committed Jun 20, 2021
1 parent c857506 commit c22f109
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 1 addition & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ An OBS script to display Spotify track info on macOS
```
{n} = Name
{a} = Artist
```

If Spotify App is not running, it will also display as paused
```
15 changes: 8 additions & 7 deletions spotify.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- Spotify Mac 1.0
-- Display Now Playing Track Info
-- Name: Spotify Mac 1.1
-- Description: Display Now Playing Track Info
-- Author: Ray (rayps.com)
-- Repo: https://github.com/RayPS/obs-spotify-mac/

obs = obslua

Expand All @@ -11,14 +12,14 @@ interval = 1

function update_text(source)
local result = spotify()
local paused = true
local text = "[Spofity not running]"
if result ~= "" then
result = split(result, ", ")
paused = (result[1] == "paused")
local paused = (result[1] == "paused")
local format = paused and format_paused or format_playing
text = format:gsub("{n}", result[2]):gsub("{a}", result[3])
end

local format = paused and format_paused or format_playing
local text = format:gsub("{n}", result[2]):gsub("{a}", result[3])
local settings = obs.obs_data_create()
obs.obs_data_set_string(settings, "text", text)
obs.obs_source_update(source, settings)
Expand Down Expand Up @@ -82,7 +83,7 @@ function script_description()
<h2>Spotify Mac</h2>
<h4>Display Now Playing Track Info</h4>
<p>{n} = Name &nbsp;&nbsp;&nbsp; {a} = Artist</p>
<p style="font-size: 11pt;"><i><a href="https://github.com/RayPS/obs-spotify-mac">version 1.0</a></i></p>
<p style="font-size: 11pt;"><i><a href="https://github.com/RayPS/obs-spotify-mac">version 1.1</a></i></p>
</center></body></HTML>]]
end

Expand Down

0 comments on commit c22f109

Please sign in to comment.