From 922b9e2ae088e7061870bd6a2671cce7fd9586b2 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sun, 14 Mar 2004 00:11:07 +0000 Subject: [PATCH] fix static playlists --- src/mp3-scanner.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index c29f6a8c..5b4df1e4 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -261,19 +261,19 @@ int scan_init(char *path) { scan_mode_foreground=0; if(db_is_empty()) { scan_mode_foreground=1; - if(db_start_initial_update()) - return -1; } + if(db_start_initial_update()) + return -1; + DPRINTF(ERR_DEBUG,"%s scanning for MP3s in %s\n", scan_mode_foreground ? "Foreground" : "Background", path); err=scan_path(path); - if(scan_mode_foreground) - if(db_end_initial_update()) - return -1; + if(db_end_initial_update()) + return -1; scan_mode_foreground=0; @@ -374,6 +374,7 @@ void scan_static_playlist(char *path, struct dirent *pde, struct stat *psb) { fd=open(playlist_path,O_RDONLY); if(fd != -1) { db_add_playlist(playlistid,m3u_path,0); + DPRINTF(ERR_DEBUG,"Added playlist as id %d\n",playlistid); while(readline(fd,linebuffer,sizeof(linebuffer)) > 0) { while((linebuffer[strlen(linebuffer)-1] == '\n') || @@ -397,7 +398,7 @@ void scan_static_playlist(char *path, struct dirent *pde, struct stat *psb) { /* might be valid, might not... */ if(!stat(m3u_path,&sb)) { /* FIXME: check to see if valid inode! */ - db_add_playlist_song(playlistid,psb->st_ino); + db_add_playlist_song(playlistid,sb.st_ino); } else { DPRINTF(ERR_WARN,"Playlist entry %s bad: %s\n", m3u_path,strerror(errno));