Make sure that playlist check is runned only when needed.
silenced the warning (comparsion of unsigned and int types). Used static_cast on unsigned to get ints.