From 720b233be6111a208debcc6aa5403144cfe10a36 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:36:05 +1000 Subject: [PATCH] Rename movie group backend (#5044) * Rename movie go files * Rename movie package to group --- .../{movieloader_gen.go => grouploader_gen.go} | 0 internal/api/resolver_model_studio.go | 4 ++-- internal/api/resolver_model_tag.go | 4 ++-- internal/api/{routes_movie.go => routes_group.go} | 0 internal/api/urlbuilders/{movie.go => group.go} | 0 internal/manager/task_export.go | 4 ++-- internal/manager/task_import.go | 4 ++-- internal/static/embed.go | 6 +++--- .../static/{movie/movie.png => group/group.png} | Bin pkg/{movie => group}/export.go | 2 +- pkg/{movie => group}/export_test.go | 2 +- pkg/{movie => group}/import.go | 2 +- pkg/{movie => group}/import_test.go | 2 +- pkg/{movie => group}/query.go | 2 +- pkg/models/{movie.go => group.go} | 0 pkg/models/jsonschema/{movie.go => group.go} | 0 pkg/models/{model_movie.go => model_group.go} | 0 .../{repository_movie.go => repository_group.go} | 0 pkg/sqlite/{movies.go => group.go} | 0 pkg/sqlite/{movies_filter.go => group_filter.go} | 0 pkg/sqlite/{movies_test.go => group_test.go} | 0 21 files changed, 16 insertions(+), 16 deletions(-) rename internal/api/loaders/{movieloader_gen.go => grouploader_gen.go} (100%) rename internal/api/{routes_movie.go => routes_group.go} (100%) rename internal/api/urlbuilders/{movie.go => group.go} (100%) rename internal/static/{movie/movie.png => group/group.png} (100%) rename pkg/{movie => group}/export.go (99%) rename pkg/{movie => group}/export_test.go (99%) rename pkg/{movie => group}/import.go (99%) rename pkg/{movie => group}/import_test.go (99%) rename pkg/{movie => group}/query.go (98%) rename pkg/models/{movie.go => group.go} (100%) rename pkg/models/jsonschema/{movie.go => group.go} (100%) rename pkg/models/{model_movie.go => model_group.go} (100%) rename pkg/models/{repository_movie.go => repository_group.go} (100%) rename pkg/sqlite/{movies.go => group.go} (100%) rename pkg/sqlite/{movies_filter.go => group_filter.go} (100%) rename pkg/sqlite/{movies_test.go => group_test.go} (100%) diff --git a/internal/api/loaders/movieloader_gen.go b/internal/api/loaders/grouploader_gen.go similarity index 100% rename from internal/api/loaders/movieloader_gen.go rename to internal/api/loaders/grouploader_gen.go diff --git a/internal/api/resolver_model_studio.go b/internal/api/resolver_model_studio.go index 9dcfd5df5..2111039c8 100644 --- a/internal/api/resolver_model_studio.go +++ b/internal/api/resolver_model_studio.go @@ -6,9 +6,9 @@ import ( "github.com/stashapp/stash/internal/api/loaders" "github.com/stashapp/stash/internal/api/urlbuilders" "github.com/stashapp/stash/pkg/gallery" + "github.com/stashapp/stash/pkg/group" "github.com/stashapp/stash/pkg/image" "github.com/stashapp/stash/pkg/models" - "github.com/stashapp/stash/pkg/movie" "github.com/stashapp/stash/pkg/performer" "github.com/stashapp/stash/pkg/scene" ) @@ -100,7 +100,7 @@ func (r *studioResolver) PerformerCount(ctx context.Context, obj *models.Studio, func (r *studioResolver) GroupCount(ctx context.Context, obj *models.Studio, depth *int) (ret int, err error) { if err := r.withReadTxn(ctx, func(ctx context.Context) error { - ret, err = movie.CountByStudioID(ctx, r.repository.Group, obj.ID, depth) + ret, err = group.CountByStudioID(ctx, r.repository.Group, obj.ID, depth) return err }); err != nil { return 0, err diff --git a/internal/api/resolver_model_tag.go b/internal/api/resolver_model_tag.go index 11b9f935b..14237d2fe 100644 --- a/internal/api/resolver_model_tag.go +++ b/internal/api/resolver_model_tag.go @@ -6,9 +6,9 @@ import ( "github.com/stashapp/stash/internal/api/loaders" "github.com/stashapp/stash/internal/api/urlbuilders" "github.com/stashapp/stash/pkg/gallery" + "github.com/stashapp/stash/pkg/group" "github.com/stashapp/stash/pkg/image" "github.com/stashapp/stash/pkg/models" - "github.com/stashapp/stash/pkg/movie" "github.com/stashapp/stash/pkg/performer" "github.com/stashapp/stash/pkg/scene" "github.com/stashapp/stash/pkg/studio" @@ -122,7 +122,7 @@ func (r *tagResolver) StudioCount(ctx context.Context, obj *models.Tag, depth *i func (r *tagResolver) GroupCount(ctx context.Context, obj *models.Tag, depth *int) (ret int, err error) { if err := r.withReadTxn(ctx, func(ctx context.Context) error { - ret, err = movie.CountByTagID(ctx, r.repository.Group, obj.ID, depth) + ret, err = group.CountByTagID(ctx, r.repository.Group, obj.ID, depth) return err }); err != nil { return 0, err diff --git a/internal/api/routes_movie.go b/internal/api/routes_group.go similarity index 100% rename from internal/api/routes_movie.go rename to internal/api/routes_group.go diff --git a/internal/api/urlbuilders/movie.go b/internal/api/urlbuilders/group.go similarity index 100% rename from internal/api/urlbuilders/movie.go rename to internal/api/urlbuilders/group.go diff --git a/internal/manager/task_export.go b/internal/manager/task_export.go index 150894914..ecbcf593a 100644 --- a/internal/manager/task_export.go +++ b/internal/manager/task_export.go @@ -15,13 +15,13 @@ import ( "github.com/stashapp/stash/internal/manager/config" "github.com/stashapp/stash/pkg/fsutil" "github.com/stashapp/stash/pkg/gallery" + "github.com/stashapp/stash/pkg/group" "github.com/stashapp/stash/pkg/image" "github.com/stashapp/stash/pkg/logger" "github.com/stashapp/stash/pkg/models" "github.com/stashapp/stash/pkg/models/json" "github.com/stashapp/stash/pkg/models/jsonschema" "github.com/stashapp/stash/pkg/models/paths" - "github.com/stashapp/stash/pkg/movie" "github.com/stashapp/stash/pkg/performer" "github.com/stashapp/stash/pkg/scene" "github.com/stashapp/stash/pkg/sliceutil" @@ -1135,7 +1135,7 @@ func (t *ExportTask) exportGroup(ctx context.Context, wg *sync.WaitGroup, jobCha continue } - newGroupJSON, err := movie.ToJSON(ctx, groupReader, studioReader, m) + newGroupJSON, err := group.ToJSON(ctx, groupReader, studioReader, m) if err != nil { logger.Errorf("[groups] <%s> error getting tag JSON: %v", m.Name, err) diff --git a/internal/manager/task_import.go b/internal/manager/task_import.go index b83ca0b3c..ae9a58657 100644 --- a/internal/manager/task_import.go +++ b/internal/manager/task_import.go @@ -13,12 +13,12 @@ import ( "github.com/stashapp/stash/pkg/file" "github.com/stashapp/stash/pkg/fsutil" "github.com/stashapp/stash/pkg/gallery" + "github.com/stashapp/stash/pkg/group" "github.com/stashapp/stash/pkg/image" "github.com/stashapp/stash/pkg/logger" "github.com/stashapp/stash/pkg/models" "github.com/stashapp/stash/pkg/models/jsonschema" "github.com/stashapp/stash/pkg/models/paths" - "github.com/stashapp/stash/pkg/movie" "github.com/stashapp/stash/pkg/performer" "github.com/stashapp/stash/pkg/scene" "github.com/stashapp/stash/pkg/studio" @@ -351,7 +351,7 @@ func (t *ImportTask) ImportGroups(ctx context.Context) { logger.Progressf("[groups] %d of %d", index, len(files)) if err := r.WithTxn(ctx, func(ctx context.Context) error { - groupImporter := &movie.Importer{ + groupImporter := &group.Importer{ ReaderWriter: r.Group, StudioWriter: r.Studio, TagWriter: r.Tag, diff --git a/internal/static/embed.go b/internal/static/embed.go index 7c06c611b..3c9323a70 100644 --- a/internal/static/embed.go +++ b/internal/static/embed.go @@ -7,7 +7,7 @@ import ( "io/fs" ) -//go:embed performer performer_male scene image tag studio movie +//go:embed performer performer_male scene image tag studio group var data embed.FS const ( @@ -26,8 +26,8 @@ const ( Studio = "studio" DefaultStudioImage = "studio/studio.svg" - Group = "movie" - DefaultGroupImage = "movie/movie.png" + Group = "group" + DefaultGroupImage = "group/group.png" ) // Sub returns an FS rooted at path, using fs.Sub. diff --git a/internal/static/movie/movie.png b/internal/static/group/group.png similarity index 100% rename from internal/static/movie/movie.png rename to internal/static/group/group.png diff --git a/pkg/movie/export.go b/pkg/group/export.go similarity index 99% rename from pkg/movie/export.go rename to pkg/group/export.go index 06f492320..418ce7bed 100644 --- a/pkg/movie/export.go +++ b/pkg/group/export.go @@ -1,4 +1,4 @@ -package movie +package group import ( "context" diff --git a/pkg/movie/export_test.go b/pkg/group/export_test.go similarity index 99% rename from pkg/movie/export_test.go rename to pkg/group/export_test.go index ee83a360a..5f8d9f7dc 100644 --- a/pkg/movie/export_test.go +++ b/pkg/group/export_test.go @@ -1,4 +1,4 @@ -package movie +package group import ( "errors" diff --git a/pkg/movie/import.go b/pkg/group/import.go similarity index 99% rename from pkg/movie/import.go rename to pkg/group/import.go index fea410d95..4bf038c87 100644 --- a/pkg/movie/import.go +++ b/pkg/group/import.go @@ -1,4 +1,4 @@ -package movie +package group import ( "context" diff --git a/pkg/movie/import_test.go b/pkg/group/import_test.go similarity index 99% rename from pkg/movie/import_test.go rename to pkg/group/import_test.go index c1d1e18f6..c4ca47442 100644 --- a/pkg/movie/import_test.go +++ b/pkg/group/import_test.go @@ -1,4 +1,4 @@ -package movie +package group import ( "context" diff --git a/pkg/movie/query.go b/pkg/group/query.go similarity index 98% rename from pkg/movie/query.go rename to pkg/group/query.go index 8b2e5baef..bc0753b00 100644 --- a/pkg/movie/query.go +++ b/pkg/group/query.go @@ -1,4 +1,4 @@ -package movie +package group import ( "context" diff --git a/pkg/models/movie.go b/pkg/models/group.go similarity index 100% rename from pkg/models/movie.go rename to pkg/models/group.go diff --git a/pkg/models/jsonschema/movie.go b/pkg/models/jsonschema/group.go similarity index 100% rename from pkg/models/jsonschema/movie.go rename to pkg/models/jsonschema/group.go diff --git a/pkg/models/model_movie.go b/pkg/models/model_group.go similarity index 100% rename from pkg/models/model_movie.go rename to pkg/models/model_group.go diff --git a/pkg/models/repository_movie.go b/pkg/models/repository_group.go similarity index 100% rename from pkg/models/repository_movie.go rename to pkg/models/repository_group.go diff --git a/pkg/sqlite/movies.go b/pkg/sqlite/group.go similarity index 100% rename from pkg/sqlite/movies.go rename to pkg/sqlite/group.go diff --git a/pkg/sqlite/movies_filter.go b/pkg/sqlite/group_filter.go similarity index 100% rename from pkg/sqlite/movies_filter.go rename to pkg/sqlite/group_filter.go diff --git a/pkg/sqlite/movies_test.go b/pkg/sqlite/group_test.go similarity index 100% rename from pkg/sqlite/movies_test.go rename to pkg/sqlite/group_test.go