Module: Ronnie::Client::Collections

Included in:
Ronnie::Client
Defined in:
lib/ronnie/client/collections.rb,
lib/ronnie/client/collections/albums.rb,
lib/ronnie/client/collections/artists.rb

Defined Under Namespace

Modules: Albums, Artists

Instance Method Summary collapse

Instance Method Details

#add_playlists_to_collection(playlists, options = {}) ⇒ Object

Add Playlists to Collection

Examples:

Ronnie.add_playlists_to_collection(['p1429320'])

Parameters:

  • playlists (Array)

See Also:



10
11
12
# File 'lib/ronnie/client/collections.rb', line 10

def add_playlists_to_collection(playlists, options={})
  post('addToCollection', { keys: playlists.join(', ') })
end

#add_tracks_to_collection(tracks, options = {}) ⇒ Object

Add Tracks to Collection

Examples:

Ronnie.add_tracks_to_collection(['t15940486'])

Parameters:

  • tracks (Array)

See Also:



20
21
22
# File 'lib/ronnie/client/collections.rb', line 20

def add_tracks_to_collection(tracks, options={})
  post('addToCollection', { keys: tracks.join(', ') })
end

#remove_playlists_from_collection(playlists, options = {}) ⇒ Object

Remove Playlists from Collection

Examples:

Ronnie.remove_playlists_from_collection(['p1429320'])

Parameters:

  • playlists (Array)

See Also:



30
31
32
# File 'lib/ronnie/client/collections.rb', line 30

def remove_playlists_from_collection(playlists, options={})
  post('removeFromCollection', { keys: playlists.join(', ') })
end

#remove_tracks_from_collection(tracks, options = {}) ⇒ Object

Remove Tracks from Collection

Examples:

Ronnie.remove_tracks_from_collection(['t15940486'])

Parameters:

  • tracks (Array)

See Also:



40
41
42
# File 'lib/ronnie/client/collections.rb', line 40

def remove_tracks_from_collection(tracks, options={})
  post('removeFromCollection', { keys: tracks.join(', ') })
end

#sync_playlists(playlists) ⇒ Object

Sync Playlists

Examples:

Ronnie.sync_playlists(['p1429320'])

Parameters:

  • playlists (Array)

See Also:



50
51
52
# File 'lib/ronnie/client/collections.rb', line 50

def sync_playlists(playlists)
  post('setAvailableOffline', { keys: playlists.join(', '), offline: true })
end

#sync_tracks(tracks) ⇒ Object

Sync Tracks

Examples:

Ronnie.sync_tracks(['t15940486'])

Parameters:

  • tracks (Array)

See Also:



60
61
62
# File 'lib/ronnie/client/collections.rb', line 60

def sync_tracks(tracks)
  post('setAvailableOffline', { keys: tracks.join(', '), offline: true })
end

#unsync_playlists(playlists) ⇒ Object

Unsync Playlists

Examples:

Ronnie.unsync_playlists(['p1429320'])

Parameters:

  • playlists (Array)

See Also:



70
71
72
# File 'lib/ronnie/client/collections.rb', line 70

def unsync_playlists(playlists)
  post('setAvailableOffline', { keys: playlists.join(', '), offline: false })
end

#unsync_tracks(tracks) ⇒ Object

Unsync Tracks

Examples:

Ronnie.unsync_tracks(['t15940486'])

Parameters:

  • tracks (Array)

See Also:



80
81
82
# File 'lib/ronnie/client/collections.rb', line 80

def unsync_tracks(tracks)
  post('setAvailableOffline', { keys: tracks.join(', '), offline: false })
end