}
/**
- * Delete one entry from the statistics and from the score table.
+ * Delete an audio file from the score table and update mood statistics.
*
- * \param aft_row The audio file which is no longer admissible.
+ * \param aft_row Identifies the row to delete.
*
- * \return Positive on success, negative on errors.
+ * \return Standard.
*
* \sa \ref score_delete().
*/
static int mood_delete_audio_file(const struct osl_row *aft_row)
{
- int ret;
-
- ret = row_belongs_to_score_table(aft_row, NULL);
- if (ret < 0)
- return ret;
- if (!ret) /* not admissible, nothing to do */
- return 1;
+ if (!row_belongs_to_score_table(aft_row))
+ return 0;
return delete_from_statistics_and_score_table(aft_row);
}
int ret;
bool is_admissible, was_admissible;
struct afs_info afsi;
- unsigned rank;
if (!current_mood)
return 1; /* nothing to do */
- ret = row_belongs_to_score_table(aft_row, &rank);
- if (ret < 0)
- return ret;
- was_admissible = ret;
+ was_admissible = row_belongs_to_score_table(aft_row);
is_admissible = mp_eval_row(aft_row, current_mood->parser_context);
if (!was_admissible && !is_admissible)
return 1;
percent = 100;
else if (percent < 0)
percent = 0;
- PARA_DEBUG_LOG("moving from rank %u to %li%%\n", rank, percent);
+ PARA_DEBUG_LOG("moving to %li%%\n", percent);
return score_update(aft_row, percent);
}