rocksky 0.12.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c936595ae468fd702c1e78cb1ad3db497ae10bded7672754909c6b014c163bd
4
- data.tar.gz: 869b8de2f3e067e3e11cd114bcd40f3cdd6efac0930a477858b009d1b476e608
3
+ metadata.gz: c9d26267b45f471f9cda322cc761436e434d5282269bbf4849bf9b57a85dce91
4
+ data.tar.gz: 5c50a5a93410dfd5b1454273d07e1f0ccb121c52a6b32a87e49cc7884f7f8d08
5
5
  SHA512:
6
- metadata.gz: 7005add14ac829814cef5c34a78feb52878c97bd50218041408e46da223115b0f19c64a2d3710f75f3b389e5ef880cfcee3957047dfe2c181b239414c5cf512a
7
- data.tar.gz: 579dbe27c678f7460d13c0f75495afc8ea7216abe262bb0ca8069268232d1452b546e18dce29ea3d3918c8965e7215536c7a31364e55c4ec6247952fb2371b78
6
+ metadata.gz: ba39252bd1b17f33110c56092574ec14539b7ea40ce5338a576732f9ac7f6def7313d92e1a86a09e55c814b3b88918f08d6f4d76aebac909aaede594538478f5
7
+ data.tar.gz: ff24eaf530004037f4518d5a26c33ff814bf299bf0bdd815f297c7b8bdcb542c86a11d12f1be3062713320f8aa2671638a2ee82de1c2d50deea9693354fc8aa1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.0
4
+
5
+ - Added `Rocksky::Event` (`events`, `event`, `rsvps`, `artist_events`,
6
+ `put_rsvp`) over the new `app.rocksky.event.*` and
7
+ `app.rocksky.artist.getArtistEvents` lexicons.
8
+ - `match_song` candidates now carry `source`, `providerId`, `mbId`,
9
+ `mbReleaseId` and `mbArtists`; `album` is a hard filter and an unmatched
10
+ lookup returns an empty `matches` array without song fields.
11
+ - Remote player tracks accept `bitrate`, `waveform` (256 peaks) and
12
+ `waveformStatus`; controllers receive a `:command_error` event when a
13
+ target player rejects a command.
14
+
15
+ ## 0.13.0
16
+
17
+ - Regenerated the native core against the updated `app.rocksky.*` lexicons.
18
+ Scrobble and song payloads now carry the catalogue enrichment fields
19
+ (streaming links, `composer`, `label`, `genre`, `copyright_message`, `isrc`,
20
+ `mb_id`, `key`, `track_number`, `disc_number`, `duration`, `bpm`), albums
21
+ carry `discogs_release_id`, and artists carry `biography` / `born` /
22
+ `born_in` / `died`.
23
+ - Profiles gained `spotify_user`, `spotify_connected`, `googledrive` and
24
+ `dropbox`; notifications gained an enriched `subject`.
25
+ - Removed `spotify_token` from the profile payload — the API no longer returns
26
+ it, and `spotify_connected` covers the only part callers used.
27
+
3
28
  ## 0.11.0
4
29
 
5
30
  - Added `Rocksky::Filter`, a fluent RSQL builder (`eq`, `ne`, `gt`, `ge`,
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rocksky
4
+ # app.rocksky.event.* — indexed music events (community.lexicon.calendar.event
5
+ # records annotated by app.rocksky.event.music) and their RSVPs.
6
+ module Event
7
+ module_function
8
+
9
+ # Indexed music events, soonest first. Without a time window only unexpired
10
+ # events are returned; +include_past+ lists past events, most recent first.
11
+ # Filters: +artist+ (AT-URI, id or sha256), +did+ (publisher), +rsvp_by+
12
+ # (a DID that RSVP'd going/interested), +kind+, +genre+, +from+ / +to+
13
+ # (RFC-3339). Pass +token+ to get each event's "viewerRsvp". Returns
14
+ # { "events" => [...] }.
15
+ def events(artist: nil, did: nil, rsvp_by: nil, kind: nil, genre: nil, from: nil, to: nil,
16
+ include_past: false, limit: nil, offset: nil, token: nil, base: nil)
17
+ params = { artist: artist, did: did, rsvpBy: rsvp_by, kind: kind, genre: genre,
18
+ from: from, to: to, limit: limit, offset: offset }.compact
19
+ params[:includePast] = true if include_past
20
+ Rocksky.get("app.rocksky.event.getEvents", params, base: base, token: token)
21
+ end
22
+
23
+ # One music event by the AT-URI of either its calendar event record or its
24
+ # app.rocksky.event.music record.
25
+ def event(uri, token: nil, base: nil)
26
+ Rocksky.get("app.rocksky.event.getEvent", { uri: uri }, base: base, token: token)
27
+ end
28
+
29
+ # Who responded to an event, most recent first ({ "rsvps" => [...] }).
30
+ # +status+ narrows to one community.lexicon.calendar.rsvp#… token.
31
+ def rsvps(uri, status: nil, limit: nil, offset: nil, base: nil)
32
+ params = { uri: uri, status: status, limit: limit, offset: offset }.compact
33
+ Rocksky.get("app.rocksky.event.getEventRsvps", params, base: base)
34
+ end
35
+
36
+ # The music events an artist is billed on, soonest first
37
+ # ({ "events" => [...] }); +include_past+ adds past events, most recent first.
38
+ def artist_events(uri, include_past: false, limit: nil, offset: nil, base: nil)
39
+ params = { uri: uri, limit: limit, offset: offset }.compact
40
+ params[:includePast] = true if include_past
41
+ Rocksky.get("app.rocksky.artist.getArtistEvents", params, base: base)
42
+ end
43
+
44
+ # Set the viewer's RSVP on an event. +status+ is a
45
+ # community.lexicon.calendar.rsvp#{going,interested,notgoing} token; an
46
+ # existing RSVP record is reused. Returns { "uri" => ..., "status" => ... }.
47
+ def put_rsvp(uri, status, token:, base: nil)
48
+ # putRsvp's input is a JSON body, so it rides the body-carrying native
49
+ # call rather than the query-string Rocksky.post.
50
+ Rocksky.unwrap(C.rocksky_library_post(base.to_s, token.to_s,
51
+ "app.rocksky.event.putRsvp",
52
+ JSON.generate({ uri: uri, status: status })))
53
+ end
54
+ end
55
+ end
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "repo": "tsirysndr/rocksky",
3
- "tag": "bindings-v0.12.0",
3
+ "tag": "bindings-v0.14.0",
4
4
  "checksums": {
5
- "aarch64-apple-darwin": "b23d327021f00c260fb0ed2ca8792ef4cf6c98054da36b98ca4175bd1f774450",
6
- "aarch64-linux-gnu": "714609a9eedc63f31a651d7eb0d5092f43de229ad4045c1e3fa1725a6734c28a",
7
- "x86_64-apple-darwin": "bf86e4404adb3116f36e58f714eb4a6726b9612e3c3703f4c8b3444daa6fc4e5",
8
- "x86_64-linux-gnu": "c6c17133b0a734fc9d31a1a793932d9f11476384f103a4dbc193c7b2176ba10e",
9
- "x86_64-unknown-freebsd": "80a91622d51272f9c20cd85dd4acde3c95d4001614ad051982f86024266fd9c5",
10
- "x86_64-unknown-netbsd": "ffa478d378c39b1ba8381ffd3e7c874022bbda688208c498f048a41221d20daf"
5
+ "aarch64-apple-darwin": "1a7db9b8e3fe9d79ffbc7aa546039636a2bf66e5e18d6fa1b6d2a542a51a063a",
6
+ "aarch64-linux-gnu": "95fab942c479f712bfbb3b75dc6d3b9bd9d9783cfffd28fe0bfe76ad450bd102",
7
+ "x86_64-apple-darwin": "68c39d92d3caf4cc167c0c0858a9a56504099f3f0c9dc10287b789b7adf37cf2",
8
+ "x86_64-linux-gnu": "18bfd64ae27e287b9e7b73b06fb37bad10b1ff4bc91f72cb5b441d906d42e45c",
9
+ "x86_64-unknown-freebsd": "6ec0f2712cb18537b38622655ab5fbc75638b74df11d18ea46632084030063ab",
10
+ "x86_64-unknown-netbsd": "00fd064a0ef79773ac495da88b88552dfa17f73a94360b0f528ba055d9849260"
11
11
  }
12
12
  }
@@ -82,9 +82,11 @@ module Rocksky
82
82
  # Advertise the currently-playing track. Call whenever it changes, and
83
83
  # periodically (~every 1–4s) with a fresh +elapsedMs+ so controllers show
84
84
  # smooth progress. +track+ is a camelCase Hash. Optional audio info —
85
- # +codec+ (audio codec/container, e.g. "mp3", "flac") and +sampleRate+
86
- # (sample rate in Hz, e.g. 44100) — is included in the track payload when
87
- # set, and omitted otherwise.
85
+ # +codec+ (audio codec/container, e.g. "mp3", "flac"), +sampleRate+
86
+ # (sample rate in Hz, e.g. 44100), +bitrate+ (kbit/s), +waveform+ (exactly
87
+ # 256 amplitude peaks 0..255 in track-time order) and +waveformStatus+
88
+ # ("pending", "ready" or "unavailable") — is included in the track payload
89
+ # when set, and omitted otherwise.
88
90
  def set_now_playing(track)
89
91
  Rocksky.unwrap(C.rocksky_remote_player_set_now_playing(@ptr, JSON.generate(track)))
90
92
  end
@@ -168,10 +170,13 @@ module Rocksky
168
170
 
169
171
  # Register a handler for a server event type, one of +:devices+,
170
172
  # +:device_registered+, +:device_unregistered+, +:primary_changed+,
171
- # +:now_playing+, +:status+, +:queue+. The block receives the full
172
- # symbol-keyed event Hash. A +:now_playing+ event carries the advertised
173
- # track under +:track+, including optional +:codec+ / +:sampleRate+ audio
174
- # info when the player supplied it. Returns +self+ for chaining.
173
+ # +:now_playing+, +:status+, +:queue+, +:command_error+. The block receives
174
+ # the full symbol-keyed event Hash. A +:now_playing+ event carries the
175
+ # advertised track under +:track+, including optional +:codec+ /
176
+ # +:sampleRate+ / +:bitrate+ / +:waveform+ / +:waveformStatus+ audio info
177
+ # when the player supplied it. A +:command_error+ event (+:deviceId+,
178
+ # +:deviceName+, +:message+) means the target player rejected a command
179
+ # this controller sent. Returns +self+ for chaining.
175
180
  def on(event_type, &block)
176
181
  @handlers[event_type.to_sym] = block
177
182
  self
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rocksky
4
- VERSION = "0.12.1"
4
+ VERSION = "0.14.0"
5
5
  end
data/lib/rocksky.rb CHANGED
@@ -222,8 +222,9 @@ module Rocksky
222
222
  end
223
223
 
224
224
  # Resolve full canonical metadata for a bare title + artist (matchSong).
225
- # +album+ steers the match toward that release (case-insensitive) so a
226
- # remaster/live/single edition doesn't shadow the intended album.
225
+ # When +album+ is given only candidates matching that album (after
226
+ # normalization) are accepted; with no accepted candidate the response has an
227
+ # empty "matches" array and no song fields.
227
228
  def self.match_song(title, artist, album: nil, mb_id: nil, isrc: nil, base: nil)
228
229
  unwrap(C.rocksky_match_song(base.to_s, title, artist, album.to_s, mb_id.to_s, isrc.to_s))
229
230
  end
@@ -363,6 +364,7 @@ module Rocksky
363
364
  end
364
365
 
365
366
  require_relative "rocksky/equalizer"
367
+ require_relative "rocksky/event"
366
368
  require_relative "rocksky/filter"
367
369
  require_relative "rocksky/library"
368
370
  require_relative "rocksky/playlist"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocksky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rocksky
@@ -81,6 +81,7 @@ files:
81
81
  - exe/rocksky-console
82
82
  - lib/rocksky.rb
83
83
  - lib/rocksky/equalizer.rb
84
+ - lib/rocksky/event.rb
84
85
  - lib/rocksky/filter.rb
85
86
  - lib/rocksky/library.rb
86
87
  - lib/rocksky/manifest.json