Movie group renames (#5039)

* Rename Movie and MoviePartial to Group/GroupPartial
* Rename Movie interfaces
* Update movie url builders to use group
* Rename movieRoutes to groupRoutes
* Update dataloader
* Update names in sqlite package
* Rename in resolvers
* Add GroupByURL to scraper config
* Scraper backward compatibility hacks
This commit is contained in:
WithoutPants
2024-07-04 09:10:26 +10:00
committed by GitHub
parent b69d9cc840
commit 15a7b8a859
83 changed files with 1765 additions and 1646 deletions

View File

@@ -415,6 +415,30 @@ type ScrapedMovie struct {
func (ScrapedMovie) IsScrapedContent() {}
func (m ScrapedMovie) ScrapedGroup() ScrapedGroup {
ret := ScrapedGroup{
StoredID: m.StoredID,
Name: m.Name,
Aliases: m.Aliases,
Duration: m.Duration,
Date: m.Date,
Rating: m.Rating,
Director: m.Director,
URLs: m.URLs,
Synopsis: m.Synopsis,
Studio: m.Studio,
Tags: m.Tags,
FrontImage: m.FrontImage,
BackImage: m.BackImage,
}
if len(m.URLs) == 0 && m.URL != nil {
ret.URLs = []string{*m.URL}
}
return ret
}
// ScrapedGroup is a group from a scraping operation
type ScrapedGroup struct {
StoredID *string `json:"stored_id"`
@@ -435,3 +459,27 @@ type ScrapedGroup struct {
}
func (ScrapedGroup) IsScrapedContent() {}
func (g ScrapedGroup) ScrapedMovie() ScrapedMovie {
ret := ScrapedMovie{
StoredID: g.StoredID,
Name: g.Name,
Aliases: g.Aliases,
Duration: g.Duration,
Date: g.Date,
Rating: g.Rating,
Director: g.Director,
URLs: g.URLs,
Synopsis: g.Synopsis,
Studio: g.Studio,
Tags: g.Tags,
FrontImage: g.FrontImage,
BackImage: g.BackImage,
}
if len(g.URLs) > 0 {
ret.URL = &g.URLs[0]
}
return ret
}