+static int check_playlist_path(char *path, void *data)
+{
+ struct para_buffer *pb = data;
+ struct osl_row *aft_row;
+ int ret = aft_get_row_of_path(path, &aft_row);
+
+ if (ret < 0)
+ para_printf(pb, "%s: %s\n", path, PARA_STRERROR(-ret));
+ return 1;
+}
+
+static int check_playlist(struct osl_row *row, void *data)
+{
+ struct para_buffer *pb = data;
+ struct osl_object playlist_def;
+ char *playlist_name;
+ int ret = get_playlist_data(row, &playlist_name, &playlist_def);
+
+ if (ret < 0) {
+ para_printf(pb, "failed to get playlist data: %s\n",
+ PARA_STRERROR(-ret));
+ return 1;
+ }
+ if (*playlist_name) { /* skip dummy row */
+ para_printf(pb, "checking playlist %s...\n", playlist_name);
+ for_each_line_ro(playlist_def.data, playlist_def.size,
+ check_playlist_path, pb);
+ }
+ osl_close_disk_object(&playlist_def);
+ return 1;
+}
+
+int playlist_check_callback(__a_unused const struct osl_object *query,
+ struct osl_object *result)
+{
+ struct para_buffer pb = {.buf = NULL};
+
+ para_printf(&pb, "checking playlists...\n");
+ osl_rbtree_loop(playlists_table, BLOBCOL_ID, &pb,
+ check_playlist);
+ result->data = pb.buf;
+ result->size = pb.size;
+ return 1;
+}
+