Module: Squeezer::Client::Database
- Included in:
- Squeezer::Client
- Defined in:
- lib/squeezer/client/database.rb
Instance Method Summary collapse
-
#abortscan! ⇒ Object
“The ”abortscan“ command causes Squeezebox Server to cancel a running scan.
- #albums ⇒ Object
- #artists ⇒ Object
- #genres ⇒ Object
- #rescan! ⇒ Object
-
#rescan_progress ⇒ Object
TODO format the return data better and make it useful.
- #scanning? ⇒ Boolean
- #total_albums ⇒ Object
-
#total_artists ⇒ Object
doesn’t include ‘Various Artists’.
- #total_genres ⇒ Object
- #total_tracks ⇒ Object
- #tracks ⇒ Object
-
#wipecache! ⇒ Object
The “wipecache” command allows the caller to have the Squeezebox Server rescan its music library, reloading the music file information.
Instance Method Details
#abortscan! ⇒ Object
“The ”abortscan“ command causes Squeezebox Server to cancel a running scan. Please note that after stopping a scan this way you’ll have to fully rescan your music collection to get consistent data.”
52 53 54 |
# File 'lib/squeezer/client/database.rb', line 52 def abortscan! cmd("abortscan") end |
#albums ⇒ Object
29 30 31 |
# File 'lib/squeezer/client/database.rb', line 29 def albums Models::Album.all end |
#artists ⇒ Object
25 26 27 |
# File 'lib/squeezer/client/database.rb', line 25 def artists Models::Artist.all end |
#genres ⇒ Object
37 38 39 |
# File 'lib/squeezer/client/database.rb', line 37 def genres Models::Genre.all end |
#rescan! ⇒ Object
41 42 43 |
# File 'lib/squeezer/client/database.rb', line 41 def rescan! cmd("rescan") end |
#rescan_progress ⇒ Object
TODO format the return data better and make it useful
65 66 67 |
# File 'lib/squeezer/client/database.rb', line 65 def rescan_progress extract_hash_from_data(cmd("rescanprogress")) end |
#scanning? ⇒ Boolean
45 46 47 |
# File 'lib/squeezer/client/database.rb', line 45 def scanning? cmd("rescan ?").to_boolean end |
#total_albums ⇒ Object
13 14 15 |
# File 'lib/squeezer/client/database.rb', line 13 def total_albums Models::Album.total end |
#total_artists ⇒ Object
doesn’t include ‘Various Artists’
9 10 11 |
# File 'lib/squeezer/client/database.rb', line 9 def total_artists Models::Artist.total end |
#total_genres ⇒ Object
21 22 23 |
# File 'lib/squeezer/client/database.rb', line 21 def total_genres Models::Genre.total end |
#total_tracks ⇒ Object
17 18 19 |
# File 'lib/squeezer/client/database.rb', line 17 def total_tracks Models::Track.total end |
#tracks ⇒ Object
33 34 35 |
# File 'lib/squeezer/client/database.rb', line 33 def tracks Models::Track.all end |
#wipecache! ⇒ Object
The “wipecache” command allows the caller to have the Squeezebox Server rescan its music library, reloading the music file information. This differs from the “rescan!” command in that it first clears the tag database. During a rescan triggered by “wipecache!”, “rescan?” returns true.
60 61 62 |
# File 'lib/squeezer/client/database.rb', line 60 def wipecache! cmd("wipecache") end |