예제 #1
0
def readAlbums():
    albumList = []
    with open(os.path.join(PWD, "albums.json"), "r") as f:
        albums = json.load(f)
        for album in albums:
            pagename = album.get("out", None)
            title = album.get("title", None)
            directories = album.get("dirs", None)
            if not pagename or not title or not directories:
                continue
            if not all([hasPermissions(x) for x in directories]):
                continue
            albumList.append(AlbumEntry(pagename, title, directories))
    return albumList
예제 #2
0
def readAlbums():
    albumList = []
    with open(os.path.join(PWD, "albums.json"), "r") as f:
        albums = json.load(f)
        for album in albums:
            pagename = album.get("out", None)
            title = album.get("title", None)
            directories = album.get("dirs", None)
            if not pagename or not title or not directories:
                continue
            if not all([hasPermissions(x) for x in directories]):
                continue
            albumList.append(AlbumEntry(pagename, title, directories))
    return albumList
예제 #3
0
def cache(path):
    if not hasPermissions(path):
        abort(403)
    return accel_redirect(CACHE_ACCEL, CACHE_PATH, path)
예제 #4
0
def albums(path):
    if not hasPermissions(path):
        abort(403)
    return accel_redirect(ALBUM_ACCEL, ALBUM_PATH, path)
예제 #5
0
def cache(path):
    if not hasPermissions(path):
        abort(403)
    return accel_redirect(CACHE_ACCEL, CACHE_PATH, path)
예제 #6
0
def albums(path):
    if not hasPermissions(path):
        abort(403)
    return accel_redirect(ALBUM_ACCEL, ALBUM_PATH, path)