-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathSubsonic.bsstrategy
34 lines (34 loc) · 1.2 KB
/
Subsonic.bsstrategy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Subsonic.plist
// BeardedSpice
//
// Created by Michael Alden on 6/16/2015.
// Copyright (c) 2014 Tyler Rhodes / Jose Falcon. All rights reserved.
//
BSStrategy = {
version:1,
displayName:"Subsonic",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*Subsonic*'",
args: ["URL"]
},
isPlaying: function () { return window.frames['playQueue'].jwplayer().getState() === 'PLAYING' },
toggle:function () { window.frames['playQueue'].jwplayer().play() },
next:function () { window.frames['playQueue'].onNext() },
favorite: function () { window.frames['playQueue'].onStar(window.frames['playQueue']).getCurrentSongIndex() },
previous:function () { window.frames['playQueue'].onPrevious() },
pause:function () { window.frames['playQueue'].jwplayer().pause(true) },
trackInfo: function () {
var index = window.frames['playQueue'].getCurrentSongIndex();
var playQueue = window.frames['playQueue'].songs[index];
var ret = playQueue.getCurrentSongIndex();
return {
'title': ret.title,
'album': ret.album,
'artist': ret.artist,
'favorited': ret.starred,
'image': ret.albumUrl.replace('main', 'coverArt').concat('&size=128'),
};
}
}