<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

Setup support for ratings

From SqueezeboxWiki

Revision as of 21:38, 8 May 2008 by Erland (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Overview

This section describes how you setup rating support in SlimServer. The requirements we have on the setup is:

  • It shall be possible to change ratings with remote
  • It shall be possible to change ratings from web interface
  • Ratings shall be shown in all track listings in web interface
  • Ratings shall be shown for currently played track on SqueezeBox/Transporter display
  • Ratings shall be shown for each track when browsing SqueezeBox/Transporter with the remote control
  • Ratings shall be persistent and survive a SlimServer rescan
  • Ratings shall be backed up automatically

Installation

Install the following plugins:

  1. TrackStat plugin
  2. MusicInfoSCR plugin
  3. iTunes Update plugin (Needed if you like to use iTunes as the storage for ratings)

Configuration of rating behaviour

Rating scale

The first thing we need to do is to decide if we are going to use a rating scale of 1-10 or 1-5. By default the TrackStat plugin provides a rating scale of 1-5, if you like to change this so a rating scale of 1-10 is used instead you do as follows:

  1. Goto Server Settings in web interface
  2. Select Plugins
  3. Step down to the TrackStat section
  4. Find the setting: Rating scale from 1-10 and change it to on
  5. Click Change to store the changes

There is no problem to change the rating scale at a later time if you can't decide now which one to use. The ratings are internally stored as a number between 1-100 in both cases, so changing this setting doesn't affect the previously set rating values.

Automatic ratings

The next thing we also needs to decide if we like all ratings to be set manually by the user or if we want SlimServer to automatically set, increase or decrease ratings based on the amount of a track that is played. If automatic rating is enabled this means that playing the whole track or almost the whole track will increase the ratings while skipping to next track early will decrease the ratings. By default automatic rating is turned off, so if you want tracks to be automatically rated you will have to enable it as follows:

  1. Goto Server Settings in web interface
  2. Select Plugins
  3. Step down to the TrackStat section
  4. Find the setting: Automatic rating and change it to on
  5. If you don't like unrated tracks to be automatic rated you also need to change Automatic rating of non rated tracks to off. By default both unrated and previously rated tracks are affected by the automatic rating.
  6. You may also want to look at the Automatic rating decrease percentage and Automatic rating increase percentage settings that decides how much of a track that needs to be played for a rating to be increased or decreased. Note that it is not recommended to set the Automatic rating increase percentage higher than 80% because, due to buffering a higher value can cause the condition to never be fulfilled.
  7. Click Change to store the changes

Setting ratings with active screen saver

I have seen some problem when changing rating on currently rated track when the screen saver is activated. The problem is that when the screen saver is deactivated by holding a number on the remote down this might cause a scroll action and then the rating to be set, the result is that the rating is set to wrong track. To solve this there is a setting in TrackStat that will disable scrolling using numbers in the Now Playing screen, to deactivate numerical scrolling do as follows:

  1. Goto Server Settings in web interface
  2. Select Plugins
  3. Step down to the TrackStat section
  4. Find the Disable number scroll setting and change it to on
  5. Click Change to store the changes

Configuration of rating display

This step will make the ratings visible in all the standard track listings in web interface and on SqueezeBox/Transporter display. By default ratings are only shown in the TrackStat menu and web interface and also when viewing track details for a song. This step will will show ratings directly in the track listings without the need to step down to the track details.

Web interface

  1. Goto Server Settings in web interface
  2. Select Formatting
  3. Step down to the TITLE FORMAT parameter. The title format contains a number of keywords that will be replaced by real values, after TrackStat has been installed there is a number of keywords that represents ratings available (TRACKSTATRATINGDYNAMIC, TRACKSTATRATINGSTATIC, TRACKSTATRATINGNUMBER), see TrackStat plugin documentation for more information regarding these.
  4. Make sure the title format you want to use on the SqueezeBox interface is available. In this example we are going to use
    TRACKNUM. TITLE (TRACKSTATRATINGDYNAMIC)
    If the title format you want to use doesn't exist add it on the last empty line and click Change. Please note that you will need to make sure that both the format you like to use in the web interface is available and also the format you want to use on the SqueezeBox/Transporter display.
  5. Select the radio button between the TRACKNUM. TITLE (TRACKSTATRATINGDYNAMIC) as the current title format to use in the web interface. If you like to use another format you should of course choose that instead.
  6. Click Change to store the changes
  7. The result of this is that a track listing in the web interface that previously was shown as:
    4. Long Night from Borrowed Heaven by The Corrs
    will now instead be shown as:
    4. Long Night (***) from Borrowed Heaven by The Corrs

Browse menus on SqueezeBox/Transporter

Now the next step is to configure which title format to use on the SqueezeBox/Transporter display.

  1. Goto Player Settings in the web interface for a specific SqueezeBox/Transporter
  2. Step down to the TITLE FORMAT parameter.
  3. Select the title format to use on the SqueezeBox/Transporter. In this example we will select the format TRACKNUM. TITLE (TRACKSTATRATINGDYNAMIC), if you like to use another one use select the one you like to use.
  4. Click Change to store the changes
  5. The result of this is that a track on SqueezeBox/Transporter display that previously shown
    4. Long Night
    will now instead be shown as:
    4. Long Night (***)

Now Playing

The next step is to configure the contents of the Now Playing screen.

  1. Goto Player Settings in the web interface for a specific SqueezeBox/Transporter
  2. Step down to the SCREEN SAVER parameter and change Choose a screensaver to use when playing to Music Information Screen
  3. Click Change to store the changes
  4. Goto the Music Information Screen section at the top of the page
  5. Step down to the SCREEN SAVER section
  6. Change Top left setting to PLAYING (X_OF_Y) (TRACKSTATRATINGSTATIC)
  7. Change Top right setting to PLAYTIME_PROGRESS
  8. Change Bottom left setting to TRACKNUM. ARTIST - TITLE
  9. Empty the Buttom right setting
  10. Change Show icons for Repeat/Shuffle to Don't show icons
  11. Click Change to store the changes
  12. Step down to the CUSTOMIZE PLAYLIST DISPLAY parameter
  13. Make sure the Customize playlist display is set to Use screen saver settings
  14. Click Change to store the changes

The result of this is that our Now Playing screen that previously looked like this:
Softsqueeze setupratings before.png

Now instead will look like this:
Softsqueeze setupratings after.png

The Now Playing screen will cache some information by default when using the MusicInfoSCR plugin, the result is that when you change a rating the new rating value will not be displayed until the display has change to another track. To correct this you will need to do as follows:

  1. Goto Server Settings in web interface
  2. Select Plugins
  3. Step down to the MUSIC INFORMATION SCREEN - FORMAT WHITELIST section
  4. Select TRACKSTATRATINGSTATIC in the first list box. All format keywords selected here will be refreshed directly and not cached, so if you used some of the other rating keywords in the Now Playing configuration you need to select them here also.
  5. Click Change to store the changes

Configuration of backup

Usually it takes a lot of time to put ratings on all your tracks, this also makes it extremely important that the ratings isn't lost. Since TrackStat stores the ratings in a separate table in the database the risk that the ratings will be lost is pretty small, but sometimes you might get instructions regarding other problems to remove different cache files and sometimes this includes the database files that contains the ratings. To make sure the ratins aren't lost it is important that we make backup of them. TrackStat provides a way to do regular backup of the whole TrackStat statistic data every night which includes the ratings. To setup this, do as follows:

  1. Goto Server Settings in web interface
  2. Select Plugins
  3. Step down to the TrackStat section
  4. Find the Backup dir setting and specify a directory which exists somewhere on your harddrive. Its preferable that this is a directory somewhere outside the slimserver installation to avoid that you remove it by accident, for example when upgrading to a new SlimServer version by uninstalling the previous SlimServer installation.
  5. You might also want to look at the Backup time setting which specifies when the backup should be performed. If your computer is turned off when this time occur the backup will instead be performed the next time SlimServer is started, so you don't have to have the computer on when this time occur.
  6. Click Change to store the changes

Note!!!!
The above will create a new backup file every night, there is no clean up logic implemented in TrackStat today which means that this will eventually fill your disk unless you manually remove backup files. It is recommended that you have routine to once a month remove backup files that are older than a month to avoid a full disk. A recommendation is to save at least one backup file for each month to make sure you have an old backup which you can restore if you notice a problem several months after it has occurred.

Configuring iTunes as the rating storage

If you are using iTunes and want the ratings to be stored in iTunes and just want SlimServer to be able to use the ratings there is two options available.

  • iTunes Update plugin: If you are running SlimServer and iTunes on the same computer and you are using the same music file format for your music in iTunes and SlimServer.
  • TrackStat plugin: If you are running SlimServer and iTunes on different computers or you are using different file formats in iTunes and SlimServer, for example FLAC in SlimServer and mp3 in iTunes. Note that only iTunes on Windows is fully supported by the TrackStat integration.

If you are able to use iTunes Update in your configuration I recommend you to use it instead of the TrackStat version. The reason is that the iTunes Update plugin is built for the single purpose of exchanging ratings with iTunes while TrackStat only makes some special options available that isn't supported in the iTunes Update plugin yet. TrackStat doesn't and probably never will have focus on making a good iTunes integration, instead the focus will be on making the rating and statistic support work good in SlimServer.

iTunes integration with iTunes Update

It will not be described here in details how to do this configuration, instead see the documentation provided with the [iTunes Update plugin.

The principles how it works is as follows:

  • When a rating is changed in SlimServer the iTunes Update plugin can be configured to:
    • Write it to a log file, which can be imported to iTunes with a script later
    • Write it directly to the iTunes application, iTunes will be started and will be running the whole time if you choose this way
  • When SlimServer performs a rescan it will import any ratings set in iTunes which arent already in SlimServer

iTunes integration with TrackStat

The TrackStat integration with iTunes supports the following:

  • Export of all ratings in SlimServer to iTunes, typically this is only used once initially if you have started with SlimServer only and now wants to start using iTunes instead.
  • Import of all ratings in iTunes to SlimServer. This is performed automatically by standard slimserver during rescan if iTunes and SlimServer is running on the same computer, so this option is really only useful in the case when iTunes and SlimServer is running on different computers.
  • Write all ratings changed in SlimServer to a log file, which can be imported to iTunes with a script later

To give an example of how to setup this integration, lets say we are having the following configuration:

  • Computer 1
    • Windows XP as operating system
    • Running iTunes
    • Music files available as MP3 format with paths:
      • C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\iTunes Music\Artist1\Album1\Track1.mp3
      • C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\iTunes Music\Artist2\Album1\Track1.mp3
  • Computer 2
    • Linux as operating system
    • Running SlimServer
    • SlimServer Music Folder points to: /home/slimserver/music
    • Music files available in FLAC format with paths:
      • /home/slimserver/music/Artist1/Album1/Track1.flac
      • /home/slimserver/music/Artist2/Album1/Track1.flac
    • Mounts the My Music directory from Computer 1 so files in MP3 is available as:
      • /mnt/mp3music/iTunes/iTunes Music/Artist1/Album1/Track1.mp3
      • /mnt/mp3music/iTunes/iTunes Music/Artist2/Album1/Track1.mp3


  1. Goto Server Settings in web interface
  2. Select Plugins
  3. Step down to the TrackStat section
  4. Find the Enable dynamic iTunes integration setting and change it to: on
  5. Find the Path to iTunes Music Library.xml setting and change it to: /mnt/mp3music/iTunes/iTunes Music Library.xml
  6. Find the iTunes history file directory setting and change it to: /mnt/mp3music/iTunes/ (SlimServer must have write access to this directory, so if it hasn't you should point this parameter to some other directory)
  7. Find the Path to iTunes Music (export) setting and change it to: C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\iTunes Music
  8. Find the Path to iTunes Music (import) setting and change it to: /home/slimserver/music
  9. Find the File extension to use in files imported from iTunes setting and change it to: .flac
  10. Find the File extension to use in files exported to iTunes setting and change it to: .mp3

The configuration part should now be finished, in this setup SlimServer will fill the following file with information about changed ratings when you change a rating in SlimServer:
/mnt/mp3music/iTunes/TrackStat_iTunes_Hist.txt

You should at regular intervals write the ratings to iTunes by doing as follows:

  1. Make sure the TrackStat_iTunes_Hist.txt file is available on Computer 1
  2. On Computer 1 run:
perl TrackStatiTunesUpdateWin.pl "C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\TrackStat_iTunes_Hist.txt"
The ratings in iTunes will now be updated with the latest changes in SlimServer


If you have previously used iTunes and want to import all iTunes ratings to SlimServer you now do as follows:

  1. Select Plugins
  2. Step down to the TrackStat section
  3. Click the Import from iTunes button
  4. The iTunes ratings should now be available in SlimServer

If you have ratings in SlimServer since before and what to overwrite the ratings in iTunes which these you do as follows:

  1. Select Plugins
  2. Step down to the TrackStat section
  3. Click the Export to iTunes button
  4. You should now get a file: /mnt/mp3music/iTunes/TrackStat_iTunes_Complete.txt, copy this to Computer 1 unless its already available there.
  5. On Computer 1 run:
perl TrackStatiTunesUpdateWin.pl "C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\TrackStat_iTunes_Complete.txt"
The ratings in iTunes will now be updated with all ratings from SlimServer

Configuring MusicIP as the rating storage

If you are using MusicIP and want the ratings to be stored in MusicIP and just want SlimServer to be able to use the ratings there is two options available.

  • The standard MusicMagic plugin in SlimServer: If SlimServer and MusicIP is running on the same computer and you only want to view ratings in SlimServer and will be changing the ratings using the MusicIP application directly.
  • TrackStat plugin: If you are running SlimServer and MusicIP on different computers or you are using different file formats in MusicIP and SlimServer, for example FLAC in SlimServer and mp3 in MusicIP.

If you are able to use the standard MusicMagic plugin in your configuration I recommend you to use it instead of the TrackStat version. The reason is that the MusicMagic plugin is built for the single purpose of exchanging information with MusicIP while TrackStat only makes some special options available that isn't supported in the MusicMagic plugin yet. TrackStat doesn't and probably never will have focus on making a good MusicIP integration, instead the focus will be on making the rating and statistic support work good in SlimServer.

Using standard MusicMagic plugin

It will not be described here in details how to do this configuration, instead see the documentation provided with SlimServer for any details.

The principles how it works is as follows:

  • Ratings changed in SlimServer will not be updated in MusicIP (at least not yet)
  • Ratings changed in MusicIP will be updated in SlimServer at the next rescan. Rescans towards MusicIP is performed at regular intervals so you don't have to do a manual rescan.

MusicIP integration with TrackStat

The TrackStat integration with MusicIP supports the following:

  • Export of all ratings in SlimServer to MusicIP, typically this is only used once initially if you have started with SlimServer only and now wants to start using MusicIP.
  • Import of all ratings in MusicIP to SlimServer. This is performed automatically by standard slimserver during rescan if MusicIP and SlimServer is running on the same computer, so this option is really only useful in the case when MusicIP and SlimServer is running on different computers.
  • Write all ratings changed in SlimServer to a MusicIP

To give an example of how to setup this integration, lets say we are having the following configuration:

  • Computer 1
    • Windows XP as operating system
    • Running MusicIP
    • Music files available as MP3 format with paths:
      • C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\iTunes Music\Artist1\Album1\Track1.mp3
      • C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\iTunes Music\Artist2\Album1\Track1.mp3
  • Computer 2
    • Linux as operating system
    • Running SlimServer
    • SlimServer Music Folder points to: /home/slimserver/music
    • Music files available in FLAC format with paths:
      • /home/slimserver/music/Artist1/Album1/Track1.flac
      • /home/slimserver/music/Artist2/Album1/Track1.flac


  1. Goto Server Settings in web interface
  2. Select Plugins
  3. Step down to the TrackStat section
  4. Find the Enable dynamic MusicIP Mixer integration setting and change it to: on
  5. Find the MusicIP Mixer Server Hostname setting and change it to the hostname of Computer 1
  6. Find the MusicIP Mixer Music Path setting and change it to: C:\Document and Settings\Steve Jobs\My Documents\My Music\iTunes\iTunes Music
  7. Find the File extension to use when importing from MusicIP Mixer setting and change it to: .flac
  8. Find the File extension to use when calling MusicIP Mixer setting and change it to: .mp3

The configuration part should now be finished, when a rating is changed in SlimServer it will now automatically be sent to MusicIP.
Note!
If you like changed ratings in MusicIP IP to be available in SlimServer you will need to perform a Import from MusicIP Mixer at regular intervals as described below.

If you have previously used MusicIP and want to import all MusicIP ratings to SlimServer you now do as follows:

  1. Select Plugins
  2. Step down to the TrackStat section
  3. Click the Import from MusicIP Mixer button
  4. The MusicIP ratings should now be available in SlimServer

If you have ratings in SlimServer since before and what to overwrite the ratings in MusicIP with these you do as follows:

  1. Select Plugins
  2. Step down to the TrackStat section
  3. Click the Export to MusicIP Mixer button
  4. The ratings in MusicIP will now be updated with all ratings from SlimServer

Usage

Changing ratings

There is a number of different ways you can change a rating with the remote:

  • When selecting a track in the Now Playing screen you can hold down one of the numerical buttons on the remote for 1-2 seconds to change the rating of the selected track. If a rating scale of 1-10 is used the button 0 is used to set a rating of 10.
  • In the Plugins/TrackStat menu you can browse the statistics in different ways and when standing on a Track you can hold down one of the numerical buttons on the remote for 1-2 seconds to change the rating of selected track. If a rating scale of 1-10 is used the button 0 is used to set a rating of 10.
  • In the web interface you can goto TrackStat and change ratings on currently played track
  • In the web interface you can goto TrackStat and browse different statistics, when viewing statistics you can change the rating of one of the tracks shown in the statistic.
  • If you are using the Custom Browse plugin you are also able to change ratings when selecting a track with the remote in one of the browse menus handled by Custom Browse. The rating is changed by holding down one of the numerical buttons on the remote for 1-2 seconds. If a rating scale of 1-10 is used the button 0 is used to set a rating of 10.

Browse music by ratings

If you like to browse your music by ratings there is a number of options available

  • You can use the Plugins/TrackStat menu on SqueezeBox/Transporter to browse the statistics using the remote
  • You can use the TrackStat web interface to browse the statistic
  • You can install the Custom Browse plugin which contains a browse menu for browsing music by ratings

Using ratings in smart/random playlists

The real advantage of having ratings occurs when you start to use ratings in smart playlists. There is a number of different solutions available for this.

  • You can install the SQL Playlist plugin which makes it possible to define and use smart playlists directly in slimserver. Using this it is possible to create a random playlist with only high rated tracks, or create a playlist that contains mostly high rated tracks but inserts a low rated tracks now and then.
  • If you are using iTunes as your rating source you can configure ratings to be sent to iTunes (see separate section) and define smart playlists in iTunes. These smart playlists will be updated and visible in SlimServer after a rescan.
  • If you are using MusicIP as your rating source you can configure ratings to be sent to MusicIP (see separate section) and define smart playlists in MusicIP, these smart playlists can then be sent to SlimServer from MusicIP.