Documentation
¶
Overview ¶
Package demozoo interacts with the demozoo.org API for data scraping and file downloads.
Index ¶
- Variables
- func Fix() error
- func InsertProds(p *releases.Productions, quiet bool) error
- func Prod(prod releases.ProductionV1, quiet bool) insert.Record
- func RefreshMeta() error
- func RefreshPouet() error
- type Category
- type Product
- type Record
- func (r *Record) DoseeMeta() error
- func (r *Record) Download(overwrite bool, api *prods.ProductionsAPIv1, st Stat) (skip bool)
- func (r *Record) FileMeta() error
- func (r *Record) Save() error
- func (r *Record) Stmt() (query string, args []any)
- func (r *Record) String(total int) string
- func (r *Record) ZipContent() (ok bool, err error)
- type Records
- type Releaser
- type ReleaserProducts
- type Request
- type Stat
Constants ¶
This section is empty.
Variables ¶
var ( ErrFilePath = errors.New("filepath requirement cannot be empty") ErrFilename = errors.New("filename requirement cannot be empty") ErrTooFew = errors.New("too few record values") ErrNA = errors.New("this feature is not implemented") ErrNoRel = errors.New("no productions exist for this releaser") )
var ErrNoQuery = errors.New("query statement is empty")
Functions ¶
func InsertProds ¶ added in v1.6.0
func InsertProds(p *releases.Productions, quiet bool) error
InsertProds adds the Demozoo releasers productions to the database. API: https://demozoo.org/api/v1/releasers/ Except for errors, setting quiet to false disables all stdout feedback.
func Prod ¶ added in v1.6.0
func Prod(prod releases.ProductionV1, quiet bool) insert.Record
Prod mutates the raw Demozoo API releaser production data to database ready values. Except for errors, setting quiet to false disables all stdout feedback.
func RefreshMeta ¶
func RefreshMeta() error
RefreshMeta synchronises missing file entries with Demozoo sourced metadata.
func RefreshPouet ¶ added in v1.6.0
func RefreshPouet() error
RefreshPouet synchronises missing file entries with Demozoo sourced metadata.
Types ¶
type Product ¶ added in v1.6.0
type Product struct {
Code int
Status string
API prods.ProductionsAPIv1
}
Product is a demozoo production.
type Record ¶
type Record struct {
Count int
FilePath string // absolute path to file
ID string // MySQL auto increment id
UUID string // record unique id
Filename string
Filesize string
FileZipContent string
CreatedAt string
UpdatedAt string
SumMD5 string // file download MD5 hash
Sum384 string // file download SHA384 hash
Readme string
DOSeeBinary string
Platform string
GroupFor string
GroupBy string
Title string
Section string
CreditText []string
CreditCode []string
CreditArt []string
CreditAudio []string
WebIDDemozoo uint // demozoo production id
WebIDPouet uint
LastMod time.Time // file download last modified time
}
Record update for an item in the "file" table of the database.
func (*Record) Download ¶
Download the first available remote file linked in the Demozoo production record.
func (*Record) Stmt ¶ added in v1.6.0
Stmt creates the SQL prepare statement and values to update a Demozoo production.
func (*Record) ZipContent ¶
ZipContent reads an archive and saves its content to the database.
type Releaser ¶ added in v1.6.0
type Releaser struct {
Code int
Status string
API releaser.ReleaserV1
}
Releaser is a demozoo scener or group.
type ReleaserProducts ¶ added in v1.6.0
type ReleaserProducts struct {
Code int
Status string
API releases.Productions
}
ReleaserProducts are the productions of a demozoo releaser.
func (*ReleaserProducts) Get ¶ added in v1.6.0
func (r *ReleaserProducts) Get(id uint) error
type Request ¶
type Request struct {
All bool // Parse all demozoo entries.
Overwrite bool // Overwrite any existing files.
Refresh bool // Refresh all demozoo entries.
Simulate bool // Simulate database save.
ByID string // Filter by ID.
}
Request Demozoo entries.
type Stat ¶
Stat are the remote query statistics.
func (*Stat) FileExist ¶
FileExist returns false if the FilePath of the record points to a missing file.
func (*Stat) NextPouet ¶ added in v1.6.0
NextPouet iterates over the Records to update sync their Pouet data to the database.
func (*Stat) NextRefresh ¶
NextRefresh iterates over the Records to update sync their Demozoo data to the database.