Bugzilla – Bug 5681
Settings upgrade of boolean attributes doesn't work if default is On
Last modified: 2008-12-18 11:12:53 UTC
Settings upgrade on boolean attributes doesn't work if default value is On and the old value in 6.5 preferences is Off. As an example this happens in the Random Mix settings. The problem is migration code that looks like this: ===================== $prefs->migrate(1, sub { $prefs->set('newtracks', Slim::Utils::Prefs::OldPrefs->get('plugin_random_number_of_tracks') || 10 ); $prefs->set('oldtracks', Slim::Utils::Prefs::OldPrefs->get('plugin_random_number_of_old_tracks') || 0 ); $prefs->set('continuous', Slim::Utils::Prefs::OldPrefs->get('plugin_random_keep_adding_tracks') || 1 ); $prefs->set('exclude_genres', Slim::Utils::Prefs::OldPrefs->get('plugin_random_exclude_genres') || [] ); 1; }); ===================== The result is that if 'plugin_random_keep_adding_tracks' is 0 before the upgrade the code above will set 'continuous' to 1 after the upgrade. The 'plugin_random_number_of_old_tracks' property will work correctly since its default value is set to 0. The Random Mix plugin is one place where migration code like this exist, but I suspect the same problem might also exist in other places.
Andy says this will be fixed when we move to perl 5.10 or higher.
Not really, it will be fixed now it just requires a bit more code. :)
Fixed in change 14552.
This bug is being closed since it was resolved for a version which is now released! Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html If you are still seeing this bug, please re-open it and we will consider it for a future release.