functions.php
changeset 33 3b4aef1efff6
parent 32 86140ed9087d
child 34 3b817b961984
equal deleted inserted replaced
32:86140ed9087d 33:3b4aef1efff6
    92 $playlist_last_md5 = '';
    92 $playlist_last_md5 = '';
    93 
    93 
    94 function rebuild_playlist()
    94 function rebuild_playlist()
    95 {
    95 {
    96   // import what we need
    96   // import what we need
    97   global $homedir, $playlist;
    97   global $playlist, $amarok_home;
    98   // sync and load the playlist file
    98   // sync and load the playlist file
    99   $playlist_file = dcop_action('playlist', 'saveCurrentPlaylist');
    99   $playlist_file = dcop_action('playlist', 'saveCurrentPlaylist');
       
   100   // do we have amarok's home?
       
   101   if ( !$amarok_home )
       
   102     $amarok_home = dirname($playlist_file);
   100   // check MD5 - if it's not changed, exit to save CPU cycles
   103   // check MD5 - if it's not changed, exit to save CPU cycles
   101   global $playlist_last_md5;
   104   global $playlist_last_md5;
   102   $effective_md5 = md5_playlist_file($playlist_file);
   105   $effective_md5 = md5_playlist_file($playlist_file);
   103   if ( $playlist_last_md5 == $effective_md5 )
   106   if ( $playlist_last_md5 == $effective_md5 )
   104   {
   107   {