def cmd_play(*args): """sets urgent playlist for next hour""" from ardj import database, tracks tracks.set_urgent(" ".join(args).decode("utf-8")) database.commit()
def cmd_mark_orphans(*args): """marks tracks that don't belong to a playlist with the "orphan" label""" from ardj import database database.Open().mark_orphans() database.commit()
def cmd_mark_recent(*args): """marks 100 recently added tracks with the "recent" label""" from ardj import database database.Open().mark_recent_music() database.commit()
def cmd_mark_hitlist(*args): """marks best tracks with the \"hitlist\" tag""" from ardj import database database.Open().mark_hitlist() database.commit()
def cmd_db_purge(*args): """deletes dead data from the database""" from ardj import database database.Open().purge() database.commit()
def cmd_update_track_weights(*args): """shift current weights to real weights""" from ardj import database, tracks tracks.update_real_track_weights() database.commit()
def cmd_update_track_lengths(*args): """update track lengths from files (maintenance)""" from ardj import database, tracks ids = [int(n) for n in args if n.isdigit()] tracks.update_track_lengths(ids) database.commit()
def cmd_update_schedule(*args): """looks for events in the Last.fm database""" from ardj import database, tout tout.update_schedule(refresh="--refresh" in args) database.commit()
def merge_aliased_votes(): """Moves votes from aliases to real jids.""" for k, v in get_aliases().items(): for alias in v: database.execute("UPDATE votes SET email = ? WHERE email = ?", (k, alias, )) database.commit()