controller.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:EasyStorj 作者: lakewik 项目源码 文件源码
def insert_file_to_playlist_endpoint(file_local_public_hash, playlist_id):
    initSession()

    ownstorj_playlist_manager = OwnStorjPlaylistManager()
    ownstorj_public_file_sharing_manager = OwnStorjPublicFileSharingManager()

    if session['logged_in'] or (request.remote_addr == "127.0.0.1" and can_login_local_without_auth()):
        if file_local_public_hash != "":
            public_file_details = ownstorj_public_file_sharing_manager.get_public_file_details_by_local_hash(file_local_public_hash)
            ownstorj_playlist_manager.insert_track(track_name=public_file_details[0]["file_name"]
                                                   , track_local_file_id=file_local_public_hash
                                                   , playlist_id=playlist_id)

        return '{result: "success"}', 200  # return the HTTP 200 statuss code - OK
    else:
        return '{result: "unauthorized"}', 401
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号