Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master: Fixed incorrect notification glitch #63

Merged
merged 33 commits into from
Jan 6, 2016
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2ae6b59
plugin work whoo whoo
citelao Jan 29, 2015
0427a88
merge dev
citelao Jan 30, 2015
446eee1
timeout nonblocking
citelao Feb 20, 2015
5ed62b4
more work
citelao May 13, 2015
149a8be
fixed output glitch
citelao May 13, 2015
57e4dd7
Merge pull request #62 from citelao/hotfix-output
citelao May 13, 2015
5956652
sublime project
citelao May 14, 2015
1d2790e
Merge branch 'dev' into feature-plugin
citelao May 14, 2015
5d46aa5
I think I have API working
citelao May 15, 2015
a7d72e4
popup again and disabled checkbox
citelao May 15, 2015
aa153e9
settings menu
citelao May 15, 2015
c9b430b
returning
citelao May 15, 2015
da9a672
versions
citelao May 15, 2015
043d196
Merge pull request #64 from citelao/feature-plugin
citelao May 15, 2015
4c0d9f0
opt-out should work
citelao May 15, 2015
14b7760
Merge pull request #66 from citelao/feature-plugin
citelao May 15, 2015
76449c1
massive speed boost
citelao May 31, 2015
8c8b14a
massive speed boost
citelao May 31, 2015
673f6b5
fixed bug in new plists
citelao May 31, 2015
71dba32
some cleanups
citelao Jun 2, 2015
fc90505
removed sublime workspace
citelao Jun 10, 2015
98d7fb4
Fixing docs
citelao Jul 5, 2015
2efa95b
Added built version
citelao Jul 5, 2015
4cabf37
Fixing JSON errors
citelao Aug 17, 2015
f76070e
purge the workspace
citelao Aug 17, 2015
fd6a294
Travis CI
citelao Aug 17, 2015
ccc2bce
valid YML
citelao Aug 17, 2015
3faa725
valid travis YML
citelao Aug 17, 2015
b26be9c
skip testing for now
citelao Aug 17, 2015
6e63ec4
github deployment
citelao Aug 17, 2015
639dfb3
Added a playpause control panel action
citelao Jan 6, 2016
d81caa4
Fixed looping bugs
citelao Jan 6, 2016
bb4bad2
Merge pull request #69 from citelao/feature/cleanup
citelao Jan 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
artwork/*.png
output.html
*.sublime-workspace
# my private data
*.sublime-workspace
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: php
php:
- 5.4
- 5.5
- 5.6
install: make clean init
script: make build
deploy:
provider: releases
api_key:
secure: jeJ1Dw4sMhttDclMPJ7bzWgVhn8NPF8QdGS2b85RICTU8+Z6rDsN9xwwhzbfyHVT16cmlB6GSPkX8Vhxw6BM8IiFFxN07S3uK6wNvzunUKkZqAh/o3hvpniRmmOmmTZfOCFhEZRuyYeng+NnNaHAU3bvH3tnRMuJUq9tKUqusw7Vbp7driQu2J5hvr7rgIu/mw+4SI16q6jshx6Vsc4owAyFGjt3vtTf+jke8aEqZOiweeRYJY7lDTf3jlSHiqeOOZm204M6v3FY32TIOIX3NQEFqjmAyGcSBXN89n31ufLAKOageTZOEqdffiPXgYfO8YAT5n/FupFcW6MaAH55PQUHVWhccYsRL80ix7h/xQ+PUFXS55AZR4B1AGVzkTZhrn5eJTtMyP+JevKX3SgjmK0uxfV4ckEEPSNPHIHpImP6gkUts3JlcxKhWH3htN7dh8XEfhQ4fK3zvhxVk/syS8QQ5eXOHrhkcjsnmx0BhlNyjLEeO0bxa0AvQOltEfsrNbicEr9z5i+GcI98HJeVWWUE4ZncLKK8wQffs3ONtrZVcCcLNhvIJrhjg27/Jr953DMi1SexgFyrDax0gOAmjwU3J4XhmNSKgNNxZlpZE5OcVSO5wKz7aZUTbOSfp6JcfpsU/uX+P+348Ve2X68gQWvrZPU/Wwuu7JB/w43+aeI=
file: dist/Spotifious.alfredworkflow
skip_cleanup: true
on:
branch: master
Binary file removed 4BB22960-369A-4674-AF29-00CCE1603B53.png
Binary file not shown.
Binary file removed 8020A500-17C9-43BA-B17A-00D35E460EB6.png
Binary file not shown.
Binary file removed 86EAA0E6-6086-4BC4-8CE7-0673F392C77F.png
Binary file not shown.
Binary file removed B02E0659-E11A-4746-ADB7-2C2C0A8BD8BB.png
Binary file not shown.
Binary file removed C5E43F66-AD1D-4D8D-9E4A-D7855C8F5AE2.png
Binary file not shown.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Added: new settings menu.
- Added: you can now *disable* track notifications
- Fixed: track notifications say the right thing in Spotify 1.0
- Fixed: control panel stays open properly
- Fixed: weird looping volume changes

## v0.12 ##
- Added: compatiblity with Alfred Remote
Expand Down
Binary file removed F1B61D14-D686-468D-9373-AB4FC3EEE3C8.png
Binary file not shown.
2 changes: 2 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ You may do what you want with this program and its source subject to these restr
- You MUST respect the licenses for the software below
- You MUST NOT misrepresent this software as yours.

Furthermore, I am not responsible or liable for any problems that might occur from you using this software. I provide no warranty or guarantee on this software, and I am not liable for any damages, claims, or liabilities of *any* sort that might arise from this software in any way.

## Entypo

Entypo pictograms by Daniel Bruce — www.entypo.com
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY = all init clean build

all: clean build

init:
composer install

clean:
-rm -r dist/

build:
mkdir dist/
zip -x '*.git*' '*include/images/psd*' '*.psd' -r dist/Spotifious.alfredworkflow ./
38 changes: 13 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Spotifious uses Packal to make sure you always have the latest version. It gives

Latest version: [v0.13](https://github.com/citelao/Spotify-for-Alfred/archive/master.zip) | Latest dev build: [v0.13](https://github.com/citelao/Spotify-for-Alfred/archive/dev.zip)

An in-depth [installation guide](http:https://ben.stolovitz.com/Spotify-for-Alfred/download/) is available on the Spotifious website.

1. [Download](https://github.com/citelao/Spotify-for-Alfred/archive/master.zip)
this repository.
2. Open `Spotifious.alfredworkflow` by double-clicking it or dragging it into
Expand All @@ -43,11 +45,10 @@ Alfred.
5. Click `Save` to store the binding.
6. Bind the other hotkeys as you wish. Their actions are visible in the `Text` field, under `Argument`.
7. Pop up Spotifious with the key command you set— I would have `^⌘⏎`.
8. Follow the instructions on the settings menu.
9. You'll be asked to type in your country.
- Type it in, if you'd like. This option is recommmended.
- Choose `I'd rather not give a country!`. The country is stored locally and only sent to Spotify to narrow results, with no other identifying information, but Spotifious can avoid that if you'd prefer. Choosing this option will noticeably degrade your search results.
- You can always change your settings by typing `s` at the main menu.
8. Follow the instructions on the set-up menu.
1. You'll be asked to choose your country (for better search results— you can opt out).
2. You'll create a Spotify application (or not, you can opt out).
3. You'll link the new app to Spotifious.
10. Continue on with your merry day— but now with Spotifious.

![A visual install guide](include/screenshots/install.png)
Expand Down Expand Up @@ -105,23 +106,10 @@ Oh, and thanks for reading this whole README. I hope you enjoy Spotifious!

## Changelog ##

See `CHANGELOG.md` for more detailed information.

- v0.13: Preliminary Web API; toggle track notifications
- v0.12: Compatible with Alfred Remote
- v0.11.2: Location opt-out and tutorial
- v0.11.1: Fixed response freezing
- v0.11: New API, hotkeys, and notifications
- v0.10: Location-based filtering
- v0.9.4: Actually implemented the aforementioned changes
- v0.9.3: More compatibility changes for PHP v5.3
- v0.9.2: Compatibility changes for PHP v5.3
- v0.9.1: Fixed "no track" bug.
- v0.9: Added error reporting and context-based searching; restructrued app.
- v0.8: Added new icons; set them as default
- v0.7: General clean-up; added artist- and album-specific menus
- v0.6: Added Alleyoop support
- v0.5: Added a menu system
- v0.1: Inital search system

This code is MIT Licensed.
This project uses pseudo-SemVer. It will use SemVer when we hit v1.0.0.

See `CHANGELOG.md`.

## License ##

This code is licensed as written in the LICENSE.md file.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"autoload": {
"psr-4": {
"OhAlfred\\": "src/citelao/OhAlfred/",
"Spotifious\\": "src/citelao/Spotifious/"
"Spotifious\\": "src/citelao/Spotifious/"
}
},
"require": {
Expand Down
Binary file added dist/Spotifious.alfredworkflow
Binary file not shown.
48 changes: 44 additions & 4 deletions doc/spec.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# How Spotifious should work #

There are three specific types of output:
There are four specific types of output:

1. Main Menu — first activation
4. Generic Menu — list of options, used for settings menu.
2. Search Menu — user typing
3. Detail Menu — autocompleted text with Spotify URL

## Main Menu ##

`^⌘⏎` should show the main menu.

It should check for updates every so often and display an update bar occasionally.

1. ► Crooked Teeth ⏎ `playpause`
- ???
2. Plans ⏎ album detail
Expand All @@ -19,9 +22,33 @@ There are three specific types of output:
4. Search for music...
- Begin typing to search

## Generic Menu ##

We use this for the settings & setup menus.

### Setup menu ###

These are the options required for initial operation.

- Country Code
- should trigger a list of countries.
- Create a Spotify application
- should trigger the application-creation web server.
- Link Spotify application
- should open the Spotify login page for the new app.

### Settings Menu ###

These are all the original setup options, plus some additional ones.

- Track Notifications
- toggle notifications of next playing tracks

## Search Menu ##

After activation, any typing at all should show the search menu, unless the query requires a detail menu (see below). The results should be weighted so artists>albums>songs— but only if the query is completely contained by the result. `Lady Danv` should return Lady Danville, then Lady Danville EP, then songs. Otherwise sort by popularity; use a unique id for each query so popular searches follow Alfred's smart order.
After activation, any typing (3+ chars should work) should show the search menu, unless the query requires a detail menu (see below). The results should be weighted so artists>albums>songs— but only if the query is completely contained by the result. `Lady Danv` should return Lady Danville, then Lady Danville EP, then songs. Otherwise sort by popularity; use a unique id for each query so popular searches follow Alfred's smart order.

If the query starts with a `c`, include control items, like play, pause, shuffle, etc.

1. Lady Danville ⏎ artist detail
- ★★★★☆ Artist
Expand All @@ -32,9 +59,22 @@ After activation, any typing at all should show the search menu, unless the quer

## Detail Menu ##

I want to maintain easily navigable menus, but need to provide the Spotify URL in order to perform an artist or album lookup. To that end, the detail menu uses the syntax `spotify URL ► inital search request ►`. The script should use its smartness to detect a backspace (ie if the final triangle is missing) and provide a search menu with the initial search request. That way, a user can easily back up a level.
I want to maintain easily navigable menus & submenus, but need to provide the Spotify URL in order to perform an artist or album lookup. To that end, the detail menu uses a smart syntax, separated by some unicode glyphs (`►` & `⟩` maybe).

The query should have all URLs in hierarchical order, than all the queries in hierarchical order, followed by a closing separator:

`a menu url⟩a submenu url⟩another submenu url►query used in menu⟩query used in submenu⟩query used in final submenu⟩`

The different separator should be a sign that the query is parsable. If it isn't present, ignore the query.

This syntax will not be compatible with the old syntax.

### Playlist Detail ###

**Note**: Transferring from an artist detail menu to an album detail menu should add an additional spotify URL and an extra `►`; ie `artist URL ► album URL ► initial search request ►►`.
1. Liked from Radio ⏎ view in Spotify
- View playlist in Spotify
2. Sticking it to Myself ⏎ `open location <song>`
- Jonathan Coulton - Artificial Heart 2:20 ★★★☆☆

### Artist Detail ###

Expand Down
Binary file added include/images/commands/playpause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added include/images/psd/controls/playpause.psd
Binary file not shown.
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ Thank you everyone! Y’all made Spotifious as awesome as it is.

Also thank you for using Spotifious and reading the README; I hope you enjoy it.

This code is MIT Licensed.</string>
This code’s license can be found in LICENSE.md</string>
<key>uidata</key>
<dict>
<key>18496AC4-EA42-444C-A906-642E38259C96</key>
Expand Down
2 changes: 1 addition & 1 deletion main.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require 'vendor/autoload.php';

/**
* Spotifious (v0.10)
* Spotifious
* a natural Spotify controller for Alfred <https://github.com/citelao/Spotify-for-Alfred/>
* an Alfred extension by Ben Stolovitz <http:https://github.com/citelao/>
**/
Expand Down
11 changes: 11 additions & 0 deletions src/citelao/Spotifious/Menus/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Control implements Menu {

protected $query;
protected $search;

protected $commands = array(
Expand All @@ -21,10 +22,18 @@ class Control implements Menu {
'keys' => 'back',
'icon' => 'include/images/commands/previous.png',
'action' => 'previous⟩returnControls'
),

array(
'name' => 'Play/pause',
'keys' => 'playpause',
'icon' => 'include/images/commands/playpause.png',
'action' => 'playpause⟩returnControls'
)
);

public function __construct($query) {
$this->query = $query;
$this->search = mb_substr($query, 1);
}

Expand All @@ -46,6 +55,8 @@ public function output() {
'title' => 'Controls',
'subtitle' => 'Access this menu at any time by typing `c`',
'icon' => 'include/images/info.png',
'valid' => 'no',
'autocomplete' => $this->query
);

return $results;
Expand Down
4 changes: 2 additions & 2 deletions src/citelao/Spotifious/Spotifious.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ public function process($action) {
$song['url']);

} else if($command == 'volup') {
$as = new ApplicationApplescript("Spotify", "set sound volume to sound volume + 10");
$as = new ApplicationApplescript("Spotify", "if sound volume < 90 then \n set sound volume to sound volume + 10 \n else \n set sound volume to 100 \n end if");
$as->run();

} else if($command == 'voldown') {
$as = new ApplicationApplescript("Spotify", "set sound volume to sound volume - 10");
$as = new ApplicationApplescript("Spotify", "if sound volume > 10 then \n set sound volume to sound volume - 10 \n else \n set sound volume to 0 \n end if");
$as->run();

} else if($command == 'spotify') {
Expand Down
29 changes: 0 additions & 29 deletions testoauth.php

This file was deleted.

Empty file removed testresponse.php
Empty file.
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit76049c9ae64eb3029e1fc6a281e88caf::getLoader();
return ComposerAutoloaderInitd7270918ba4f2fa5e6e70be71bc482ee::getLoader();
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit76049c9ae64eb3029e1fc6a281e88caf
class ComposerAutoloaderInitd7270918ba4f2fa5e6e70be71bc482ee
{
private static $loader;

Expand All @@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit76049c9ae64eb3029e1fc6a281e88caf', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitd7270918ba4f2fa5e6e70be71bc482ee', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit76049c9ae64eb3029e1fc6a281e88caf', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitd7270918ba4f2fa5e6e70be71bc482ee', 'loadClassLoader'));

$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -44,7 +44,7 @@ public static function getLoader()
}
}

function composerRequire76049c9ae64eb3029e1fc6a281e88caf($file)
function composerRequired7270918ba4f2fa5e6e70be71bc482ee($file)
{
require $file;
}