Skip to content

Commit

Permalink
Merge pull request #120 from citelao/dev
Browse files Browse the repository at this point in the history
13.7
  • Loading branch information
citelao committed Feb 9, 2019
2 parents 8955b8e + 5ef2906 commit b7e8afb
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 25 deletions.
24 changes: 20 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
language: php
php:
- 5.5
- 5.6
# Travis and OSX aren't friends:
# https://github.com/orls/php-spx/blob/80bcf8252502380de73ab271feb6840db29b4ab7/.travis.yml
matrix:
include:
# `php: ..` in here is just descriptive/for UI, they don't affect installed ver.
- os: osx
php: "5.5"
language: generic
env: PHPENV=php55
- os: osx
php: "5.6"
language: generic
env: PHPENV=php56
- os: osx
php: "7.0"
language: generic
env: PHPENV=php70
before_install:
- sh ./script/travis_install.sh
install: make clean init
script: make build
deploy:
Expand All @@ -12,4 +28,4 @@ deploy:
skip_cleanup: true
on:
branch: master
tags: true
tags: true
21 changes: 14 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
# Changelog #

## v0.13.5 #
## v0.13.7 ##
- Fixed: Bump up the Spotify API version so Spotifious works again

## v0.13.6 ##
- Added: Version checker added to buildscript so I stop shipping incorrect versions numbers
- Fixed: Addressed a syntax error that prevented Spotify from returning properly

## v0.13.5 ##
- Added: Now checks for installed Spotify on startup
- Added: New hotkeys for playing albums and artists directly from search
- Changed: @philihp clarrified where build location is

## v0.13.4 #
## v0.13.4 ##
- Fixed: Compilation albums now have an icon
- Fixed: Can now add playlists with `\` in their titles
- Fixed: Removed light-colored edge of some icons

## v0.13.3.2 #
## v0.13.3.2 ##
- Fixed: Alfred variables are now more reliably passed to the workflow. Should
fix several people's configuration bugs

## v0.13.3.1 #
## v0.13.3.1 ##
- Added: there's a small install guide inside the Workflow menu
- Fixed: Small playlists now appear correctly
- Fixed: Playlist cache correctly on first run (thanks, @chrsblck!)

## v0.13.3 #
## v0.13.3 ##
- Added: Alfred-native hotkey activation means a huge speedboost to hotkeys
- Added: Cache your playlists to add them to search
- Fixed: API search now uses Authentication all the time
- Changed: Do not source control vendor/
- Changed: Use a newer version of JWilsson's API.
- Removed: Opt-out does not work with the Spotify API anymore, so it's removed (thanks @atabbott!)

## v0.13.2.1 #
## v0.13.2.1 ##
- Fixed: Setup bug where Spotifious expects client ID before it exists

## v0.13.2 #
## v0.13.2 ##
- Added: Use JSON output when possible
- Added: Exceptions appear in debugger for actions
- Changed: Search uses API with auth
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ build.images:
@echo "TODO COMPILE IMAGES"

.PHONY: build
build: init build.intermediates build.images
build: init check_version build.intermediates build.images
mkdir dist/
zip -q -x '*.git*' '*include/images/psd*' '*include/screenshots*' '*.psd' -r dist/Spotifious.alfredworkflow ./
zip -q -x '*.git*' '*include/images/psd*' '*include/screenshots*' '*.psd' -r dist/Spotifious.alfredworkflow ./

.PHONY: check_version
check_version:
php script/check_version.php
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Spotifious uses Packal to make sure you always have the latest version. It gives

## Download & Install ##

Latest version: [v0.13.5](https://github.com/citelao/Spotify-for-Alfred/archive/master.zip) | Latest dev build: [v0.13.5](https://github.com/citelao/Spotify-for-Alfred/archive/dev.zip)
Latest version: [v0.13.7](https://github.com/citelao/Spotify-for-Alfred/archive/master.zip) | Latest dev build: [v0.13.7](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.

Expand Down Expand Up @@ -111,6 +111,15 @@ Alfred version 3 and want to run these files from
the command line (`php -f main.php -- "args"`), you will need to run in debug
mode : `DEBUG=true php -f main.php -- "args"`.

### Deployment ###

1. Bump version here
2. Update `CHANGELOG`
3. Update `.alfredworkflow` version
4. Update Alfred forum
5. Update Packal
6. Update GitHub Pages site

## TODO ##

- Allow ``, `^`, and `` to function as modifiers (Open in Spotify, other things?).
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/Spotifious.alfredworkflow
Binary file not shown.
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ Spotifious works out of the box (just type `spotifious` in Alfred), but works be
</dict>
</dict>
<key>version</key>
<string>0.13.4</string>
<string>0.13.7</string>
<key>webaddress</key>
<string>https://github.com/citelao/Spotify-for-Alfred</string>
</dict>
Expand Down
36 changes: 36 additions & 0 deletions script/check_version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
// Check the version string to ensure we've updated it everywhere!
mb_internal_encoding("UTF-8");
date_default_timezone_set('America/New_York');
ini_set("display_errors", "stderr");

use OhAlfred\OhAlfred;
require 'vendor/autoload.php';

$alfred = new OhAlfred(false /* catch_errors */);

// Check CHANGELOG
$changelog_filename = $alfred->workflow() . "CHANGELOG.md";
$changelog = file_get_contents($changelog_filename);
$count = preg_match('/##\W*v?([\d.]*)/', $changelog, $matches);
$changelog_version = $matches[1];

// Check `info.plist`
$plist_version = $alfred->plist($alfred->workflow() . "info", "version");

// Check README
$readme_filename = $alfred->workflow() . "README.md";
$readme = file_get_contents($readme_filename);
$count = preg_match_all('/(\d+(?:\.\d+){2})/', $readme, $matches);
$potential_readme_version = $matches[0];

// Compare results
if($changelog_version != $plist_version || !in_array($changelog_version, $potential_readme_version)) {
fwrite(STDERR, "Version mismatch! One or more versions are not in sync:\n");
fwrite(STDERR, "\t" . $changelog_version . " - CHANGELOG (expected version)\n");
fwrite(STDERR, "\t" . $plist_version . " - plist latest version\n");
foreach ($potential_readme_version as $ver) {
fwrite(STDERR, "\t" . $ver . " - potential README version\n");
}
exit(1);
}
25 changes: 25 additions & 0 deletions script/travis_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# https://docs.travis-ci.com/user/multi-os/
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
# update & tap PHP!
brew update
brew tap homebrew/php

case "${PHPENV}" in
php55)
brew install php55
;;
php56)
brew install php56
;;
php70)
brew install php70
;;
esac

# install Composer
# https://github.com/phpmyadmin/phpmyadmin/commit/9ecda4175b6c19c781cf23254da151bfa15eb81a#diff-354f30a63fb0907d4ad57269548329e3
curl https://getcomposer.org/installer | php
ln -s $PWD/composer.phar /usr/local/bin/composer
fi
6 changes: 4 additions & 2 deletions src/citelao/OhAlfred/OhAlfred.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ class OhAlfred {
protected $plists = array();

// Set the exception handlers
public function __construct() {
set_error_handler(array($this, 'errorify'), E_ALL);
public function __construct($catch_errors = true) {
if($catch_errors) {
set_error_handler(array($this, 'errorify'), E_ALL);
}
}

// Get the current workflow name.
Expand Down
2 changes: 1 addition & 1 deletion src/citelao/Spotifious/Spotifious.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ protected function respondingSpotifyQuery($query) {
$as = new ApplicationApplescript("Spotify", $query . " \n return name of current track & \"\" & album of current track & \"\" & artist of current track & \"\" & spotify url of current track & \"\" & player state");
$result = $as->run();

return $this->splitSpotifyResponse($resp);
return $this->splitSpotifyResponse($result);
}

protected function splitSpotifyResponse($resp) {
Expand Down

0 comments on commit b7e8afb

Please sign in to comment.