Class: Shortwave::Model::Track
- Defined in:
- lib/shortwave/model/track.rb
Overview
A track. Tracks are taggable and sharable.
Attributes
name
-
Track name
id
-
Last.fm id
mbid
-
Musicbrainz ID
listeners
-
number of listeners
play_count
-
number of times played
duration
-
Track duration in milliseconds
url
-
Track url on Last.fm
artist
-
Track’s artist
album
-
Album track appears on.
Instance Method Summary collapse
-
#ban ⇒ Object
Don’t play this track again.
-
#fans ⇒ Object
This track’s fans.
-
#love ⇒ Object
Love this track.
-
#similar ⇒ Object
Similar tracks to this one.
-
#streamable? ⇒ Boolean
Can this track be streamed.
-
#tags ⇒ Object
The most popular tags applied to this track.
Methods inherited from BaseModel
facade_name, identified_by, inherited, link_to, #session=, sharable, shoutable, taggable
Instance Method Details
#ban ⇒ Object
Don’t play this track again.
54 55 56 57 |
# File 'lib/shortwave/model/track.rb', line 54 def ban @session.track_facade.love(name, artist.name) # TODO include scrobble api call end |
#fans ⇒ Object
This track’s fans
38 39 40 |
# File 'lib/shortwave/model/track.rb', line 38 def fans link :top_fans, :User, identifiers end |
#love ⇒ Object
Love this track
48 49 50 51 |
# File 'lib/shortwave/model/track.rb', line 48 def love @session.track_facade.ban(name, artist.name) # TODO include scrobble api call end |
#similar ⇒ Object
Similar tracks to this one.
43 44 45 |
# File 'lib/shortwave/model/track.rb', line 43 def similar link :similar, :Track, identifiers end |
#streamable? ⇒ Boolean
Can this track be streamed
60 61 62 |
# File 'lib/shortwave/model/track.rb', line 60 def streamable? @streamable end |
#tags ⇒ Object
The most popular tags applied to this track
33 34 35 |
# File 'lib/shortwave/model/track.rb', line 33 def link :top_tags, :Tag, identifiers end |