+ ret = pl_get_def_by_name(current_playlist.name, &playlist_def);
+ if (ret < 0)
+ return ret;
+ ret = for_each_line(FELF_READ_ONLY, playlist_def.data,
+ playlist_def.size, search_path, new_path);
+ osl_close_disk_object(&playlist_def);
+ is_admissible = (ret < 0);
+ if (was_admissible && is_admissible)
+ return 1;
+ if (!was_admissible && !is_admissible)
+ return 1;
+ if (was_admissible && !is_admissible) {
+ current_playlist.length--;
+ return score_delete(row);
+ }
+ /* !was_admissible && is_admissible */
+ current_playlist.length++;
+ return score_add(row, 0); /* play it immediately */
+}
+
+/**
+ * Handle afs events relevant to playlists.
+ *
+ * \param event The event type.
+ * \param pb Unused.
+ * \param data Depends on the event type.
+ *
+ * \return Standard.
+ */
+int playlists_event_handler(enum afs_events event,
+ __a_unused struct para_buffer *pb, void *data)
+{
+ struct afsi_change_event_data *aced = data;
+
+ if (!current_playlist.name)
+ return 1;
+ switch (event) {
+ case AFSI_CHANGE:
+ return playlist_update_audio_file(aced->aft_row);
+ case AUDIO_FILE_RENAME:
+ case AUDIO_FILE_ADD:
+ return handle_audio_file_event(event, data);
+ case AUDIO_FILE_REMOVE:
+ if (!row_belongs_to_score_table(data))
+ return 1;
+ current_playlist.length--;
+ return score_delete(data);
+ default:
+ return 1;