-
-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make mutating metadata ops mutation * Implement scene generate screenshot * Remove fetch policy on metadata mutations * Port UI changes to v2.5 * Set generated image in database
- Loading branch information
1 parent
34d8293
commit 3de6955
Showing
28 changed files
with
442 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
mutation MetadataImport { | ||
metadataImport | ||
} | ||
|
||
mutation MetadataExport { | ||
metadataExport | ||
} | ||
|
||
mutation MetadataScan($input: ScanMetadataInput!) { | ||
metadataScan(input: $input) | ||
} | ||
|
||
mutation MetadataGenerate($input: GenerateMetadataInput!) { | ||
metadataGenerate(input: $input) | ||
} | ||
|
||
mutation MetadataAutoTag($input: AutoTagMetadataInput!) { | ||
metadataAutoTag(input: $input) | ||
} | ||
|
||
mutation MetadataClean { | ||
metadataClean | ||
} | ||
|
||
mutation StopJob { | ||
stopJob | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,7 @@ | ||
query MetadataImport { | ||
metadataImport | ||
} | ||
|
||
query MetadataExport { | ||
metadataExport | ||
} | ||
|
||
query MetadataScan($input: ScanMetadataInput!) { | ||
metadataScan(input: $input) | ||
} | ||
|
||
query MetadataGenerate($input: GenerateMetadataInput!) { | ||
metadataGenerate(input: $input) | ||
} | ||
|
||
query MetadataAutoTag($input: AutoTagMetadataInput!) { | ||
metadataAutoTag(input: $input) | ||
} | ||
|
||
query MetadataClean { | ||
metadataClean | ||
} | ||
|
||
query JobStatus { | ||
jobStatus { | ||
progress | ||
status | ||
message | ||
} | ||
} | ||
|
||
query StopJob { | ||
stopJob | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/stashapp/stash/pkg/manager" | ||
"github.com/stashapp/stash/pkg/models" | ||
) | ||
|
||
func (r *mutationResolver) MetadataScan(ctx context.Context, input models.ScanMetadataInput) (string, error) { | ||
manager.GetInstance().Scan(input.UseFileMetadata) | ||
return "todo", nil | ||
} | ||
|
||
func (r *mutationResolver) MetadataImport(ctx context.Context) (string, error) { | ||
manager.GetInstance().Import() | ||
return "todo", nil | ||
} | ||
|
||
func (r *mutationResolver) MetadataExport(ctx context.Context) (string, error) { | ||
manager.GetInstance().Export() | ||
return "todo", nil | ||
} | ||
|
||
func (r *mutationResolver) MetadataGenerate(ctx context.Context, input models.GenerateMetadataInput) (string, error) { | ||
manager.GetInstance().Generate(input.Sprites, input.Previews, input.Markers, input.Transcodes) | ||
return "todo", nil | ||
} | ||
|
||
func (r *mutationResolver) MetadataAutoTag(ctx context.Context, input models.AutoTagMetadataInput) (string, error) { | ||
manager.GetInstance().AutoTag(input.Performers, input.Studios, input.Tags) | ||
return "todo", nil | ||
} | ||
|
||
func (r *mutationResolver) MetadataClean(ctx context.Context) (string, error) { | ||
manager.GetInstance().Clean() | ||
return "todo", nil | ||
} | ||
|
||
func (r *mutationResolver) JobStatus(ctx context.Context) (*models.MetadataUpdateStatus, error) { | ||
status := manager.GetInstance().Status | ||
ret := models.MetadataUpdateStatus{ | ||
Progress: status.Progress, | ||
Status: status.Status.String(), | ||
Message: "", | ||
} | ||
|
||
return &ret, nil | ||
} | ||
|
||
func (r *mutationResolver) StopJob(ctx context.Context) (bool, error) { | ||
return manager.GetInstance().Status.Stop(), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package manager | ||
|
||
import ( | ||
"github.com/stashapp/stash/pkg/ffmpeg" | ||
) | ||
|
||
func makeScreenshot(probeResult ffmpeg.VideoFile, outputPath string, quality int, width int, time float64) { | ||
encoder := ffmpeg.NewEncoder(instance.FFMPEGPath) | ||
options := ffmpeg.ScreenshotOptions{ | ||
OutputPath: outputPath, | ||
Quality: quality, | ||
Time: time, | ||
Width: width, | ||
} | ||
encoder.Screenshot(probeResult, options) | ||
} |
Oops, something went wrong.