Burgestrand/spotify

View on GitHub
CHANGELOG.md

Summary

Maintainability
Test Coverage
[HEAD][]
-----------

This change features a few large improvements:

- A bunch of API calls have been improved to remove FFI pointer juggling. Methods
  such as e.g. #session_create, or #link_as_string are now much easier to use. See
  https://github.com/Burgestrand/spotify/issues/19 for more details.
- Documentation has been much improved by (more or less) copying documentation
  from libspotify docs, and adding some notes and examples to it.
- All API calls are now called in a specific background thread, powered by the
  [Performer](https://rubygems.org/gems/performer) gem. This replaces the previous
  mutex lock around all API calls, and possibly fixes a lot of random deadlocks.
  See https://github.com/Burgestrand/spotify/issues/23.
- API reference documentation (YARD) has been added to all methods.
- Errors are no longer symbols, but actual errors inheriting from Spotify::APIError

Keep in mind that these changes are not backwards-compatible.

- [d80b9249] Make one class for each kind of error, instead of using symbols
- [0da56807] Move utility methods to Spotify::Util
- [72ee2526] Officially drop support for Ruby 1.9
- [dc492876] Perform *all* API calls in a specific Spotify thread
- [f5244743] A warning is now displayed on API mismatch instead of an error
- [dda1bc53] null pointers have been replaced by `nil`
- [98b5b1e0] Automatically encode country codes in #session_user_country
- [c8ad624e] Add #code and #symbol to Spotify::Error
- [77d1b978] Do not raise an error in Spotify.try when the resource is loading
- [f8293775] Print to stderr instead of stdout when libspotify cannot be found
- [c7042db6] Added Spotify.log (private API)

[v12.5.3][]
-----------

- [e09f64cc7] Add initial windows support

I’ve noticed callbacks cause libspotify to segfault. Not sure why; could
have something to do with with FFI callback support.

[v12.5.2][]
-----------

- [5245d932b] #link_create_from_string now accepts non-UTF8
- [349dfdc61] #link_create_from_string now accepts strings with NULL-bytes in them (it clips the string)
- [349dfdc61] #link_create_from_string now accepts empty strings without crashing
- [ef7ae9390] #link_create_from_string no longer throws a warning on UTF-8

[v12.5.1][]
-----------

- [b775947d6] Fix retaining class bug on Ruby 1.9.2

[v12.5.0][]
-----------
This release *also* breaks backwards-compatibilty, now all functions
accepting structs also have type-safety protection, similar to what
happens for pointers in v12.4.0.

Additionally, gem now supports JRuby and Rubinius explicitly!

- [a450bf27b9] implement type safety for all struct arguments
- [44b35d6432] automatic release for Subscribers struct
- [1c88809139] force application_key to be assigned as a string in SessionConfig
- [c9bc974d44] Subscribers now always have a :subscribers member
- [05e691c2aa] allow instantiating Subscribers from NULL
- [c83c9feb1c] Enable rbx-19mode on travis-ci.org
- [3e153a48f4] Enable jruby-19mode on travis-ci.org
- [72aadf4906] Use UTF8 everywhere, even in struct fields
- [e05b286118] Make Subscribers enumerable

[v12.4.0][]
-----------
This release breaks backwards-compatibility, as functions will no
longer accept pointers of any other type of what they expect. This
means that you must wrap any pointers in a Spotify::ManagedPointer
of the appropriate type before using them to call API functions.

Callbacks now receive actual structs (by reference) in their params,
instead of a pointer which needed to be manually casted.

- [1fe1abed6] refactor retaining class for all managed pointer
- [af54c02e1] **naive type-checking for all spotify objects**
- [1d6939cd8] monkeypatch-add FFI::AbstractMemory#read_size_t
- [b9ce8941c] unlock mutex for Spotify::Error.explain (considered thread-safe)
- [fd2490728] add Spotify::Struct#to_s/to_h
- [1cbaf4a64] **callbacks now receive structs by reference instead of raw pointer**

[v12.3.0][]
-----------
Lots of internal and external changes. You could almost say it’s a rewrite.

- [0ee03487a] added a Spotify::ManagedPointer (new Spotify::AutoPointer) for every object
- [0ee03487a] all functions now always return auto pointers
- [a88920c22] it’s now possible to create a Spotify::Subscriber with a count
- [aa26b1ed2] have all callbacks retain their pointer
- [a72469b04] use new libspotify gem for attaching libspotify dynamic library
- renamed the repository from libspotify-ruby to spotify
- [345b47472] all structs can now be initialized with a hash
- [e54f1c806] SessionConfig now accepts string as application key
- [37f1f883d] Added Spotify.try(method), and removed bang-calling notation
- [6e51b6c4e] Added a mutex around every Spotify API call

I might’ve missed something. Read the commits for the nitty gritty.

[v12.2.0][]
-----------
- fix SessionConfig missing ca_certs_filename struct field on Linux

__v12.1.0__
-----------
- erroneously released (wrong version number, does not follow version policy)

[v12.0.3][]
-----------
- add support for search_playlist (retrieves a playlist object directly from a search)

[v12.0.2][]
-----------
- use error checking in Spotify::Pointer add_ref and release

[v12.0.1][]
-----------
- add Spotify::Pointer, a FFI::Pointer that manages spotify pointer refcount!
- wrap object-creating methods that returns Spotify::Pointers, e.g. albumbrowse_create!
- add error-checking variants of all functions that return an error e. g. session_relogin!
- add Spotify::Error with it’s .explain and .disambiguate

[v12.0.0][]
-----------
- upgrade to libspotify v12.1.45

[v11.0.2][]
-----------
- make the error message on missing functions more friendly
- fix changelog formatting

[v11.0.1][]
-----------
- upgrade to libspotify v11.1.60

[v11.0.0][]
-----------
- raise more helpful error on missing libspotify
- upgrade to libspotify v11.1.56

[v10.3.0][]
-----------
- map :image_id to a ruby string instead of a pointer

[v10.2.2][]
-----------
- allow non-UTF8 strings for link_create_from_string and login password

[v10.2.1][]
-----------
- make all strings (both input and output) be in UTF8

[v10.2.0][]
-----------
- make :sampletypes an array of *actual* FFI types that can be read

[v10.1.1][]
-----------
- mark ALL libspotify functions as blocking

[v10.1.0][]
-----------
- fix Spotify::Subscribers for empty subscribers
- Up FFI version dependency to v1.0.11 (Spotify::Bool is no more)

[v10.0.0][]
-----------
- upgrade to libspotify v10 (see changelog for details)

[v9.1.0][]
----------
- Spotify::Subscribers now supports retrieving members by array index

[v9.0.1][]
----------
- mark sp_session_player_load as blocking

[v9.0.0][]
----------
- upgrade to libspotify 9
- loosen up dependency version constraints

[v8.0.5][]
----------
- improve documentation and remove YARD plugin
- add specs for return type and argument types of functions
- fix return type and arguments for a bunch of functions
- add typedefs for spotify pointers (makes better docs)
- allow setting SessionConfig boolean values to true/false
- optimize by using `:buffer_out` where applicable

[v8.0.2][]
----------
- fix arguments of `image_create`

[v8.0.1][]
----------
- mark some session functions as blocking

[v8.0.0][]
----------
- upgrade to libspotify v0.0.8 compatibility
  - 96k bitrate
  - offline functionality
  - improved image support

[v7.0.4][]
----------
- improve documentation

[v7.0.3][]
----------
- adjust definitions for 1.8.7 compatibility

[v7.0.2][]
----------
- insignificant

[v7.0.1][]
----------
- participate in http://test.rubygems.org/

[v7.0.0][]
----------
- first release
- add all function definitions and structs

v0.0.0
------
- release to register rubygems.org name

[HEAD]: https://github.com/Burgestrand/spotify/compare/v12.5.3...HEAD

[v12.5.3]: https://github.com/Burgestrand/spotify/compare/v12.5.2...v12.5.3
[v12.5.2]: https://github.com/Burgestrand/spotify/compare/v12.5.1...v12.5.2
[v12.5.1]: https://github.com/Burgestrand/spotify/compare/v12.5.0...v12.5.1
[v12.5.0]: https://github.com/Burgestrand/spotify/compare/v12.4.0...v12.5.0
[v12.4.0]: https://github.com/Burgestrand/spotify/compare/v12.3.0...v12.4.0
[v12.3.0]: https://github.com/Burgestrand/spotify/compare/v12.2.0...v12.3.0
[v12.2.0]: https://github.com/Burgestrand/spotify/compare/v12.0.3...v12.2.0
[v12.0.3]: https://github.com/Burgestrand/spotify/compare/v12.0.2...v12.0.3
[v12.0.2]: https://github.com/Burgestrand/spotify/compare/v12.0.1...v12.0.2
[v12.0.1]: https://github.com/Burgestrand/spotify/compare/v12.0.0...v12.0.1
[v12.0.0]: https://github.com/Burgestrand/spotify/compare/v11.0.2...v12.0.0
[v11.0.2]: https://github.com/Burgestrand/spotify/compare/v11.0.1...v11.0.2
[v11.0.1]: https://github.com/Burgestrand/spotify/compare/v11.0.0...v11.0.1
[v11.0.0]: https://github.com/Burgestrand/spotify/compare/v10.3.0...v11.0.0
[v10.3.0]: https://github.com/Burgestrand/spotify/compare/v10.2.2...v10.3.0
[v10.2.2]: https://github.com/Burgestrand/spotify/compare/v10.2.1...v10.2.2
[v10.2.1]: https://github.com/Burgestrand/spotify/compare/v10.2.0...v10.2.1
[v10.2.0]: https://github.com/Burgestrand/spotify/compare/v10.1.1...v10.2.0
[v10.1.1]: https://github.com/Burgestrand/spotify/compare/v10.1.0...v10.1.1
[v10.1.0]: https://github.com/Burgestrand/spotify/compare/v10.0.0...v10.1.0
[v10.0.0]: https://github.com/Burgestrand/spotify/compare/v9.1.0...v10.0.0
[v9.1.0]: https://github.com/Burgestrand/spotify/compare/v9.0.1...v9.1.0
[v9.0.1]: https://github.com/Burgestrand/spotify/compare/v9.0.0...v9.0.1
[v9.0.0]: https://github.com/Burgestrand/spotify/compare/v8.0.5...v9.0.0
[v8.0.5]: https://github.com/Burgestrand/spotify/compare/v8.0.2...v8.0.5
[v8.0.2]: https://github.com/Burgestrand/spotify/compare/v8.0.1...v8.0.2
[v8.0.1]: https://github.com/Burgestrand/spotify/compare/v8.0.0...v8.0.1
[v8.0.0]: https://github.com/Burgestrand/spotify/compare/v7.0.4...v8.0.0
[v7.0.4]: https://github.com/Burgestrand/spotify/compare/v7.0.3...v7.0.4
[v7.0.3]: https://github.com/Burgestrand/spotify/compare/v7.0.2...v7.0.3
[v7.0.2]: https://github.com/Burgestrand/spotify/compare/v7.0.1...v7.0.2
[v7.0.1]: https://github.com/Burgestrand/spotify/compare/v7.0.0...v7.0.1
[v7.0.0]: https://github.com/Burgestrand/spotify/compare/v0.0.0...v7.0.0