application package#
Subpackages#
- application.db package
- Submodules
- application.db.apikeys module
- application.db.blob module
add_reference()
build_blob_query()
cancel_zip()
count_blobs()
count_tag_uses()
create_blob()
create_blob_previews()
create_preview_model()
create_preview_video()
delete_blob()
file_info()
get_blob_data()
get_blobs()
get_tags_from_mime()
get_uid()
get_zip_progress()
init()
mark_as_completed()
remove_reference()
save_blob_data()
set_blob_ephemeral()
set_blob_hidden()
set_blob_tags()
set_mime_from_ext()
sum_blob_size()
unzip_file_into_blobs()
zip_matching_blobs()
- application.db.book module
append_ebook()
borrow_book()
build_book_query()
build_keywords()
count_all_user_books()
count_books()
create_book()
edit_book()
get_book()
get_book_tag()
get_books()
init()
keyword_tokenize()
link_book_tag()
next_out_of_date_book_rfid()
norm_query()
process_book_tag()
process_share_hist()
refresh_book_data()
relink_book_tag()
remove_ebook()
return_book()
set_book_owner()
share_book_with_non_user()
share_book_with_user()
subsonic_init()
unlink_book_tag()
- application.db.bugs module
- application.db.datafeed module
- application.db.documents module
- application.db.inventory module
- application.db.notification module
- application.db.perms module
- application.db.sessions module
- application.db.settings module
- application.db.users module
authenticate()
count_users()
create_user()
delete_user()
dump_collection()
export_user_data()
get_admins()
get_user_by_id()
get_user_data()
get_user_list()
group_filter()
is_locked()
login_attempts_remaining()
process_user_data()
unlock_user()
update_user_display_name()
update_user_email()
update_user_groups()
update_user_module()
update_user_password()
update_user_perms()
update_user_theme()
update_username()
userids_in_groups()
- application.db.weather module
- Module contents
- application.exceptions package
- Module contents
AuthenticationError
BadUserNameError
BlobDoesNotExistError
BookCannotBeShared
BookTagDoesNotExistError
BookTagExistsError
BugReportDoesNotExistError
ClientError
DocumentDoesNotExistError
FeedDocumentDoesNotExistError
FeedDoesNotExistError
InsufficientDiskSpace
InvalidColor
InvalidFeedKindError
InvalidJWTError
InvalidPhone
InvalidSize
InvalidSubscriptionToken
ItemDoesNotExistError
ItemExistsError
MissingConfig
SubsonicError
UserDoesNotExistError
UserExistsError
UserIsLocked
WebPushException
- Module contents
- application.integrations package
- Subpackages
- Submodules
- application.integrations.exceptions module
- application.integrations.github module
- application.integrations.google_books module
- application.integrations.graphql module
- application.integrations.images module
- application.integrations.models module
- application.integrations.pdf module
- application.integrations.qrcode module
- application.integrations.system module
- application.integrations.videos module
- Module contents
- application.monkeypatch package
- application.resolvers package
- Subpackages
- application.resolvers.mutation package
- Submodules
- application.resolvers.mutation.apikeys module
- application.resolvers.mutation.blob module
- application.resolvers.mutation.book module
- application.resolvers.mutation.bugs module
- application.resolvers.mutation.datafeed module
- application.resolvers.mutation.documents module
- application.resolvers.mutation.inventory module
- application.resolvers.mutation.notification module
- application.resolvers.mutation.sessions module
- application.resolvers.mutation.settings module
- application.resolvers.mutation.users module
- application.resolvers.mutation.weather module
- Module contents
- application.resolvers.query package
- Submodules
- application.resolvers.query.apikeys module
- application.resolvers.query.blob module
- application.resolvers.query.book module
- application.resolvers.query.bugs module
- application.resolvers.query.datafeed module
- application.resolvers.query.documents module
- application.resolvers.query.integrations module
- application.resolvers.query.inventory module
- application.resolvers.query.last_mutation module
- application.resolvers.query.notification module
- application.resolvers.query.sessions module
- application.resolvers.query.settings module
- application.resolvers.query.users module
- application.resolvers.query.weather module
- Module contents
- application.resolvers.mutation package
- Submodules
- application.resolvers.decorators module
- Module contents
- Subpackages
- application.routes package
- application.scalars package
- application.types package
- Submodules
- application.types.apikey module
- application.types.badnotification module
- application.types.badtagquery module
- application.types.blob module
- application.types.blob_storage module
- application.types.blobcount module
- application.types.bloblist module
- application.types.blobsearchfilter module
- application.types.book module
Book
Book.audiobook
Book.authors
Book.categories
Book.creator
Book.description
Book.ebooks
Book.has_description
Book.id
Book.industryIdentifiers
Book.language
Book.maturityRating
Book.owner
Book.ownerHistory
Book.pageCount
Book.publishedDate
Book.publisher
Book.rfid
Book.shareHistory
Book.shared
Book.smallThumbnail
Book.subtitle
Book.thumbnail
Book.title
- application.types.bookcreatedata module
- application.types.bookeditdata module
- application.types.bookident module
- application.types.booklist module
- application.types.bookownerhist module
- application.types.booksearchfilter module
- application.types.bookshare module
- application.types.booktag module
- application.types.bugcomment module
- application.types.bugreport module
- application.types.bugreportcreationfailederror module
- application.types.config module
- application.types.configlist module
- application.types.diskusage module
- application.types.document module
- application.types.documentmin module
- application.types.ebook module
- application.types.feed module
- application.types.feeddocument module
- application.types.insufficientperms module
- application.types.invalidfields module
- application.types.inventorysearchfilter module
- application.types.issuelabel module
- application.types.issuelist module
- application.types.item module
- application.types.lastmutation module
- application.types.logresult module
- application.types.notification module
- application.types.qrparseresponse module
- application.types.repositoryissue module
- application.types.schema module
- application.types.schemaparam module
- application.types.schemaquery module
- application.types.schemareturntype module
- application.types.schematype module
- application.types.sorting module
- application.types.sortingoutput module
- application.types.subscription module
- application.types.subscriptionkeys module
- application.types.subscriptionlist module
- application.types.subscriptiontoken module
- application.types.subscriptiontokenkeys module
- application.types.subsonicalbum module
- application.types.subsonicsearch module
- application.types.subsonictrack module
- application.types.systeminfo module
- application.types.theme module
- application.types.themecolor module
- application.types.themecoloroutput module
- application.types.themeoutput module
- application.types.themesize module
- application.types.themesizeoutput module
- application.types.userbookcount module
- application.types.userdata module
- application.types.usermindata module
- application.types.usertheme module
- application.types.userthemeoutput module
- application.types.weatheralert module
- application.types.weatherexecution module
- application.types.weathertemp module
- application.types.weathertempoutput module
- application.types.weatheruser module
- application.types.weatheruserinput module
- application.types.zipprogress module
- Module contents
Submodules#
application.md module#
Adjust Markdown to handle line breaks in lists and other edge cases.
application.tokens module#
This module handles JWT token creation, decoding, and validation for user sessions and API keys.
- application.tokens.create_user_token(username)#
Generate a JWT token for a given username and start a session.
This function creates a JWT token using the provided username and a randomly generated token ID. The token is signed using a private key and the RS256 algorithm. After generating the token, it starts a session with the token and username.
- Parameters:
username (str) – The username for which the token is being created.
- Returns:
The generated JWT token.
- Return type:
str
- application.tokens.decode_cookies(cookies)#
Decodes a string of cookies into a dictionary.
- Parameters:
cookies (str) – A string containing cookies in the format ‘key1=value1; key2=value2; …’.
- Returns:
A dictionary where the keys are cookie names and the values are cookie values.
- Return type:
dict
- application.tokens.decode_user_token(token)#
Decodes a JWT token using a global public key.
- Parameters:
token (str) – The JWT token to decode.
- Returns:
The decoded token payload.
- Return type:
dict
- Raises:
InvalidJWTError – If the token is expired or invalid.
- application.tokens.get_request_token()#
Extracts the authorization token from the request headers.
The function checks for the ‘Authorization’ header first. If not found, it looks for the ‘Cookie’ header and attempts to decode it to find the ‘Authorization’ token. If neither is found, it returns None.
- Returns:
The extracted token if present and valid, otherwise None.
- Return type:
str
- application.tokens.init()#
Initialize the JWT token system by loading the private and public keys.
- Return type:
None
- application.tokens.token_is_valid(token)#
Check if the provided token is valid.
This function checks the validity of a token by verifying if it is either a valid session token or a valid API key.
- Parameters:
token (str) – The token to be validated.
- Returns:
True if the token is valid, False otherwise.
- Return type:
bool
Module contents#
This module initializes the Flask application and sets up the database.
It includes the application configuration, schema loading, and route initialization.
- application.init(*, no_auth=False, blob_path=None, data_db_url='')#
Initialize the application and database.
- Parameters:
no_auth (bool) – Flag to disable authentication. Default is False.
blob_path (str, optional) – Path to the blob storage. Default is None.
data_db_url (str) – URL to the database. Default is an empty string.
- Returns:
The initialized Flask application instance.
- Return type:
Flask