View Source YaBTT.Schema.Torrent (YaBTT v0.1.5)
The schema for torrents.
fields
Fields
info_hash
- The info hash of the torrent.peers
- The peers that are currently seeding or leeching the torrent.
associations
Associations
peers
- The peers that are currently seeding or leeching the torrent.
indexes
Indexes
info_hash
- The info hash of the torrent.
Link to this section Summary
Functions
A torrent can be created or updated with a changeset. The changeset requires the info_hash to be present.
Link to this section Types
Link to this section Functions
@spec changeset(changeset_t() | t(), params()) :: changeset_t()
A torrent can be created or updated with a changeset. The changeset requires the info_hash to be present.
parameters
Parameters
torrent
- The torrent to validate.params
- The parameters to validate.
examples
Examples
iex> alias YaBTT.Schema.Torrent
iex> Torrent.changeset(%Torrent{}, %{
...> "info_hash" => <<18, 52, 86, 120, 154, 188, 222, 241, 35, 69, 103, 137, 171, 205, 239, 18, 52, 86, 120, 154>>})
#Ecto.Changeset<action: nil, changes: %{info_hash: <<18, 52, 86, 120, 154, 188, 222, 241, 35, 69, 103, 137, 171, 205, 239, 18, 52, 86, 120, 154>>}, errors: [], data: #YaBTT.Schema.Torrent<>, valid?: true>