- PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
- PARA_NOTICE_LOG("defaulting to dummy mood\n");
- change_current_mood(NULL); /* always successful */
- return PLAY_MODE_MOOD;
+ return ret;
+ if (current_play_mode == PLAY_MODE_MOOD)
+ close_current_mood();
+ else
+ playlist_close();
+ ret = activate_mood_or_playlist(arg, &num_admissible);
+ if (ret < 0) {
+ para_printf(&pb, "%s\n", para_strerror(-ret));
+ para_printf(&pb, "switching back to %s\n", current_mop?
+ current_mop : "dummy");
+ ret = activate_mood_or_playlist(current_mop, &num_admissible);
+ if (ret < 0) {
+ para_printf(&pb, "failed, switching to dummy\n");
+ activate_mood_or_playlist(NULL, &num_admissible);
+ }
+ }
+ para_printf(&pb, "activated %s (%d admissible files)\n", current_mop?
+ current_mop : "dummy mood", num_admissible);
+ result->data = pb.buf;
+ result->size = pb.size;
+ return 1;