예제 #1
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
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()
예제 #2
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
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()
예제 #3
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
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()
예제 #4
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
def cmd_mark_hitlist(*args):
    """marks best tracks with the \"hitlist\" tag"""
    from ardj import database
    database.Open().mark_hitlist()
    database.commit()
예제 #5
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
def cmd_db_purge(*args):
    """deletes dead data from the database"""
    from ardj import database
    database.Open().purge()
    database.commit()
예제 #6
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
def cmd_update_track_weights(*args):
    """shift current weights to real weights"""
    from ardj import database, tracks
    tracks.update_real_track_weights()
    database.commit()
예제 #7
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
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()
예제 #8
0
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()
예제 #9
0
파일: cli.py 프로젝트: Alwnikrotikz/ardj
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()
예제 #10
0
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()
예제 #11
0
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()
예제 #12
0
def cmd_mark_hitlist(*args):
    """marks best tracks with the \"hitlist\" tag"""
    from ardj import database
    database.Open().mark_hitlist()
    database.commit()
예제 #13
0
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()
예제 #14
0
파일: users.py 프로젝트: umonkey/ardj
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()