mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user