Documentation
¶
Index ¶
- func Slugify(rawURL string) string
- func WriteCSV(scenes []models.Scene, path string) error
- func WriteJSON(sf studioFile, path string) error
- type Flat
- func (f *Flat) Export(_, _, _ string) error
- func (f *Flat) ListStudios() ([]models.Studio, error)
- func (f *Flat) Load(studioURL string) ([]models.Scene, error)
- func (f *Flat) MarkDeleted(studioURL, _ string, ids []string) error
- func (f *Flat) Save(studioURL string, scenes []models.Scene) error
- func (f *Flat) UpsertStudio(_ models.Studio) error
- type SQLite
- func (s *SQLite) Close() error
- func (s *SQLite) Export(format, path, studioURL string) error
- func (s *SQLite) ListStudios() ([]models.Studio, error)
- func (s *SQLite) Load(studioURL string) ([]models.Scene, error)
- func (s *SQLite) MarkDeleted(studioURL, siteID string, ids []string) error
- func (s *SQLite) Save(studioURL string, scenes []models.Scene) error
- func (s *SQLite) UpsertStudio(studio models.Studio) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Slugify ¶
Slugify turns a studio URL into a safe, human-readable filename stem. e.g. "https://www.manyvids.com/Profile/590705/bettie-bondage/Store/Videos"
→ "manyvids.com-profile-590705-bettie-bondage-store-videos"
Types ¶
type Flat ¶
type Flat struct {
// contains filtered or unexported fields
}
Flat is the default store backed by a per-studio JSON file on disk. JSON is always written — it is the backing format for incremental updates. CSV is written as an additional export when included in formats.
func (*Flat) ListStudios ¶
ListStudios is a no-op for the flat store.
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
SQLite is the optional store backed by a SQLite database. Enabled with the --db flag. JSON/CSV are exported from it on request.
func (*SQLite) MarkDeleted ¶
type Store ¶
type Store interface {
// Load returns all scenes previously scraped for this studio URL.
Load(studioURL string) ([]models.Scene, error)
// Save persists the full scene list for a studio URL, replacing any prior data.
Save(studioURL string, scenes []models.Scene) error
// MarkDeleted soft-deletes scenes by ID — sets DeletedAt, does not remove records.
MarkDeleted(studioURL, siteID string, ids []string) error
// Export writes scenes for a studio URL to a file in the given format ("json" or "csv").
// Used when SQLite is the source of truth and flat files are requested as output.
Export(format, path, studioURL string) error
// UpsertStudio records or updates a studio entry. No-op for the flat store.
UpsertStudio(studio models.Studio) error
// ListStudios returns all known studios. Empty for the flat store.
ListStudios() ([]models.Studio, error)
}
Store is the persistence layer. The default implementation uses flat JSON/CSV files. An optional SQLite-backed implementation is selected with the --db flag.