Skip to main content

PoTorrentData

Porla-specific data for a torrent, such as category, tags and session.

Properties​

category: string?​

v0.42.0

Gets the category.

session: PoSessionHandle​

v0.42.0

Gets the PoSessionHandle for the torrent that this torrent data is associated with.

Methods​

has_tag(tag: string): boolean​

v0.42.0

Returns true if the given tag exists.

metadata(key: string): object​

tags(): string[]​

v0.42.0

Returns a string array of all the tags.

update(values: table): void​

v0.51.0

Updates category, metadata and tags.

Example​

data:update({
category = "new category",
metadata = {
foo = porla.null, -- will remove the key `foo`
bar = 1337 -- adds/sets bar
},
tags = { "tv", "not-tv" } -- replaces the tag list
})