Warning
Please know that the API is not stable at this time. API changes, additions and removals are only documented in the release changelogs, so make sure to read them. Things should stabilize once HPX enters beta status.
Meta
|
Add items to the metadata queue |
|
Add a list of urls to the download queue |
|
Check for new release |
|
Clear a queue |
Get the changelog in markdown formatted text The changelog returned is for the current release or a new update |
|
|
Get progress of command operation |
|
Get state of command |
|
Get the returned command value |
Get a list of download handlers |
|
Retrieve available translation locales |
|
|
Get log |
|
Get a list of logins |
Get a list of metadata handlers |
|
Pull unread notifications |
|
Get various server properties |
|
|
Get current items in a queue |
|
Get current state of a queue |
Get version of components: ‘core’, ‘db’ and ‘torrent’ |
|
Mark and unread notification as read |
|
|
Reindex datebase items |
|
Add an item to a queue |
|
Restart the application |
|
Shutdown the application |
|
Start running a command |
|
Start a queue |
|
Stop command from running |
|
Stop a queue |
|
Submit login credentials |
|
Sweep trashed items |
|
Update the application with a new release. |
UI
|
Get a list of available sort item indexes and names |
|
Get all translations for given locale |
|
Get count of items in view |
|
Fetch items from the database. |
|
not ready yet… |
|
not ready yet… |
|
Get a translation by translation id. |
|
Update metatags for items in view |
Events
|
An event for when a gallery has been read |
|
An event for when a page has been read |
Item
|
Add a gallery to a filter |
|
Add a gallery to a grouping |
|
Check if a gallery exists in the database |
|
Get the last page that was read for given gallery. |
|
Get next/prev page by either gallery or page id |
|
Get similar items |
|
Load gallery data from a path |
|
Open a gallery or page in an external viewer |
|
Remove a gallery from a collection |
|
Remove a gallery from a filter |
|
Remove a gallery from a grouping |
|
Scan for galleries in the given directory/archive |
|
Check if gallery/page source exists on disk |
|
Synchronise the gallery source with the database, meaning if the source is a path on the filesystem, it will rescan the source for any possibly new items for given item. |
|
Update filters |
Gallery
|
Add a gallery to a filter |
|
Add a gallery to a grouping |
|
Check if a gallery exists in the database |
|
Get the last page that was read for given gallery. |
|
Get next/prev page by either gallery or page id |
|
Get similar items |
|
Load gallery data from a path |
|
Open a gallery or page in an external viewer |
|
Remove a gallery from a collection |
|
Remove a gallery from a filter |
|
Remove a gallery from a grouping |
|
Scan for galleries in the given directory/archive |
|
Check if gallery/page source exists on disk |
|
Synchronise the gallery source with the database, meaning if the source is a path on the filesystem, it will rescan the source for any possibly new items for given item. |
|
Update filters |
General
Error
Unable to execute python code at api.rst:330:
No module named ‘happypanda.interface.general’
Tags
|
Get the most common tags for item |
|
Get tags for item |
Get count of namespacetags in the database |
|
|
Search for tags |
|
Update tags on an item |
Database
|
Remove an item from the database PERMANENTLY |
|
Get count of items in the database |
|
Get image for item. |
|
Get item |
|
Get a list of items |
|
Get count of items related to given item |
|
Get item related to given item and count |
|
Create a new item and add it to the database |
|
Search for items |
|
Update an existing item |
|
Update metatags for an item |
Plugin
|
Disable a plugin |
|
Get information for a specific plugin |
|
Get configuration for a specific plugin |
|
Install a plugin |
|
Get a list plugins |
|
Remove a plugin |
|
Send a message to a plugin for a specific plugin |
|
Set/update configuration for a specific plugin |
|
Check for new release and update the application |
Configuration
|
Get item configuration. |
Save config to disk |
|
|
Set/update configuration |
|
Set/update item configuration |
add_item_to_queue
(item_id=0, item_type=<ItemType.Gallery: 1>, options={}, queue_type=<QueueType.Metadata: 1>, priority=<Priority.Medium: 2>)¶Add an item to a queue
bool indicating whether the addition was successful
add_items_to_metadata_queue
(items_kind=<ItemsKind.tags_missing_items: 4>, item_type=<ItemType.Gallery: 1>, options={}, priority=<Priority.Medium: 2>)¶Add items to the metadata queue
add_urls_to_download_queue
(urls=[], identifier=[], options={}, priority=<Priority.Medium: 2>)¶Add a list of urls to the download queue
urls (list
) – list of urls
identifier – list of specific download handlers to match against
options (dict
) – download options
priority (Priority
) – priority of items in queue
bool indicating whether the addition was successful
check_update
(push=False)¶Check for new release
push (bool
) – whether to push out notifications if an update is found
{
'url' : str,
'tag' : str
'changes' : str,
}
or null
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
get_changelog()
– when a new update is found, its changelog is immediately available here
update_application()
clear_queue
(queue_type=<QueueType.Metadata: 1>)¶Clear a queue
queue_type (QueueType
) – type of queue
bool indicating whether the action was successful
get_changelog
()¶Get the changelog in markdown formatted text The changelog returned is for the current release or a new update
{
'version': str,
'changes': str
}
See also
get_command_progress
(command_ids=None)¶Get progress of command operation
If the command did not set a maximum value, the returned percent will be set to less than 0.0
for infinity.
This should be polled every few seconds to get updated values.
command_ids (Optional
[list
]) – list of command ids or None to retrieve progress of all occurring commands
{
command_id : { 'title': str,
'value': float,
'subtitle': str,
'subtype': :py:class:`.ProgressType`,
'max': float,
'percent': float,
'type': :py:class:`.ProgressType`,
'text': str,
'timestamp':int,
'state': :py:class:`.CommandState`
}
}
or
{
command_id : None
}
or, if command_ids
is None
:
[
{ 'title': str,
'value': float,
'subtitle': str,
'subtype': :py:class:`.ProgressType`,
'max': float,
'percent': float,
'type': :py:class:`.ProgressType`,
'text': str,
'timestamp':int
},
...
]
get_command_state
(command_ids)¶Get state of command
command_ids (list
) – list of command ids
{
command_id : :py:class:`.CommandState`
}
get_command_value
(command_ids, raise_error=True)¶Get the returned command value
command_ids (list
) – list of command ids
raise_error – raise error if command failed or has not finished running
{
command_id : value
}
get_download_info
()¶Get a list of download handlers
Args:
a list of download handlers sorted by priority
get_locales
()¶Retrieve available translation locales
{
str : {
'locale' : str
'namespaces': [str, ...]
}
}
See also
get_log
(log_type=None)¶Get log
log_type (Optional
[LogType
]) – type of log to fetch
‘log’: a formatted str of the logs
}
get_login_info
(identifier=None)¶Get a list of logins
identifier (Optional
[str
]) – name of the login identifier, this was set by the plugin
‘identifier’: text ‘name’: text ‘status’: status set by plugin ‘logged_in’: bool ‘user’: current logged in user ‘sites’: list of supported sites set by plugin ‘description’: description set by plugin
}
a list of logins or if an identifier was provided
get_metadata_info
()¶Get a list of metadata handlers
Args:
a list of metadata handlers sorted by priority
get_notifications
()¶Pull unread notifications
a list of notification message objects
The first call to this function is used to lazily connect the client to the notification system, and as such will always return an empty list
get_properties
()¶Get various server properties
a Properties message object
get_queue_items
(limit=100, queue_type=<QueueType.Metadata: 1>)¶Get current items in a queue
limit (int
) – limit the amount of items returned
queue_type (QueueType
) – type of queue
[
]
get_queue_state
(queue_type=<QueueType.Metadata: 1>, include_finished=True)¶Get current state of a queue
queue_type (QueueType
) – type of queue
inculde_finished – include finished tasks
{
}
get_version
()¶Get version of components: ‘core’, ‘db’ and ‘torrent’
{
'core' : [int, int, int],
'db' : [int, int, int],
'torrent' : [int, int, int],
}
mark_notification_read
(ids)¶Mark and unread notification as read
ids (list
) – a list of notification ids
status
reindex
(limit=None)¶Reindex datebase items
limit (Optional
[int
]) – reindex only last x amount of items
{
'status': bool,
}
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
remove_item_from_queue
(item_id=0, item_type=<ItemType.Gallery: 1>, queue_type=<QueueType.Metadata: 1>)¶Add an item to a queue
restart_application
(delay=10)¶Restart the application
delay (int
) – delay in seconds before restarting
{
'status': A ``bool`` indicating whether a restart was scheduled
}
shutdown_application
(delay=10)¶Shutdown the application
delay (int
) – delay in seconds before shutting down
{
'status': A ``bool`` indicating whether a shutdown was scheduled
}
start_command
(command_ids)¶Start running a command
command_ids (list
) – list of command ids
{
command_id : state
}
start_queue
(queue_type=<QueueType.Metadata: 1>)¶Start a queue
queue_type (QueueType
) – type of queue
bool indicating whether the action was successful
stop_command
(command_ids)¶Stop command from running
command_ids (list
) – list of command ids
{
command_id : state
}
stop_queue
(queue_type=<QueueType.Metadata: 1>)¶Stop a queue
queue_type (QueueType
) – type of queue
bool indicating whether the action was successful
submit_login
(identifier, credentials, options={})¶Submit login credentials
identifier (str
) – name of the login identifier, this was set by the plugin
credentials (dict
) – login credentials
options (dict
) – login options
{
'status': text,
'logged_in': bool
}
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
sweep_trash
(options=None, force=False)¶Sweep trashed items
options (Optional
[dict
]) – trash options
force (bool
) – force removal of items even if not due
bool
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
update_application
(download_url=None, restart=True)¶Update the application with a new release. If download_url is not provided, a check for a new release will occur
download_url (Optional
[str
]) – a url to the release file, can be path to file on the system
restart (bool
) – restart the application after installing the new update
{
'status': A ``bool`` indicating whether the install was successful or not
}
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
get_image_from_path
(path, size=<ImageSize.Medium: 3>, url=False, uri=False)¶Get image from given path or url. Image content is base64 encoded.
path (str
) – a supported path (note that the path must exist on this system if path points to a file/directory)
size (ImageSize
) – size of image
url (bool
) – replace image content with http url to image file
uri (bool
) – turn raw base64 string into an URI
{
item_id : command_id
}
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
get_sort_indexes
(item_type=None, translate=True, locale=None)¶Get a list of available sort item indexes and names
item_type (Optional
[ItemType
]) – return applicable indexes for a specific item type
translate (bool
) – translate the sort expression name
locale (Optional
[str
]) – locale to get translations from (will override default locale)
[
{
'index' : int,
'name': str,
'item_type': int value of :py:class:`.ItemType`
},
...
]
get_translations
(locale=None)¶Get all translations for given locale
You can find more about translations here.
locale (Optional
[str
]) – locale to get translations from (will override default locale)
{
'namespace.translation_id' : string
}
See also
get_view_count
(item_type=<ItemType.Gallery: 1>, item_id=None, related_type=None, search_query='', search_options={}, filter_id=None, view_filter=<ViewType.Library: 1>)¶Get count of items in view
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Collection
, ItemType.Grouping
search_query (str
) – filter item by search terms
search_options (dict
) – options to apply when filtering, see Settings for available search options. A mapping of ‘namespace.name’ : bool
filter_id (Optional
[int
]) – current ItemType.Filter
item id
view_filter (ViewType
) – type of view, set None
to not apply any filter
related_type (Optional
[ItemType
]) – child item
item_id (Optional
[int
]) – id of parent item
{
'count' : int
}
library_view
(item_type=<ItemType.Gallery: 1>, item_id=None, related_type=None, page=0, limit=100, sort_by=None, sort_desc=False, search_query='', search_options={}, filter_id=None, view_filter=<ViewType.Library: 1>, include_profile=False, profile_sizes=[<enum 'ImageSize'>], url=False, uri=False)¶Fetch items from the database. Provides pagination.
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Collection
, ItemType.Grouping
page (int
) – current page (zero-indexed)
sort_by (Optional
[ItemSort
]) – either a ItemSort
or a sort index
sort_desc (bool
) – order descending (default is ascending)
limit (int
) – amount of items per page
search_query (str
) – filter item by search terms
search_options (dict
) – options to apply when filtering, see Settings for available search options. A mapping of ‘namespace.name’ : bool
filter_id (Optional
[int
]) – current ItemType.Filter
item id
view_filter (ViewType
) – type of view, set None
to not apply any filter
related_type (Optional
[ItemType
]) – child item
item_id (Optional
[int
]) – id of parent item
include_profile (bool
) – include profile image data in items, note that this will introduce a performance hit
profile_sizes (list
) – a list of ImageSize
, only relevant when include_profile=true
[
item message object,
...
]
See also
submit_temporary_view
(view_type=<TemporaryViewType.GalleryAddition: 1>, view_id=None)¶not ready yet…
view_type (TemporaryViewType
) – type of temporary view
view_id (Optional
[int
]) – id of a specific view
[]
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
temporary_view
(view_type=<TemporaryViewType.GalleryAddition: 1>, view_id=None, limit=100, offset=0)¶not ready yet…
view_type (TemporaryViewType
) – type of temporary view
view_id (Optional
[int
]) – id of a specific view
limit (int
) – amount of items per page
offset (int
) – offset the results by n items
{
'items': [
...
],
'count': int # count of all items in view
}
translate
(t_id, locale=None, default=None, placeholder={}, count=None)¶Get a translation by translation id. Raises error if a default value was not provided and no translation was found.
You can find more about translations here.
t_id (str
) – translation id
locale (Optional
[str
]) – locale to get translations from (will override default locale)
default (Optional
[str
]) – default text when no translation was found
placeholder (str
) –
?
count (Optional
[int
]) – pluralization
string
See also
Update metatags for items in view
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Collection
, ItemType.Grouping
metatags (dict
) – a dict of { metatag_name : bool }
page (int
) – current page (zero-indexed)
limit (int
) – amount of items per page, set to None to apply to all items in the view
search_query (str
) – filter item by search terms
search_options (dict
) – options to apply when filtering, see Settings for available search options. A mapping of ‘namespace.name’ : bool
filter_id (Optional
[int
]) – current ItemType.Filter
item id
view_filter (ViewType
) – type of view, set None
to not apply any filter
related_type (Optional
[ItemType
]) – child item
item_id (Optional
[int
]) – id of parent item
Returns: boolean
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
gallery_open_event
(item_id=0)¶An event for when a gallery is opened
item_id (int
) – id of gallery item
bool indicating whether the event was successful
gallery_read_event
(item_id=0, update_to_last_page=True)¶An event for when a gallery has been read
item_id (int
) – id of gallery item
update_to_last_page – update progress to last page
bool indicating whether the event was successful
page_read_event
(item_id=0)¶An event for when a page has been read
item_id (int
) – id of page item
bool indicating whether the event was successful
note that there is no need to call gallery_read_event()
after a complete read
if using this event (unless you want to force a complete read)
add_item_log
(item_type=<ItemType.Gallery: 1>, item_id=0, msg='', level=<LogLevel.INFO: 4>)¶Log a message for item
add_to_collection
(gallery_id=0, item_id=0, item={})¶Add a gallery to a collection
gallery_id (int
) – id of gallery
item_id (int
) – id of existing collection, mutually exclusive with item
parameter
item (dict
) – collection message object, mutually exclusive with item_id
parameter
bool whether gallery was added to collection or not
add_to_filter
(gallery_id=0, item_id=0, item={})¶Add a gallery to a filter
gallery_id (int
) – id of gallery
item_id (int
) – id of existing filter, mutually exclusive with item
parameter
item (dict
) – filter message object, mutually exclusive with item_id
parameter
bool whether gallery was added to filter or not
add_to_grouping
(gallery_id=0, item_id=0, item={})¶Add a gallery to a grouping
gallery_id (int
) – id of gallery
item_id (int
) – id of existing grouping, mutually exclusive with item
parameter
item (dict
) – grouping message object, mutually exclusive with item_id
parameter
bool whether gallery was added to grouping or not
gallery_exists
(url=None, name='')¶Check if a gallery exists in the database
url (Optional
[str
]) – check if gallery exists with given url
name (str
) – check if gallery exists with given name
Note
In the case that indexing is required, this function will take longer to complete
bool
get_last_read_page
(item_id=0)¶Get the last page that was read for given gallery.
item_id (int
) – id of existing gallery
{
'page': page message object,
'end': bool, # if the gallery has been considered read, use this to determine if should continue reading
'percent': float, # progress of how far this page is in the total amount of pages,
'count': int, # total amount of pages,
'timestamp': int # time when page was read
}
if such thing exists, else
{}
get_page
(page_id=None, gallery_id=None, number=None, prev=False)¶Get next/prev page by either gallery or page id
page_id (Optional
[int
]) – id of page
gallery_id (Optional
[int
]) – id of gallery
number (Optional
[int
]) – retrieve specific page number
prev (bool
) – by default next page is retrieved, to retrieve prev page set this to true
Page object
get_similar
(item_type=<ItemType.Gallery: 1>, item_id=0, limit=10)¶Get similar items
item_type (ItemType
) – possible items are ItemType.Gallery
item_id (int
) – id of item
limit – amount of items
[
item message object,
...
]
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
load_gallery_from_path
(path='')¶Load gallery data from a path
path (str
) – a supported path (note that the path must exist on this system if path points to a file/directory)
a GalleryFS message object
open_gallery
(item_id=0, item_type=<ItemType.Gallery: 1>, viewer_args=None)¶Open a gallery or page in an external viewer
item_id (int
) – id of item
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Page
viewer_args (Optional
[str
]) – commandline arguments to supply the viewer, overriding the default viewer arguments specified in settings
bool indicating if item was successfully opened
remove_from_collection
(gallery_id=0, item_id=0)¶Remove a gallery from a collection
gallery_id (int
) – id of gallery
item_id (int
) – id of existing collection
bool whether gallery was removed from collection or not
remove_from_filter
(gallery_id=0, item_id=0)¶Remove a gallery from a filter
gallery_id (int
) – id of gallery
item_id (int
) – id of existing filter
bool whether gallery was removed from filter or not
remove_from_grouping
(gallery_id=0, item_id=0)¶Remove a gallery from a grouping
gallery_id (int
) – id of gallery
item_id (int
) – id of existing grouping
bool whether gallery was removed from grouping or not
scan_galleries
(path, scan_options={}, limit=0, offset=0)¶Scan for galleries in the given directory/archive
path (str
) – path to directory/archive that exists on this system
scan_options (dict
) – options to apply to the scanning process, see Settings for available scanning options
offset (int
) – offset the list of found items to add
limit (int
) – limit the list of found items to add
{
'command_id': int,
'view_id': int
}
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
Temporary View – This function puts objects in a temporary view.
Use the returned view id
with temporary_view()
to retrieve the objects.
source_exists
(item_type=<ItemType.Gallery: 1>, item_id=0, check_all=False)¶Check if gallery/page source exists on disk
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Page
item_id (int
) – id of item
check_all (bool
) – goes through all pages and checks them, default behaviour is to only check parent files/folders. Only relevant for ItemType.Gallery
{
'exists' : bool
'missing' : [
{'id': int, 'item_type': item_type},
...
]
}
sync_with_source
(item_id=0, delete_existing=False, true_to_source=True)¶Synchronise the gallery source with the database, meaning if the source is a path on the filesystem, it will rescan the source for any possibly new items for given item.
item_id (int
) – id of existing gallery
delete_existing (bool
) – delete all existing items before synchronizing
true_to_source (bool
) – delete items not found in source
status
Note
Only galleries with the single_source=True
property are supported
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
update_filters
(item_ids=None)¶Update filters
item_ids (Optional
[list
]) – list of specific filters to update
status
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
Get all tags from the db
limit (int
) – limit the amount of items returned
offset (Optional
[int
]) – offset the results by n items
{
namespace : [ tag message object, ...],
...
}
Get the most common tags for item
item_type (ItemType
) – possible items are ItemType.Artist
, ItemType.Grouping
, ItemType.Collection
item_id (int
) – id of item to fetch tags for
limit (int
) – limit amount of tags returned
{
namespace : [ tag message object, ...],
...
}
Get tags for item
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Page
,
ItemType.Grouping
, ItemType.Collection
item_id (int
) – id of item to fetch tags for
raw (bool
) – if true, tags from descendant ItemType’s will not be included
(this only makes sense when ItemType is ItemType.Gallery
)
{
namespace : [ tag message object, ...],
...
}
Get count of namespacetags in the database
{
'count' : int
}
Search for tags
search_query (str
) – search string
search_options (dict
) – options to apply when filtering, see Settings for available search options
only_namespace (bool
) – only search for matching namespace <not implemented yet>
only_tag (bool
) – only search for matching tag <not implemented yet>
sort_by (Optional
[ItemSort
]) – either a ItemSort
or a sort index
sort_desc (bool
) – order descending (default is ascending)
limit (int
) – limit the amount of items returned
offset (Optional
[int
]) – offset the results by n items
{
namespace : [ tag message object, ...],
...
}
Update tags on an item
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Page
,
ItemType.Grouping
, ItemType.Collection
item_id (int
) – id of item to update tags for
tags (dict
) – tags
bool whether tags were updated or not
delete_item
(item_type=<ItemType.Gallery: 1>, item_id=0, options={})¶Remove an item from the database PERMANENTLY
[]
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
delete_items
(item_type=<ItemType.Gallery: 1>, item_ids=[], options={})¶Remove an item from the database PERMANENTLY
boolean or None
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
get_count
(item_type=<ItemType.Gallery: 1>)¶Get count of items in the database
item_type (ItemType
) – type of item
{
'count' : int
}
get_image
(item_type=<ItemType.Gallery: 1>, item_ids=[], size=<ImageSize.Medium: 3>, url=False, uri=False)¶Get image for item. Image content is base64 encoded.
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Artist
,
ItemType.Collection
, ItemType.Grouping
, ItemType.Page
item_ids (list
) – list of item ids
size (ImageSize
) – size of image
url (bool
) – replace image content with http url to image file
uri (bool
) – turn raw base64 string into an URI
{
item_id : command_id
}
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
get_item
(item_type=<ItemType.Gallery: 1>, item_id=0)¶Get item
item_type (ItemType
) – type of item to get
item_id (int
) – id of item
item message object
get_items
(item_type=<ItemType.Gallery: 1>, limit=100, offset=None)¶Get a list of items
item_type (ItemType
) – type of item to get
limit (int
) – limit the amount of items returned
offset (Optional
[int
]) – offset the results by n items
include_count – include count
of items in results
{
'items' : [
item message object,
...
]
'count': total number of items
}
Get count of items related to given item
Get item related to given item and count
[
related item message object,
...
]
new_item
(item_type=<ItemType.Gallery: 1>, item={}, options={})¶Create a new item and add it to the database
item_type (ItemType
) – type of item to create
item (dict
) – item message object
bool
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
search_items
(item_type=<ItemType.Gallery: 1>, search_query='', search_options={}, sort_by=None, sort_desc=False, full_search=True, limit=100, offset=None)¶Search for items
item_type (ItemType
) – all of ItemType
except ItemType.Page
search_query (str
) – filter item by search terms
search_options (dict
) – options to apply when filtering, see Settings for available search options
sort_by (Optional
[ItemSort
]) – either a ItemSort
or a sort index
sort_desc (bool
) – order descending (default is ascending)
limit (int
) – amount of items
offset (Optional
[int
]) – offset the results by n items
[
item message object,
...
]
See also
update_item
(item_type=<ItemType.Gallery: 1>, item={}, options={})¶Update an existing item
item_type (ItemType
) – type of item to create
item (dict
) – item messeage object
bool indicating whether item was updated
See also
Update metatags for an item
item_type (ItemType
) – possible items are ItemType.Gallery
, ItemType.Page
,
ItemType.Artist
, ItemType.Collection
item_id (int
) – id of item
item_ids (list
) – list of id of items
metatags (dict
) – a dict of { metatag_name : bool }
None or boolean
If item_ids is used, this function will return a command id
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
check_plugin_update
(plugin_ids=None, force=True, push=False)¶Check for new plugin release
plugin_ids (Optional
[list
]) – a list of plugin ids or None for check on all enabled or failed plugins
force (bool
) – bypass user config on allowing checking for updates
push (bool
) – whether to push out notifications if an update is found
{
'plugin_id': '',
'url':'',
'version':(0, 0, 0)
}
A list of found updates
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
disable_plugin
(plugin_id='')¶Disable a plugin
plugin_id (str
) – UUID4 of plugin
status
get_plugin
(plugin_id='')¶Get information for a specific plugin
plugin_id (str
) – UUID4 of plugin
{
}
get_plugin_config
(plugin_id='')¶Get configuration for a specific plugin
plugin_id (str
) – UUID4 of plugin
{
'plugin_id': id of plugin,
'config': {}
}
install_plugin
(plugin_id='')¶Install a plugin
plugin_id (str
) – UUID4 of plugin
status
list_plugins
(state=None)¶Get a list plugins
state (Optional
[PluginState
]) – filter list by plugin state
{
}
remove_plugin
(plugin_id='')¶Remove a plugin
plugin_id (str
) – UUID4 of plugin
status
send_plugin_message
(plugin_id='', msg={})¶Send a message to a plugin for a specific plugin
plugin_id (str
) – UUID4 of plugin
msg (dict
) – message to send to plugin
message from plugin
set_plugin_config
(plugin_id='', cfg={})¶Set/update configuration for a specific plugin
plugin_id (str
) – UUID4 of plugin
cfg (dict
) – a dict containing namespace.key
:value
Status
update_plugin
(plugin_ids=None, force=False, push=True)¶Check for new release and update the application
plugin_ids (Optional
[list
]) – a list of plugin ids or None for update on all enabled or failed plugins
force (bool
) – bypass user config on allowing checking for updates
push (bool
) – whether to push out notifications after an update
a list of plugin ids of the plugins that have been successfully updated
Async function – This function returns a command id
.
Retrieve the value of the function with get_command_value()
.
See Asynchronous Commands for more information.
See also
Most configuration keys can be stored and retrieved by namespace.key
See Settings for all server defined configuration keys and their default values.
There exists the special namespace this
to retrieve and store configuration only visible to the
client in question. The server will resolve the namespace this
to the session owner’s name
(the client that created the session).
These configuration keys will appear in the server’s config.yaml
file under the session owner’s name upon save.
get_config
(cfg={})¶Get configuration. See Settings.
cfg (dict
) – a dict containing namespace.key
:default value
or an empty dict to retrieve all settings
{
'namespace.key': value
}
get_item_config
(item_type=<ItemType.Gallery: 1>, item_id=0, cfg={}, yaml=True)¶Get item configuration. See Settings.
item_type (ItemType
) – type of item to create
item_id (int
) – id of item
cfg (dict
) – a dict containing namespace.key
:default value
or an empty dict to retrieve all settings
yaml (bool
) – a boolean whether to return a YAML formatted string
{
'namespace.key': value
}
a str if yaml is set to true, else
save_config
()¶Save config to disk
Status
This is not related to item configuration
set_config
(cfg)¶Set/update configuration
cfg (dict
) – a dict containing namespace.key
:value
Status
set_item_config
(item_type=<ItemType.Gallery: 1>, item_id=0, cfg=None, yaml=None)¶Set/update item configuration
item_type (ItemType
) – type of item to create
item_id (int
) – id of item
cfg (Optional
[dict
]) – a dict containing namespace.key
:value
, mutually exclusive with yaml
yaml (Optional
[str
]) – a YAML formatted str of a namespace.key
:value
mapping, mutually exclusive with cfg
Status