Add support for favorite Studios (#4675)

* Backend changes
* Add favorite icon to studio cards
* Add favorite button to studio page
* Add studio favorite filtering
This commit is contained in:
WithoutPants
2024-03-14 11:17:44 +11:00
committed by GitHub
parent e5929389b4
commit 8c454582c7
25 changed files with 185 additions and 52 deletions

View File

@@ -24,6 +24,7 @@ func ToJSON(ctx context.Context, reader FinderImageStashIDGetter, studio *models
Name: studio.Name,
URL: studio.URL,
Details: studio.Details,
Favorite: studio.Favorite,
IgnoreAutoTag: studio.IgnoreAutoTag,
CreatedAt: json.JSONTime{Time: studio.CreatedAt},
UpdatedAt: json.JSONTime{Time: studio.UpdatedAt},

View File

@@ -62,6 +62,7 @@ func createFullStudio(id int, parentID int) models.Studio {
Name: studioName,
URL: url,
Details: details,
Favorite: true,
CreatedAt: createTime,
UpdatedAt: updateTime,
Rating: &rating,
@@ -89,9 +90,10 @@ func createEmptyStudio(id int) models.Studio {
func createFullJSONStudio(parentStudio, image string, aliases []string) *jsonschema.Studio {
return &jsonschema.Studio{
Name: studioName,
URL: url,
Details: details,
Name: studioName,
URL: url,
Details: details,
Favorite: true,
CreatedAt: json.JSONTime{
Time: createTime,
},

View File

@@ -144,6 +144,7 @@ func studioJSONtoStudio(studioJSON jsonschema.Studio) models.Studio {
URL: studioJSON.URL,
Aliases: models.NewRelatedStrings(studioJSON.Aliases),
Details: studioJSON.Details,
Favorite: studioJSON.Favorite,
IgnoreAutoTag: studioJSON.IgnoreAutoTag,
CreatedAt: studioJSON.CreatedAt.GetTime(),
UpdatedAt: studioJSON.UpdatedAt.GetTime(),