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) error
- func RefreshMeta() error
- func RefreshPouet() error
- type Category
- type MsDosProducts
- 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
- type WindowsProducts
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") )
Functions ¶
func InsertProds ¶ added in v1.6.0
func InsertProds(p *releases.Productions) error
InsertProds adds the collection of Demozoo productions to the file database.
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 MsDosProducts ¶ added in v1.7.0
type MsDosProducts struct { Code int Status string API []releases.ProductionV1 Count int Finds int }
MsDosProducts are productions that match platforms id 4, MS-DOS. Productions with the tag "lost" are skipped. Productions created on or newer than 1 Jan. 2000 are skipped.
func (*MsDosProducts) Get ¶ added in v1.7.0
func (m *MsDosProducts) Get() error
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. 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 linked Demozoo records and sync any linked Pouet data to the local files table.
func (*Stat) NextRefresh ¶
NextRefresh iterates over the Records to update sync their Demozoo data to the database.
type WindowsProducts ¶ added in v1.7.0
type WindowsProducts struct { Code int Status string API []releases.ProductionV1 Count int Finds int }
func (*WindowsProducts) Get ¶ added in v1.7.0
func (m *WindowsProducts) Get() error