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

@@ -1610,6 +1610,11 @@ func createStudioFromModel(ctx context.Context, sqb *sqlite.StudioStore, studio
return nil
}
func getStudioBoolValue(index int) bool {
index = index % 2
return index == 1
}
// createStudios creates n studios with plain Name and o studios with camel cased NaMe included
func createStudios(ctx context.Context, n int, o int) error {
sqb := db.Studio
@@ -1630,6 +1635,7 @@ func createStudios(ctx context.Context, n int, o int) error {
studio := models.Studio{
Name: name,
URL: getStudioStringValue(index, urlField),
Favorite: getStudioBoolValue(index),
IgnoreAutoTag: getIgnoreAutoTag(i),
}
// only add aliases for some scenes