diff --git a/graphql/documents/data/movie.graphql b/graphql/documents/data/movie.graphql index 1a72c1f247e..3fd4273d28f 100644 --- a/graphql/documents/data/movie.graphql +++ b/graphql/documents/data/movie.graphql @@ -20,6 +20,5 @@ fragment MovieData on Movie { scenes { id title - path } } diff --git a/graphql/schema/types/scene.graphql b/graphql/schema/types/scene.graphql index 2a8b1ddf5f2..8fa0fb4dc0e 100644 --- a/graphql/schema/types/scene.graphql +++ b/graphql/schema/types/scene.graphql @@ -15,7 +15,6 @@ type ScenePathsType { stream: String # Resolver webp: String # Resolver vtt: String # Resolver - chapters_vtt: String @deprecated sprite: String # Resolver funscript: String # Resolver interactive_heatmap: String # Resolver @@ -34,8 +33,6 @@ type VideoCaption { type Scene { id: ID! - checksum: String @deprecated(reason: "Use files.fingerprints") - oshash: String @deprecated(reason: "Use files.fingerprints") title: String code: String details: String @@ -43,20 +40,16 @@ type Scene { url: String @deprecated(reason: "Use urls") urls: [String!]! date: String - # rating expressed as 1-5 - rating: Int @deprecated(reason: "Use 1-100 range with rating100") # rating expressed as 1-100 rating100: Int organized: Boolean! o_counter: Int - path: String! @deprecated(reason: "Use files.path") - phash: String @deprecated(reason: "Use files.fingerprints") interactive: Boolean! interactive_speed: Int captions: [VideoCaption!] created_at: Time! updated_at: Time! - file_mod_time: Time + file_mod_time: Time @deprecated(reason: "Use files.mod_time") "The last time play count was updated" last_played_at: Time "The time index a scene was left at" @@ -66,7 +59,6 @@ type Scene { "The number ot times a scene has been played" play_count: Int - file: SceneFileType! @deprecated(reason: "Use files") files: [VideoFile!]! paths: ScenePathsType! # Resolver scene_markers: [SceneMarker!]! @@ -94,8 +86,6 @@ input SceneCreateInput { url: String @deprecated(reason: "Use urls") urls: [String!] date: String - # rating expressed as 1-5 - rating: Int @deprecated(reason: "Use 1-100 range with rating100") # rating expressed as 1-100 rating100: Int organized: Boolean @@ -126,8 +116,6 @@ input SceneUpdateInput { url: String @deprecated(reason: "Use urls") urls: [String!] date: String - # rating expressed as 1-5 - rating: Int @deprecated(reason: "Use 1-100 range with rating100") # rating expressed as 1-100 rating100: Int o_counter: Int @@ -172,8 +160,6 @@ input BulkSceneUpdateInput { url: String @deprecated(reason: "Use urls") urls: BulkUpdateStrings date: String - # rating expressed as 1-5 - rating: Int @deprecated(reason: "Use 1-100 range with rating100") # rating expressed as 1-100 rating100: Int organized: Boolean diff --git a/internal/api/resolver_model_scene.go b/internal/api/resolver_model_scene.go index 2593555472f..290b5bcbee6 100644 --- a/internal/api/resolver_model_scene.go +++ b/internal/api/resolver_model_scene.go @@ -3,14 +3,12 @@ package api import ( "context" "fmt" - "strconv" "time" "github.com/stashapp/stash/internal/api/loaders" "github.com/stashapp/stash/internal/api/urlbuilders" "github.com/stashapp/stash/internal/manager" "github.com/stashapp/stash/pkg/models" - "github.com/stashapp/stash/pkg/utils" ) func convertVideoFile(f models.File) (*models.VideoFile, error) { @@ -88,31 +86,6 @@ func (r *sceneResolver) Date(ctx context.Context, obj *models.Scene) (*string, e return nil, nil } -// File is deprecated -func (r *sceneResolver) File(ctx context.Context, obj *models.Scene) (*models.SceneFileType, error) { - f, err := r.getPrimaryFile(ctx, obj) - if err != nil { - return nil, err - } - if f == nil { - return nil, nil - } - - bitrate := int(f.BitRate) - size := strconv.FormatInt(f.Size, 10) - - return &models.SceneFileType{ - Size: &size, - Duration: handleFloat64(f.Duration), - VideoCodec: &f.VideoCodec, - AudioCodec: &f.AudioCodec, - Width: &f.Width, - Height: &f.Height, - Framerate: handleFloat64(f.FrameRate), - Bitrate: &bitrate, - }, nil -} - func (r *sceneResolver) Files(ctx context.Context, obj *models.Scene) ([]*models.VideoFile, error) { files, err := r.getFiles(ctx, obj) if err != nil { @@ -145,7 +118,6 @@ func (r *sceneResolver) Paths(ctx context.Context, obj *models.Scene) (*ScenePat objHash := obj.GetHash(config.GetVideoFileNamingAlgorithm()) vttPath := builder.GetSpriteVTTURL(objHash) spritePath := builder.GetSpriteURL(objHash) - chaptersVttPath := builder.GetChaptersVTTURL() funscriptPath := builder.GetFunscriptURL() captionBasePath := builder.GetCaptionURL() interactiveHeatmap := builder.GetInteractiveHeatmapURL() @@ -156,7 +128,6 @@ func (r *sceneResolver) Paths(ctx context.Context, obj *models.Scene) (*ScenePat Stream: &streamPath, Webp: &webpPath, Vtt: &vttPath, - ChaptersVtt: &chaptersVttPath, Sprite: &spritePath, Funscript: &funscriptPath, InteractiveHeatmap: &interactiveHeatmap, @@ -285,30 +256,6 @@ func (r *sceneResolver) StashIds(ctx context.Context, obj *models.Scene) (ret [] return stashIDsSliceToPtrSlice(obj.StashIDs.List()), nil } -func (r *sceneResolver) Phash(ctx context.Context, obj *models.Scene) (*string, error) { - f, err := r.getPrimaryFile(ctx, obj) - if err != nil { - return nil, err - } - - if f == nil { - return nil, nil - } - - val := f.Fingerprints.Get(models.FingerprintTypePhash) - if val == nil { - return nil, nil - } - - phash, _ := val.(int64) - - if phash != 0 { - hexval := utils.PhashToString(phash) - return &hexval, nil - } - return nil, nil -} - func (r *sceneResolver) SceneStreams(ctx context.Context, obj *models.Scene) ([]*manager.SceneStreamEndpoint, error) { // load the primary file into the scene _, err := r.getPrimaryFile(ctx, obj) diff --git a/internal/api/resolver_mutation_scene.go b/internal/api/resolver_mutation_scene.go index 37a9be9c844..ad495454cb9 100644 --- a/internal/api/resolver_mutation_scene.go +++ b/internal/api/resolver_mutation_scene.go @@ -45,7 +45,7 @@ func (r *mutationResolver) SceneCreate(ctx context.Context, input models.SceneCr newScene.Code = translator.string(input.Code) newScene.Details = translator.string(input.Details) newScene.Director = translator.string(input.Director) - newScene.Rating = translator.ratingConversion(input.Rating, input.Rating100) + newScene.Rating = input.Rating100 newScene.Organized = translator.bool(input.Organized) newScene.StashIDs = models.NewRelatedStashIDs(input.StashIds) @@ -168,7 +168,7 @@ func scenePartialFromInput(input models.SceneUpdateInput, translator changesetTr updatedScene.Code = translator.optionalString(input.Code, "code") updatedScene.Details = translator.optionalString(input.Details, "details") updatedScene.Director = translator.optionalString(input.Director, "director") - updatedScene.Rating = translator.optionalRatingConversion(input.Rating, input.Rating100) + updatedScene.Rating = translator.optionalInt(input.Rating100, "rating100") updatedScene.OCounter = translator.optionalInt(input.OCounter, "o_counter") updatedScene.PlayCount = translator.optionalInt(input.PlayCount, "play_count") updatedScene.PlayDuration = translator.optionalFloat64(input.PlayDuration, "play_duration") @@ -321,7 +321,7 @@ func (r *mutationResolver) BulkSceneUpdate(ctx context.Context, input BulkSceneU updatedScene.Code = translator.optionalString(input.Code, "code") updatedScene.Details = translator.optionalString(input.Details, "details") updatedScene.Director = translator.optionalString(input.Director, "director") - updatedScene.Rating = translator.optionalRatingConversion(input.Rating, input.Rating100) + updatedScene.Rating = translator.optionalInt(input.Rating100, "rating100") updatedScene.Organized = translator.optionalBool(input.Organized, "organized") updatedScene.Date, err = translator.optionalDate(input.Date, "date") diff --git a/internal/api/urlbuilders/scene.go b/internal/api/urlbuilders/scene.go index c70feafe753..10c4f347c64 100644 --- a/internal/api/urlbuilders/scene.go +++ b/internal/api/urlbuilders/scene.go @@ -57,10 +57,6 @@ func (b SceneURLBuilder) GetScreenshotURL() string { return b.BaseURL + "/scene/" + b.SceneID + "/screenshot?t=" + b.UpdatedAt } -func (b SceneURLBuilder) GetChaptersVTTURL() string { - return b.BaseURL + "/scene/" + b.SceneID + "/vtt/chapter" -} - func (b SceneURLBuilder) GetFunscriptURL() string { return b.BaseURL + "/scene/" + b.SceneID + "/funscript" } diff --git a/pkg/models/model_scene.go b/pkg/models/model_scene.go index 4cd434eed80..8cc0f45fe43 100644 --- a/pkg/models/model_scene.go +++ b/pkg/models/model_scene.go @@ -221,12 +221,6 @@ func (s ScenePartial) UpdateInput(id int) SceneUpdateInput { StashIds: stashIDs, } - if s.Rating.Set && !s.Rating.Null { - // convert to 1-100 scale - rating := Rating100To5(s.Rating.Value) - ret.Rating = &rating - } - return ret } diff --git a/pkg/models/scene.go b/pkg/models/scene.go index d04af929b93..3e1b3c16d74 100644 --- a/pkg/models/scene.go +++ b/pkg/models/scene.go @@ -128,7 +128,6 @@ type SceneCreateInput struct { URL *string `json:"url"` Urls []string `json:"urls"` Date *string `json:"date"` - Rating *int `json:"rating"` Rating100 *int `json:"rating100"` Organized *bool `json:"organized"` StudioID *string `json:"studio_id"` @@ -155,7 +154,6 @@ type SceneUpdateInput struct { URL *string `json:"url"` Urls []string `json:"urls"` Date *string `json:"date"` - Rating *int `json:"rating"` Rating100 *int `json:"rating100"` OCounter *int `json:"o_counter"` Organized *bool `json:"organized"`