feat(prescene): parse single scnlog release for --single-uri page::1m
Handle the page::1m marker before the generic single-uri branch
(previously unreachable):
- select the latest prescene source from external_sources with meta IS NULL
(sql.ErrNoRows -> no-op)
- parse article.single: type_id from post-(\d+), size_mb, genre,
unique artists, tracks count and total duration (h:M:s)
- download the release NFO (anchor "Download NFO" -> onclick href)
and save it to <nfo_dir>/<first-letter-of-title>/<title>.nfo
- update external_sources.meta with compact JSON by id via db.Exec,
writing {} when every field is empty
Add model.ScnlogMeta / model.ScnlogSource structures.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
import "database/sql"
|
||||
|
||||
// ScnlogMeta — структура, що кладеться в external_sources.meta (compact JSON).
|
||||
type ScnlogMeta struct {
|
||||
SizeMb *float64 `json:"size_mb"`
|
||||
Genre *string `json:"genre"`
|
||||
Artist *[]string `json:"artist"`
|
||||
Tracks *int `json:"tracks"`
|
||||
Duration *string `json:"duration"`
|
||||
}
|
||||
|
||||
// ScnlogSource — рядок вибірки останнього необробленого prescene-джерела.
|
||||
type ScnlogSource struct {
|
||||
Id int64 `db:"id"`
|
||||
TypeId int64 `db:"type_id"`
|
||||
Title string `db:"title"`
|
||||
Meta sql.NullString `db:"meta"`
|
||||
ExSource string `db:"eXsource"`
|
||||
}
|
||||
Reference in New Issue
Block a user