Skip to content

Commit 20f59e9

Browse files
committed
Merge branch '2.2.3'
2 parents 1f6468c + 51dc7e0 commit 20f59e9

File tree

7 files changed

+40
-22
lines changed

7 files changed

+40
-22
lines changed

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ If you are looking for the Spotify Extension for Alfred Version 1, you can find
99
To install Spotify Controls in Alfred double click on `Spotify.alfredworkflow` or drag the workflow to the workflow window in Alfred.
1010

1111
## Using automatic updates
12-
The auto-updater is baked just for this extension. It will ping Github and get the last 5 releases of this extension. You can easily press `Enter` to install a new version or downgrade to an older version. If you would like to view the release first, simply `Control + Enter` to be taken directly to the release page on Github. Yep that's it. No more downloading squat from here.
12+
The auto-updater is baked just for this extension. It will ping Github and get the last 5 releases of this extension. You can easily press `Enter` to install a new version, or downgrade to an older version. If you would like to view the release first, simply `Control + Enter` to be taken directly to the release page on Github. You can also use `Option + Enter` to read the release notes for the release. Yep that's it. No more downloading squat from here.
1313

14-
### Get the 5 latest versions
14+
### Get the 5 latest releases
1515
```
1616
spot update
17+
18+
Enter = Install release
19+
Control + Enter = View codebase of release
20+
Option + Enter = Read the release notes for the release
1721
```
1822

1923
## Hotkeys
@@ -118,15 +122,17 @@ album Stakes is High
118122
track Sunshine
119123
```
120124

125+
You can `Control + Enter` on any result and start a radio station from that result. A normal `Enter` will just go to that result within Spotify.
126+
121127
## How to use Search (Old Method prior to 2.2.1, will always work)
122128

123129
You can also search inline with results showing up in the results panel of Alfred. Simply type `spot` followed by `artist` or `album` or `track` then your query. The results will start to appear in the file list within Alfred. After that, find the result you want and either press `Return` on your keyboard or click the result. Spotify will open and go directly to that result.
124130

125131
### Examples
126132
```
127-
spot artist De La Soul
128-
spot album Stakes is High
129-
spot track Sunshine
133+
spot search artist De La Soul
134+
spot search album Stakes is High
135+
spot search track Sunshine
130136
```
131137

132138
## Searching with images enabled (Thanks to [Robin Enhorn](https://github.com/enhorn) for this addition)
@@ -149,7 +155,7 @@ Easy, just press the Hotkey command of `Option + Command + R` and the workflow w
149155

150156

151157
### Using automatic updates
152-
The auto-updater is baked just for this extension. It will ping Github and get the last 5 releases of this extension. You can easily press `Enter` to install a new version, or downgrade to an older version. If you would like to view the release first, simply `Control + Enter` to be taken directly to the release page on Github. Yep that's it. No more downloading squat from here.
158+
The auto-updater is baked just for this extension. It will ping Github and get the last 5 releases of this extension. You can easily press `Enter` to install a new version, or downgrade to an older version. If you would like to view the release first, simply `Control + Enter` to be taken directly to the release page on Github. You can also use `Option + Enter` to read the release notes for the release. Yep that's it. No more downloading squat from here.
153159

154160
## Contributors
155161

@@ -174,6 +180,9 @@ The auto-updater is baked just for this extension. It will ping Github and get t
174180
* Added new `commands.php` file to keep track of commands and what to execute
175181
* Update release to 2.2.3 for auto-updater
176182
* Added various applescripts for commands requiring some logic
183+
* Removed the shorcuts for `spot artist {SEARCH}`, `spot album {SEARCH}` and `spot track {SEARCH}` to avoid conflicts, now required to use the hotkey shortcut or type `spot search artist|album|track {SEARCH}`. Hotkey is recommended :)
184+
* Added the ability to hit `Control + Enter` on a search result to start a radio station from that result
185+
* Added the ability to read about a specific release by using `Option + Enter` on an auto-update search result
177186

178187
### 2.2.2 - July 7, 2013
179188
* Added support for automatic updates `spot update`

Spotify.alfredworkflow

124 Bytes
Binary file not shown.

autocomplete.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
<?php
22
include dirname(__FILE__) . '/autoload.php';
33
include dirname(__FILE__) . '/shared/commands.php';
4-
5-
$query = (isset($argv[1])) ? trim(strtolower($argv[1])) : null;
6-
$tmp = explode(' ', $query);
7-
$c = $tmp[0];
8-
$len = strlen($c);
4+
include dirname(__FILE__) . '/shared/query.php';
95

106
$results = array();
11-
foreach ($commands as $key => $arr) {
12-
if (empty($query) || substr($key, 0, $len) == $c) {
7+
foreach ($commands as $k => $arr) {
8+
if (empty($query) || substr($k, 0, $len) == $key) {
9+
$query = ($space === false) ? $k : $query;
1310
array_push($results, array(
14-
'uid' => $key,
11+
'uid' => $k,
1512
'arg' => $query,
1613
'title' => $arr['title'],
1714
'subtitle' => $arr['subtitle'],
1815
'icon' => 'icon.png',
19-
'autocomplete' => $key
16+
'autocomplete' => $k
2017
));
2118
}
2219
}

execute.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22
include dirname(__FILE__) . '/autoload.php';
33
include dirname(__FILE__) . '/shared/commands.php';
4+
include dirname(__FILE__) . '/shared/query.php';
45

56
$app_dir = dirname(__FILE__) . '/applescripts/';
6-
$query = (isset($argv[1])) ? trim(strtolower($argv[1])) : null;
7-
$tmp = explode(' ', $query);
8-
$key = $tmp[0];
97
$query = trim(str_replace($key, '', $query));
108

119
if (array_key_exists($key, $commands)) {

libs/Releases.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public static function get($repo, $release, $user='phpfunk', $max_releases=5)
2727

2828
$title = 'Version ' . $release;
2929
if ($current > $n) {
30-
$subtitle = 'Downgrade to version ' . $release . '. (Ctrl+Enter to view this release)';
30+
$subtitle = 'Downgrade to version ' . $release . '.';
3131
}
3232
elseif ($current < $n) {
33-
$subtitle = 'Upgrade to version ' . $release . '. (Ctrl+Enter to view this release)';
33+
$subtitle = 'Upgrade to version ' . $release . '.';
3434
}
3535
else {
3636
$title .= ' (Current Version)';
37-
$subtitle = 'This is the version you are currently running.';
37+
$subtitle = 'This is the version you are running.';
3838
}
3939

4040
array_push($releases, array(

shared/commands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
);
139139

140140
$clones = array(
141-
'prev' => '<',
141+
'prev' => '<<',
142142
'next' => '>',
143143
'pause' => 'play',
144144
'stop' => 'play',

shared/query.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
$query = (isset($argv[1])) ? trim(strtolower($argv[1])) : null;
3+
$space = false;
4+
5+
if (stristr($query, ' ')) {
6+
$tmp = explode(' ', $query);
7+
$key = $tmp[0];
8+
$space = true;
9+
}
10+
else {
11+
$key = $query;
12+
}
13+
14+
$len = strlen($key);

0 commit comments

Comments
 (0)